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

Side by Side Diff: content/browser/devtools/render_frame_devtools_agent_host.cc

Issue 985663002: Implement ServiceWorkerRegistration related DevTools events [2/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 (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/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 DCHECK(!render_frame_host_); 410 DCHECK(!render_frame_host_);
411 render_frame_host_ = static_cast<RenderFrameHostImpl*>(rfh); 411 render_frame_host_ = static_cast<RenderFrameHostImpl*>(rfh);
412 412
413 WebContentsObserver::Observe(WebContents::FromRenderFrameHost(rfh)); 413 WebContentsObserver::Observe(WebContents::FromRenderFrameHost(rfh));
414 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( 414 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
415 rfh->GetRenderViewHost()); 415 rfh->GetRenderViewHost());
416 dom_handler_->SetRenderViewHost(rvh); 416 dom_handler_->SetRenderViewHost(rvh);
417 input_handler_->SetRenderViewHost(rvh); 417 input_handler_->SetRenderViewHost(rvh);
418 network_handler_->SetRenderViewHost(rvh); 418 network_handler_->SetRenderViewHost(rvh);
419 page_handler_->SetRenderViewHost(rvh); 419 page_handler_->SetRenderViewHost(rvh);
420 service_worker_handler_->SetRenderViewHost(rvh);
420 421
421 registrar_.Add( 422 registrar_.Add(
422 this, 423 this,
423 content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, 424 content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED,
424 content::Source<RenderWidgetHost>(rvh)); 425 content::Source<RenderWidgetHost>(rvh));
425 } 426 }
426 427
427 void RenderFrameDevToolsAgentHost::ClearRenderFrameHost() { 428 void RenderFrameDevToolsAgentHost::ClearRenderFrameHost() {
428 DCHECK(render_frame_host_); 429 DCHECK(render_frame_host_);
429 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( 430 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(
430 render_frame_host_->GetRenderViewHost()); 431 render_frame_host_->GetRenderViewHost());
431 registrar_.Remove( 432 registrar_.Remove(
432 this, 433 this,
433 content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED, 434 content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED,
434 content::Source<RenderWidgetHost>(rvh)); 435 content::Source<RenderWidgetHost>(rvh));
435 render_frame_host_ = nullptr; 436 render_frame_host_ = nullptr;
436 dom_handler_->SetRenderViewHost(nullptr); 437 dom_handler_->SetRenderViewHost(nullptr);
437 input_handler_->SetRenderViewHost(nullptr); 438 input_handler_->SetRenderViewHost(nullptr);
438 network_handler_->SetRenderViewHost(nullptr); 439 network_handler_->SetRenderViewHost(nullptr);
439 page_handler_->SetRenderViewHost(nullptr); 440 page_handler_->SetRenderViewHost(nullptr);
441 service_worker_handler_->SetRenderViewHost(nullptr);
440 } 442 }
441 443
442 void RenderFrameDevToolsAgentHost::DisconnectWebContents() { 444 void RenderFrameDevToolsAgentHost::DisconnectWebContents() {
443 DisconnectRenderFrameHost(); 445 DisconnectRenderFrameHost();
444 } 446 }
445 447
446 void RenderFrameDevToolsAgentHost::ConnectWebContents(WebContents* wc) { 448 void RenderFrameDevToolsAgentHost::ConnectWebContents(WebContents* wc) {
447 ConnectRenderFrameHost(wc->GetMainFrame()); 449 ConnectRenderFrameHost(wc->GetMainFrame());
448 } 450 }
449 451
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 } 530 }
529 531
530 void RenderFrameDevToolsAgentHost::DispatchOnInspectorFrontend( 532 void RenderFrameDevToolsAgentHost::DispatchOnInspectorFrontend(
531 const std::string& message) { 533 const std::string& message) {
532 if (!IsAttached() || !render_frame_host_) 534 if (!IsAttached() || !render_frame_host_)
533 return; 535 return;
534 SendMessageToClient(message); 536 SendMessageToClient(message);
535 } 537 }
536 538
537 } // namespace content 539 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698