| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_frame_devtools_agent_host.h" | 5 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| 11 #include "content/browser/devtools/devtools_frame_trace_recorder.h" | 11 #include "content/browser/devtools/devtools_frame_trace_recorder.h" |
| 12 #include "content/browser/devtools/devtools_protocol_handler.h" | 12 #include "content/browser/devtools/devtools_protocol_handler.h" |
| 13 #include "content/browser/devtools/protocol/dom_handler.h" | 13 #include "content/browser/devtools/protocol/dom_handler.h" |
| 14 #include "content/browser/devtools/protocol/emulation_handler.h" | 14 #include "content/browser/devtools/protocol/emulation_handler.h" |
| 15 #include "content/browser/devtools/protocol/input_handler.h" | 15 #include "content/browser/devtools/protocol/input_handler.h" |
| 16 #include "content/browser/devtools/protocol/inspector_handler.h" | 16 #include "content/browser/devtools/protocol/inspector_handler.h" |
| 17 #include "content/browser/devtools/protocol/io_handler.h" |
| 17 #include "content/browser/devtools/protocol/network_handler.h" | 18 #include "content/browser/devtools/protocol/network_handler.h" |
| 18 #include "content/browser/devtools/protocol/page_handler.h" | 19 #include "content/browser/devtools/protocol/page_handler.h" |
| 19 #include "content/browser/devtools/protocol/power_handler.h" | 20 #include "content/browser/devtools/protocol/power_handler.h" |
| 20 #include "content/browser/devtools/protocol/security_handler.h" | 21 #include "content/browser/devtools/protocol/security_handler.h" |
| 21 #include "content/browser/devtools/protocol/service_worker_handler.h" | 22 #include "content/browser/devtools/protocol/service_worker_handler.h" |
| 22 #include "content/browser/devtools/protocol/tracing_handler.h" | 23 #include "content/browser/devtools/protocol/tracing_handler.h" |
| 23 #include "content/browser/frame_host/render_frame_host_impl.h" | 24 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 24 #include "content/browser/renderer_host/render_process_host_impl.h" | 25 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 25 #include "content/browser/renderer_host/render_view_host_impl.h" | 26 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 26 #include "content/browser/site_instance_impl.h" | 27 #include "content/browser/site_instance_impl.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 DCHECK(agent_host->current_ && agent_host->current_->host() == current); | 287 DCHECK(agent_host->current_ && agent_host->current_->host() == current); |
| 287 agent_host->DiscardPending(); | 288 agent_host->DiscardPending(); |
| 288 } | 289 } |
| 289 } | 290 } |
| 290 | 291 |
| 291 RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost( | 292 RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost( |
| 292 RenderFrameHostImpl* host) | 293 RenderFrameHostImpl* host) |
| 293 : dom_handler_(new devtools::dom::DOMHandler()), | 294 : dom_handler_(new devtools::dom::DOMHandler()), |
| 294 input_handler_(new devtools::input::InputHandler()), | 295 input_handler_(new devtools::input::InputHandler()), |
| 295 inspector_handler_(new devtools::inspector::InspectorHandler()), | 296 inspector_handler_(new devtools::inspector::InspectorHandler()), |
| 297 io_handler_(new devtools::io::IOHandler(GetIOContext())), |
| 296 network_handler_(new devtools::network::NetworkHandler()), | 298 network_handler_(new devtools::network::NetworkHandler()), |
| 297 page_handler_(nullptr), | 299 page_handler_(nullptr), |
| 298 power_handler_(new devtools::power::PowerHandler()), | 300 power_handler_(new devtools::power::PowerHandler()), |
| 299 security_handler_(nullptr), | 301 security_handler_(nullptr), |
| 300 service_worker_handler_( | 302 service_worker_handler_( |
| 301 new devtools::service_worker::ServiceWorkerHandler()), | 303 new devtools::service_worker::ServiceWorkerHandler()), |
| 302 tracing_handler_(new devtools::tracing::TracingHandler( | 304 tracing_handler_(new devtools::tracing::TracingHandler( |
| 303 devtools::tracing::TracingHandler::Renderer)), | 305 devtools::tracing::TracingHandler::Renderer, |
| 306 GetIOContext())), |
| 304 emulation_handler_(nullptr), | 307 emulation_handler_(nullptr), |
| 305 frame_trace_recorder_(nullptr), | 308 frame_trace_recorder_(nullptr), |
| 306 protocol_handler_(new DevToolsProtocolHandler( | 309 protocol_handler_(new DevToolsProtocolHandler( |
| 307 this, | 310 this, |
| 308 base::Bind(&RenderFrameDevToolsAgentHost::SendMessageToClient, | 311 base::Bind(&RenderFrameDevToolsAgentHost::SendMessageToClient, |
| 309 base::Unretained(this)))), | 312 base::Unretained(this)))), |
| 310 current_frame_crashed_(false) { | 313 current_frame_crashed_(false) { |
| 311 DevToolsProtocolDispatcher* dispatcher = protocol_handler_->dispatcher(); | 314 DevToolsProtocolDispatcher* dispatcher = protocol_handler_->dispatcher(); |
| 312 dispatcher->SetDOMHandler(dom_handler_.get()); | 315 dispatcher->SetDOMHandler(dom_handler_.get()); |
| 313 dispatcher->SetInputHandler(input_handler_.get()); | 316 dispatcher->SetInputHandler(input_handler_.get()); |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 RenderFrameHost* host) { | 719 RenderFrameHost* host) { |
| 717 return (current_ && current_->host() == host) || | 720 return (current_ && current_->host() == host) || |
| 718 (pending_ && pending_->host() == host); | 721 (pending_ && pending_->host() == host); |
| 719 } | 722 } |
| 720 | 723 |
| 721 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 724 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
| 722 return current_ && current_->host()->GetParent(); | 725 return current_ && current_->host()->GetParent(); |
| 723 } | 726 } |
| 724 | 727 |
| 725 } // namespace content | 728 } // namespace content |
| OLD | NEW |