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

Side by Side Diff: content/browser/devtools/protocol/inspector_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/inspector_handler.h" 5 #include "content/browser/devtools/protocol/inspector_handler.h"
6 6
7 #include "content/browser/devtools/devtools_session.h" 7 #include "content/browser/devtools/devtools_session.h"
8 #include "content/browser/frame_host/render_frame_host_impl.h" 8 #include "content/browser/frame_host/render_frame_host_impl.h"
9 9
10 namespace content { 10 namespace content {
11 namespace protocol { 11 namespace protocol {
12 12
13 InspectorHandler::InspectorHandler() 13 InspectorHandler::InspectorHandler()
14 : DevToolsDomainHandler(Inspector::Metainfo::domainName), 14 : DevToolsDomainHandler(Inspector::Metainfo::domainName),
15 host_(nullptr) { 15 host_(nullptr) {
16 } 16 }
17 17
18 InspectorHandler::~InspectorHandler() { 18 InspectorHandler::~InspectorHandler() {
19 } 19 }
20 20
21 // static 21 // static
22 InspectorHandler* InspectorHandler::FromSession(DevToolsSession* session) { 22 std::vector<InspectorHandler*> InspectorHandler::ForAgentHost(
23 return static_cast<InspectorHandler*>( 23 DevToolsAgentHostImpl* host) {
24 session->GetHandlerByName(Inspector::Metainfo::domainName)); 24 return DevToolsSession::HandlersForAgentHost<InspectorHandler>(
25 host, Inspector::Metainfo::domainName);
25 } 26 }
26 27
27 void InspectorHandler::Wire(UberDispatcher* dispatcher) { 28 void InspectorHandler::Wire(UberDispatcher* dispatcher) {
28 frontend_.reset(new Inspector::Frontend(dispatcher->channel())); 29 frontend_.reset(new Inspector::Frontend(dispatcher->channel()));
29 Inspector::Dispatcher::wire(dispatcher, this); 30 Inspector::Dispatcher::wire(dispatcher, this);
30 } 31 }
31 32
32 void InspectorHandler::SetRenderFrameHost(RenderFrameHostImpl* host) { 33 void InspectorHandler::SetRenderFrameHost(RenderFrameHostImpl* host) {
33 host_ = host; 34 host_ = host;
34 } 35 }
(...skipping 11 matching lines...) Expand all
46 frontend_->TargetCrashed(); 47 frontend_->TargetCrashed();
47 return Response::OK(); 48 return Response::OK();
48 } 49 }
49 50
50 Response InspectorHandler::Disable() { 51 Response InspectorHandler::Disable() {
51 return Response::OK(); 52 return Response::OK();
52 } 53 }
53 54
54 } // namespace protocol 55 } // namespace protocol
55 } // namespace content 56 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/inspector_handler.h ('k') | content/browser/devtools/protocol/network_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698