Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: content/browser/devtools/protocol/tracing_handler.cc

Issue 2863623003: [DevTools] Support multiple sessions in content/ domain handlers (Closed)
Patch Set: addressed review comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/devtools/protocol/tracing_handler.h" 5 #include "content/browser/devtools/protocol/tracing_handler.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 io_context_(io_context), 124 io_context_(io_context),
125 frame_tree_node_id_(frame_tree_node_id), 125 frame_tree_node_id_(frame_tree_node_id),
126 did_initiate_recording_(false), 126 did_initiate_recording_(false),
127 return_as_stream_(false), 127 return_as_stream_(false),
128 weak_factory_(this) {} 128 weak_factory_(this) {}
129 129
130 TracingHandler::~TracingHandler() { 130 TracingHandler::~TracingHandler() {
131 } 131 }
132 132
133 // static 133 // static
134 TracingHandler* TracingHandler::FromSession(DevToolsSession* session) { 134 std::vector<TracingHandler*> TracingHandler::ForAgentHost(
135 return static_cast<TracingHandler*>( 135 DevToolsAgentHostImpl* host) {
136 session->GetHandlerByName(Tracing::Metainfo::domainName)); 136 return DevToolsSession::HandlersForAgentHost<TracingHandler>(
137 host, Tracing::Metainfo::domainName);
137 } 138 }
138 139
139 void TracingHandler::Wire(UberDispatcher* dispatcher) { 140 void TracingHandler::Wire(UberDispatcher* dispatcher) {
140 frontend_.reset(new Tracing::Frontend(dispatcher->channel())); 141 frontend_.reset(new Tracing::Frontend(dispatcher->channel()));
141 Tracing::Dispatcher::wire(dispatcher, this); 142 Tracing::Dispatcher::wire(dispatcher, this);
142 } 143 }
143 144
144 Response TracingHandler::Disable() { 145 Response TracingHandler::Disable() {
145 if (did_initiate_recording_) 146 if (did_initiate_recording_)
146 StopTracing(scoped_refptr<TracingController::TraceDataSink>()); 147 StopTracing(scoped_refptr<TracingController::TraceDataSink>());
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 360
360 std::string mode; 361 std::string mode;
361 if (tracing_dict->GetString(kRecordModeParam, &mode)) 362 if (tracing_dict->GetString(kRecordModeParam, &mode))
362 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-')); 363 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-'));
363 364
364 return base::trace_event::TraceConfig(*tracing_dict); 365 return base::trace_event::TraceConfig(*tracing_dict);
365 } 366 }
366 367
367 } // namespace tracing 368 } // namespace tracing
368 } // namespace protocol 369 } // namespace protocol
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/tracing_handler.h ('k') | content/browser/devtools/render_frame_devtools_agent_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698