| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/target_handler.h" | 5 #include "content/browser/devtools/protocol/target_handler.h" |
| 6 | 6 |
| 7 #include "content/browser/devtools/devtools_manager.h" | 7 #include "content/browser/devtools/devtools_manager.h" |
| 8 #include "content/browser/devtools/devtools_session.h" | 8 #include "content/browser/devtools/devtools_session.h" |
| 9 #include "content/browser/devtools/service_worker_devtools_agent_host.h" | 9 #include "content/browser/devtools/service_worker_devtools_agent_host.h" |
| 10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 auto_attach_(false), | 99 auto_attach_(false), |
| 100 wait_for_debugger_on_start_(false), | 100 wait_for_debugger_on_start_(false), |
| 101 attach_to_frames_(false), | 101 attach_to_frames_(false), |
| 102 render_frame_host_(nullptr) { | 102 render_frame_host_(nullptr) { |
| 103 } | 103 } |
| 104 | 104 |
| 105 TargetHandler::~TargetHandler() { | 105 TargetHandler::~TargetHandler() { |
| 106 } | 106 } |
| 107 | 107 |
| 108 // static | 108 // static |
| 109 TargetHandler* TargetHandler::FromSession(DevToolsSession* session) { | 109 std::vector<TargetHandler*> TargetHandler::ForAgentHost( |
| 110 return static_cast<TargetHandler*>( | 110 DevToolsAgentHostImpl* host) { |
| 111 session->GetHandlerByName(Target::Metainfo::domainName)); | 111 return DevToolsSession::HandlersForAgentHost<TargetHandler>( |
| 112 host, Target::Metainfo::domainName); |
| 112 } | 113 } |
| 113 | 114 |
| 114 void TargetHandler::Wire(UberDispatcher* dispatcher) { | 115 void TargetHandler::Wire(UberDispatcher* dispatcher) { |
| 115 frontend_.reset(new Target::Frontend(dispatcher->channel())); | 116 frontend_.reset(new Target::Frontend(dispatcher->channel())); |
| 116 Target::Dispatcher::wire(dispatcher, this); | 117 Target::Dispatcher::wire(dispatcher, this); |
| 117 } | 118 } |
| 118 | 119 |
| 119 void TargetHandler::SetRenderFrameHost(RenderFrameHostImpl* render_frame_host) { | 120 void TargetHandler::SetRenderFrameHost(RenderFrameHostImpl* render_frame_host) { |
| 120 render_frame_host_ = render_frame_host; | 121 render_frame_host_ = render_frame_host; |
| 121 UpdateFrames(); | 122 UpdateFrames(); |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 UpdateServiceWorkers(); | 461 UpdateServiceWorkers(); |
| 461 } | 462 } |
| 462 | 463 |
| 463 void TargetHandler::WorkerDestroyed( | 464 void TargetHandler::WorkerDestroyed( |
| 464 ServiceWorkerDevToolsAgentHost* host) { | 465 ServiceWorkerDevToolsAgentHost* host) { |
| 465 UpdateServiceWorkers(); | 466 UpdateServiceWorkers(); |
| 466 } | 467 } |
| 467 | 468 |
| 468 } // namespace protocol | 469 } // namespace protocol |
| 469 } // namespace content | 470 } // namespace content |
| OLD | NEW |