src: avoid std::make_unique
Work around https://github.com/nodejs/build/issues/1254, which effectively breaks stress test CI and CITGM, by avoiding `std::make_unique` for now. This workaround should be reverted once that issue is resolved. Refs: https://github.com/nodejs/build/issues/1254 PR-URL: https://github.com/nodejs/node/pull/20386 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com>
This commit is contained in:
parent
45c7e03f40
commit
283a967e35
@ -367,8 +367,9 @@ class NodeInspectorClient : public V8InspectorClient {
|
|||||||
int connectFrontend(std::unique_ptr<InspectorSessionDelegate> delegate) {
|
int connectFrontend(std::unique_ptr<InspectorSessionDelegate> delegate) {
|
||||||
events_dispatched_ = true;
|
events_dispatched_ = true;
|
||||||
int session_id = next_session_id_++;
|
int session_id = next_session_id_++;
|
||||||
channels_[session_id] =
|
// TODO(addaleax): Revert back to using make_unique once we get issues
|
||||||
std::make_unique<ChannelImpl>(client_, std::move(delegate));
|
// with CI resolved (i.e. revert the patch that added this comment).
|
||||||
|
channels_[session_id].reset(new ChannelImpl(client_, std::move(delegate)));
|
||||||
return session_id;
|
return session_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -569,7 +570,8 @@ void Agent::Stop() {
|
|||||||
std::unique_ptr<InspectorSession> Agent::Connect(
|
std::unique_ptr<InspectorSession> Agent::Connect(
|
||||||
std::unique_ptr<InspectorSessionDelegate> delegate) {
|
std::unique_ptr<InspectorSessionDelegate> delegate) {
|
||||||
int session_id = client_->connectFrontend(std::move(delegate));
|
int session_id = client_->connectFrontend(std::move(delegate));
|
||||||
return std::make_unique<InspectorSession>(session_id, client_);
|
return std::unique_ptr<InspectorSession>(
|
||||||
|
new InspectorSession(session_id, client_));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Agent::WaitForDisconnect() {
|
void Agent::WaitForDisconnect() {
|
||||||
|
@ -357,8 +357,8 @@ std::vector<std::string> InspectorIo::GetTargetIds() const {
|
|||||||
TransportAction InspectorIo::Attach(int session_id) {
|
TransportAction InspectorIo::Attach(int session_id) {
|
||||||
Agent* agent = parent_env_->inspector_agent();
|
Agent* agent = parent_env_->inspector_agent();
|
||||||
fprintf(stderr, "Debugger attached.\n");
|
fprintf(stderr, "Debugger attached.\n");
|
||||||
sessions_[session_id] =
|
sessions_[session_id] = agent->Connect(std::unique_ptr<IoSessionDelegate>(
|
||||||
agent->Connect(std::make_unique<IoSessionDelegate>(this, session_id));
|
new IoSessionDelegate(this, session_id)));
|
||||||
return TransportAction::kAcceptSession;
|
return TransportAction::kAcceptSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,8 +66,8 @@ class JSBindingsConnection : public AsyncWrap {
|
|||||||
callback_(env->isolate(), callback) {
|
callback_(env->isolate(), callback) {
|
||||||
Wrap(wrap, this);
|
Wrap(wrap, this);
|
||||||
Agent* inspector = env->inspector_agent();
|
Agent* inspector = env->inspector_agent();
|
||||||
session_ = inspector->Connect(
|
session_ = inspector->Connect(std::unique_ptr<JSBindingsSessionDelegate>(
|
||||||
std::make_unique<JSBindingsSessionDelegate>(env, this));
|
new JSBindingsSessionDelegate(env, this)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnMessage(Local<Value> value) {
|
void OnMessage(Local<Value> value) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user