Skip to content

Commit

Permalink
inspector: get rid of the make_unique
Browse files Browse the repository at this point in the history
PR-URL: #20895
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
  • Loading branch information
Eugene Ostroukhov authored and MylesBorins committed May 23, 2018
1 parent 235a272 commit 4933fb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/inspector/tracing_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ TracingAgent::~TracingAgent() {
}

void TracingAgent::Wire(UberDispatcher* dispatcher) {
frontend_ = std::make_unique<NodeTracing::Frontend>(dispatcher->channel());
frontend_.reset(new NodeTracing::Frontend(dispatcher->channel()));
NodeTracing::Dispatcher::wire(dispatcher, this);
}

Expand All @@ -77,7 +77,9 @@ DispatchResponse TracingAgent::start(
return DispatchResponse::Error("At least one category should be enabled");

trace_writer_ = env_->tracing_agent()->AddClient(
categories_set, std::make_unique<InspectorTraceWriter>(frontend_.get()));
categories_set,
std::unique_ptr<InspectorTraceWriter>(
new InspectorTraceWriter(frontend_.get())));
return DispatchResponse::OK();
}

Expand Down
4 changes: 2 additions & 2 deletions src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
std::unique_ptr<InspectorSessionDelegate> delegate)
: delegate_(std::move(delegate)) {
session_ = inspector->connect(1, this, StringView());
node_dispatcher_ = std::make_unique<protocol::UberDispatcher>(this);
tracing_agent_ = std::make_unique<protocol::TracingAgent>(env);
node_dispatcher_.reset(new protocol::UberDispatcher(this));
tracing_agent_.reset(new protocol::TracingAgent(env));
tracing_agent_->Wire(node_dispatcher_.get());
}

Expand Down

0 comments on commit 4933fb8

Please sign in to comment.