| 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 <tuple> | 7 #include <tuple> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "content/browser/child_process_security_policy_impl.h" | 13 #include "content/browser/child_process_security_policy_impl.h" |
| 14 #include "content/browser/devtools/devtools_frame_trace_recorder.h" | 14 #include "content/browser/devtools/devtools_frame_trace_recorder.h" |
| 15 #include "content/browser/devtools/devtools_protocol_handler.h" | 15 #include "content/browser/devtools/devtools_protocol_handler.h" |
| 16 #include "content/browser/devtools/protocol/browser_handler.h" |
| 16 #include "content/browser/devtools/protocol/dom_handler.h" | 17 #include "content/browser/devtools/protocol/dom_handler.h" |
| 17 #include "content/browser/devtools/protocol/emulation_handler.h" | 18 #include "content/browser/devtools/protocol/emulation_handler.h" |
| 18 #include "content/browser/devtools/protocol/input_handler.h" | 19 #include "content/browser/devtools/protocol/input_handler.h" |
| 19 #include "content/browser/devtools/protocol/inspector_handler.h" | 20 #include "content/browser/devtools/protocol/inspector_handler.h" |
| 20 #include "content/browser/devtools/protocol/io_handler.h" | 21 #include "content/browser/devtools/protocol/io_handler.h" |
| 21 #include "content/browser/devtools/protocol/network_handler.h" | 22 #include "content/browser/devtools/protocol/network_handler.h" |
| 22 #include "content/browser/devtools/protocol/page_handler.h" | 23 #include "content/browser/devtools/protocol/page_handler.h" |
| 23 #include "content/browser/devtools/protocol/security_handler.h" | 24 #include "content/browser/devtools/protocol/security_handler.h" |
| 24 #include "content/browser/devtools/protocol/service_worker_handler.h" | 25 #include "content/browser/devtools/protocol/service_worker_handler.h" |
| 25 #include "content/browser/devtools/protocol/storage_handler.h" | 26 #include "content/browser/devtools/protocol/storage_handler.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 NavigationHandle* navigation_handle) { | 341 NavigationHandle* navigation_handle) { |
| 341 FrameTreeNode* frame_tree_node = | 342 FrameTreeNode* frame_tree_node = |
| 342 static_cast<NavigationHandleImpl*>(navigation_handle)->frame_tree_node(); | 343 static_cast<NavigationHandleImpl*>(navigation_handle)->frame_tree_node(); |
| 343 RenderFrameDevToolsAgentHost* agent_host = FindAgentHost(frame_tree_node); | 344 RenderFrameDevToolsAgentHost* agent_host = FindAgentHost(frame_tree_node); |
| 344 if (agent_host) | 345 if (agent_host) |
| 345 agent_host->AboutToNavigate(navigation_handle); | 346 agent_host->AboutToNavigate(navigation_handle); |
| 346 } | 347 } |
| 347 | 348 |
| 348 RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost( | 349 RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost( |
| 349 RenderFrameHostImpl* host) | 350 RenderFrameHostImpl* host) |
| 350 : dom_handler_(new devtools::dom::DOMHandler()), | 351 : browser_handler_(new devtools::browser::BrowserHandler()), |
| 352 dom_handler_(new devtools::dom::DOMHandler()), |
| 351 input_handler_(new devtools::input::InputHandler()), | 353 input_handler_(new devtools::input::InputHandler()), |
| 352 inspector_handler_(new devtools::inspector::InspectorHandler()), | 354 inspector_handler_(new devtools::inspector::InspectorHandler()), |
| 353 io_handler_(new devtools::io::IOHandler(GetIOContext())), | 355 io_handler_(new devtools::io::IOHandler(GetIOContext())), |
| 354 network_handler_(new devtools::network::NetworkHandler()), | 356 network_handler_(new devtools::network::NetworkHandler()), |
| 355 page_handler_(nullptr), | 357 page_handler_(nullptr), |
| 356 security_handler_(nullptr), | 358 security_handler_(nullptr), |
| 357 service_worker_handler_( | 359 service_worker_handler_( |
| 358 new devtools::service_worker::ServiceWorkerHandler()), | 360 new devtools::service_worker::ServiceWorkerHandler()), |
| 359 storage_handler_(new devtools::storage::StorageHandler()), | 361 storage_handler_(new devtools::storage::StorageHandler()), |
| 360 tracing_handler_(new devtools::tracing::TracingHandler( | 362 tracing_handler_(new devtools::tracing::TracingHandler( |
| 361 devtools::tracing::TracingHandler::Renderer, | 363 devtools::tracing::TracingHandler::Renderer, |
| 362 host->GetFrameTreeNodeId(), | 364 host->GetFrameTreeNodeId(), |
| 363 GetIOContext())), | 365 GetIOContext())), |
| 364 emulation_handler_(nullptr), | 366 emulation_handler_(nullptr), |
| 365 frame_trace_recorder_(nullptr), | 367 frame_trace_recorder_(nullptr), |
| 366 protocol_handler_(new DevToolsProtocolHandler(this)), | 368 protocol_handler_(new DevToolsProtocolHandler(this)), |
| 367 current_frame_crashed_(false), | 369 current_frame_crashed_(false), |
| 368 pending_handle_(nullptr), | 370 pending_handle_(nullptr), |
| 369 frame_tree_node_(host->frame_tree_node()) { | 371 frame_tree_node_(host->frame_tree_node()) { |
| 370 DevToolsProtocolDispatcher* dispatcher = protocol_handler_->dispatcher(); | 372 DevToolsProtocolDispatcher* dispatcher = protocol_handler_->dispatcher(); |
| 373 dispatcher->SetBrowserHandler(browser_handler_.get()); |
| 371 dispatcher->SetDOMHandler(dom_handler_.get()); | 374 dispatcher->SetDOMHandler(dom_handler_.get()); |
| 372 dispatcher->SetInputHandler(input_handler_.get()); | 375 dispatcher->SetInputHandler(input_handler_.get()); |
| 373 dispatcher->SetInspectorHandler(inspector_handler_.get()); | 376 dispatcher->SetInspectorHandler(inspector_handler_.get()); |
| 374 dispatcher->SetIOHandler(io_handler_.get()); | 377 dispatcher->SetIOHandler(io_handler_.get()); |
| 375 dispatcher->SetNetworkHandler(network_handler_.get()); | 378 dispatcher->SetNetworkHandler(network_handler_.get()); |
| 376 dispatcher->SetServiceWorkerHandler(service_worker_handler_.get()); | 379 dispatcher->SetServiceWorkerHandler(service_worker_handler_.get()); |
| 377 dispatcher->SetStorageHandler(storage_handler_.get()); | 380 dispatcher->SetStorageHandler(storage_handler_.get()); |
| 378 dispatcher->SetTracingHandler(tracing_handler_.get()); | 381 dispatcher->SetTracingHandler(tracing_handler_.get()); |
| 379 | 382 |
| 380 if (!host->GetParent()) { | 383 if (!host->GetParent()) { |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 RenderFrameHost* host) { | 911 RenderFrameHost* host) { |
| 909 return (current_ && current_->host() == host) || | 912 return (current_ && current_->host() == host) || |
| 910 (pending_ && pending_->host() == host); | 913 (pending_ && pending_->host() == host); |
| 911 } | 914 } |
| 912 | 915 |
| 913 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 916 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
| 914 return current_ && current_->host()->GetParent(); | 917 return current_ && current_->host()->GetParent(); |
| 915 } | 918 } |
| 916 | 919 |
| 917 } // namespace content | 920 } // namespace content |
| OLD | NEW |