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/guid.h" | 10 #include "base/guid.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 DevToolsAgentHost::GetOrCreateFor(web_contents); | 390 DevToolsAgentHost::GetOrCreateFor(web_contents); |
391 } | 391 } |
392 } | 392 } |
393 | 393 |
394 RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost( | 394 RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost( |
395 RenderFrameHostImpl* host) | 395 RenderFrameHostImpl* host) |
396 : DevToolsAgentHostImpl(base::GenerateGUID()), | 396 : DevToolsAgentHostImpl(base::GenerateGUID()), |
397 input_handler_(new devtools::input::InputHandler()), | 397 input_handler_(new devtools::input::InputHandler()), |
398 service_worker_handler_( | 398 service_worker_handler_( |
399 new devtools::service_worker::ServiceWorkerHandler()), | 399 new devtools::service_worker::ServiceWorkerHandler()), |
| 400 storage_handler_(new devtools::storage::StorageHandler()), |
400 target_handler_(new devtools::target::TargetHandler()), | 401 target_handler_(new devtools::target::TargetHandler()), |
401 frame_trace_recorder_(nullptr), | 402 frame_trace_recorder_(nullptr), |
402 protocol_handler_(new DevToolsProtocolHandler(this)), | 403 protocol_handler_(new DevToolsProtocolHandler(this)), |
403 handlers_frame_host_(nullptr), | 404 handlers_frame_host_(nullptr), |
404 current_frame_crashed_(false), | 405 current_frame_crashed_(false), |
405 pending_handle_(nullptr), | 406 pending_handle_(nullptr), |
406 frame_tree_node_(host->frame_tree_node()) { | 407 frame_tree_node_(host->frame_tree_node()) { |
407 DevToolsProtocolDispatcher* dispatcher = protocol_handler_->dispatcher(); | 408 DevToolsProtocolDispatcher* dispatcher = protocol_handler_->dispatcher(); |
408 dispatcher->SetInputHandler(input_handler_.get()); | 409 dispatcher->SetInputHandler(input_handler_.get()); |
409 dispatcher->SetServiceWorkerHandler(service_worker_handler_.get()); | 410 dispatcher->SetServiceWorkerHandler(service_worker_handler_.get()); |
| 411 dispatcher->SetStorageHandler(storage_handler_.get()); |
410 dispatcher->SetTargetHandler(target_handler_.get()); | 412 dispatcher->SetTargetHandler(target_handler_.get()); |
411 | 413 |
412 SetPending(host); | 414 SetPending(host); |
413 CommitPending(); | 415 CommitPending(); |
414 WebContentsObserver::Observe(WebContents::FromRenderFrameHost(host)); | 416 WebContentsObserver::Observe(WebContents::FromRenderFrameHost(host)); |
415 | 417 |
416 if (web_contents() && web_contents()->GetCrashedStatus() != | 418 if (web_contents() && web_contents()->GetCrashedStatus() != |
417 base::TERMINATION_STATUS_STILL_RUNNING) { | 419 base::TERMINATION_STATUS_STILL_RUNNING) { |
418 current_frame_crashed_ = true; | 420 current_frame_crashed_ = true; |
419 } | 421 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 504 |
503 schema_handler_.reset(new protocol::SchemaHandler()); | 505 schema_handler_.reset(new protocol::SchemaHandler()); |
504 schema_handler_->Wire(session()->dispatcher()); | 506 schema_handler_->Wire(session()->dispatcher()); |
505 | 507 |
506 if (!frame_tree_node_->parent()) { | 508 if (!frame_tree_node_->parent()) { |
507 security_handler_.reset(new protocol::SecurityHandler()); | 509 security_handler_.reset(new protocol::SecurityHandler()); |
508 security_handler_->Wire(session()->dispatcher()); | 510 security_handler_->Wire(session()->dispatcher()); |
509 security_handler_->SetRenderFrameHost(handlers_frame_host_); | 511 security_handler_->SetRenderFrameHost(handlers_frame_host_); |
510 } | 512 } |
511 | 513 |
512 storage_handler_.reset(new protocol::StorageHandler()); | |
513 storage_handler_->Wire(session()->dispatcher()); | |
514 | |
515 tracing_handler_.reset(new protocol::TracingHandler( | 514 tracing_handler_.reset(new protocol::TracingHandler( |
516 protocol::TracingHandler::Renderer, | 515 protocol::TracingHandler::Renderer, |
517 frame_tree_node_->frame_tree_node_id(), | 516 frame_tree_node_->frame_tree_node_id(), |
518 GetIOContext())); | 517 GetIOContext())); |
519 tracing_handler_->Wire(session()->dispatcher()); | 518 tracing_handler_->Wire(session()->dispatcher()); |
520 | 519 |
521 if (current_) | 520 if (current_) |
522 current_->Attach(); | 521 current_->Attach(); |
523 if (pending_) | 522 if (pending_) |
524 pending_->Attach(); | 523 pending_->Attach(); |
(...skipping 16 matching lines...) Expand all Loading... |
541 if (page_handler_) { | 540 if (page_handler_) { |
542 page_handler_->Disable(); | 541 page_handler_->Disable(); |
543 page_handler_.reset(); | 542 page_handler_.reset(); |
544 } | 543 } |
545 schema_handler_->Disable(); | 544 schema_handler_->Disable(); |
546 schema_handler_.reset(); | 545 schema_handler_.reset(); |
547 if (security_handler_) { | 546 if (security_handler_) { |
548 security_handler_->Disable(); | 547 security_handler_->Disable(); |
549 security_handler_.reset(); | 548 security_handler_.reset(); |
550 } | 549 } |
551 storage_handler_->Disable(); | |
552 storage_handler_.reset(); | |
553 tracing_handler_->Disable(); | 550 tracing_handler_->Disable(); |
554 tracing_handler_.reset(); | 551 tracing_handler_.reset(); |
555 | 552 |
556 if (current_) | 553 if (current_) |
557 current_->Detach(); | 554 current_->Detach(); |
558 if (pending_) | 555 if (pending_) |
559 pending_->Detach(); | 556 pending_->Detach(); |
560 OnClientDetached(); | 557 OnClientDetached(); |
561 } | 558 } |
562 | 559 |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 RenderFrameHost* host) { | 1179 RenderFrameHost* host) { |
1183 return (current_ && current_->host() == host) || | 1180 return (current_ && current_->host() == host) || |
1184 (pending_ && pending_->host() == host); | 1181 (pending_ && pending_->host() == host); |
1185 } | 1182 } |
1186 | 1183 |
1187 bool RenderFrameDevToolsAgentHost::IsChildFrame() { | 1184 bool RenderFrameDevToolsAgentHost::IsChildFrame() { |
1188 return current_ && current_->host()->GetParent(); | 1185 return current_ && current_->host()->GetParent(); |
1189 } | 1186 } |
1190 | 1187 |
1191 } // namespace content | 1188 } // namespace content |
OLD | NEW |