Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 58be6ef

Browse filesBrowse files
addaleaxMylesBorins
authored andcommitted
src: avoid std::make_unique
Work around nodejs/build#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: nodejs/build#1254 PR-URL: #20386 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com>
1 parent de9d1f1 commit 58be6ef
Copy full SHA for 58be6ef

File tree

Expand file treeCollapse file tree

3 files changed

+9
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+9
-7
lines changed
Open diff view settings
Collapse file

‎src/inspector_agent.cc‎

Copy file name to clipboardExpand all lines: src/inspector_agent.cc
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,9 @@ class NodeInspectorClient : public V8InspectorClient {
367367
int connectFrontend(std::unique_ptr<InspectorSessionDelegate> delegate) {
368368
events_dispatched_ = true;
369369
int session_id = next_session_id_++;
370-
channels_[session_id] =
371-
std::make_unique<ChannelImpl>(client_, std::move(delegate));
370+
// TODO(addaleax): Revert back to using make_unique once we get issues
371+
// with CI resolved (i.e. revert the patch that added this comment).
372+
channels_[session_id].reset(new ChannelImpl(client_, std::move(delegate)));
372373
return session_id;
373374
}
374375

@@ -569,7 +570,8 @@ void Agent::Stop() {
569570
std::unique_ptr<InspectorSession> Agent::Connect(
570571
std::unique_ptr<InspectorSessionDelegate> delegate) {
571572
int session_id = client_->connectFrontend(std::move(delegate));
572-
return std::make_unique<InspectorSession>(session_id, client_);
573+
return std::unique_ptr<InspectorSession>(
574+
new InspectorSession(session_id, client_));
573575
}
574576

575577
void Agent::WaitForDisconnect() {
Collapse file

‎src/inspector_io.cc‎

Copy file name to clipboardExpand all lines: src/inspector_io.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ std::vector<std::string> InspectorIo::GetTargetIds() const {
357357
TransportAction InspectorIo::Attach(int session_id) {
358358
Agent* agent = parent_env_->inspector_agent();
359359
fprintf(stderr, "Debugger attached.\n");
360-
sessions_[session_id] =
361-
agent->Connect(std::make_unique<IoSessionDelegate>(this, session_id));
360+
sessions_[session_id] = agent->Connect(std::unique_ptr<IoSessionDelegate>(
361+
new IoSessionDelegate(this, session_id)));
362362
return TransportAction::kAcceptSession;
363363
}
364364

Collapse file

‎src/inspector_js_api.cc‎

Copy file name to clipboardExpand all lines: src/inspector_js_api.cc
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class JSBindingsConnection : public AsyncWrap {
6666
callback_(env->isolate(), callback) {
6767
Wrap(wrap, this);
6868
Agent* inspector = env->inspector_agent();
69-
session_ = inspector->Connect(
70-
std::make_unique<JSBindingsSessionDelegate>(env, this));
69+
session_ = inspector->Connect(std::unique_ptr<JSBindingsSessionDelegate>(
70+
new JSBindingsSessionDelegate(env, this)));
7171
}
7272

7373
void OnMessage(Local<Value> value) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.