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

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

Issue 988003002: DevTools: pick sw targets to attach to on the backend side. (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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 DevToolsProtocolDispatcher* dispatcher = protocol_handler_->dispatcher(); 144 DevToolsProtocolDispatcher* dispatcher = protocol_handler_->dispatcher();
145 dispatcher->SetDOMHandler(dom_handler_.get()); 145 dispatcher->SetDOMHandler(dom_handler_.get());
146 dispatcher->SetInputHandler(input_handler_.get()); 146 dispatcher->SetInputHandler(input_handler_.get());
147 dispatcher->SetInspectorHandler(inspector_handler_.get()); 147 dispatcher->SetInspectorHandler(inspector_handler_.get());
148 dispatcher->SetNetworkHandler(network_handler_.get()); 148 dispatcher->SetNetworkHandler(network_handler_.get());
149 dispatcher->SetPageHandler(page_handler_.get()); 149 dispatcher->SetPageHandler(page_handler_.get());
150 dispatcher->SetPowerHandler(power_handler_.get()); 150 dispatcher->SetPowerHandler(power_handler_.get());
151 dispatcher->SetServiceWorkerHandler(service_worker_handler_.get()); 151 dispatcher->SetServiceWorkerHandler(service_worker_handler_.get());
152 dispatcher->SetTracingHandler(tracing_handler_.get()); 152 dispatcher->SetTracingHandler(tracing_handler_.get());
153 SetRenderFrameHost(rfh); 153 SetRenderFrameHost(rfh);
154 service_worker_handler_->SetURL(rfh->GetLastCommittedURL());
154 g_instances.Get().push_back(this); 155 g_instances.Get().push_back(this);
155 AddRef(); // Balanced in RenderFrameHostDestroyed. 156 AddRef(); // Balanced in RenderFrameHostDestroyed.
156 DevToolsManager::GetInstance()->AgentHostChanged(this); 157 DevToolsManager::GetInstance()->AgentHostChanged(this);
157 } 158 }
158 159
159 BrowserContext* RenderFrameDevToolsAgentHost::GetBrowserContext() { 160 BrowserContext* RenderFrameDevToolsAgentHost::GetBrowserContext() {
160 WebContents* contents = web_contents(); 161 WebContents* contents = web_contents();
161 return contents ? contents->GetBrowserContext() : nullptr; 162 return contents ? contents->GetBrowserContext() : nullptr;
162 } 163 }
163 164
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 void RenderFrameDevToolsAgentHost::TitleWasSet( 391 void RenderFrameDevToolsAgentHost::TitleWasSet(
391 NavigationEntry* entry, bool explicit_set) { 392 NavigationEntry* entry, bool explicit_set) {
392 DevToolsManager::GetInstance()->AgentHostChanged(this); 393 DevToolsManager::GetInstance()->AgentHostChanged(this);
393 } 394 }
394 395
395 void RenderFrameDevToolsAgentHost::NavigationEntryCommitted( 396 void RenderFrameDevToolsAgentHost::NavigationEntryCommitted(
396 const LoadCommittedDetails& load_details) { 397 const LoadCommittedDetails& load_details) {
397 DevToolsManager::GetInstance()->AgentHostChanged(this); 398 DevToolsManager::GetInstance()->AgentHostChanged(this);
398 } 399 }
399 400
401 void RenderFrameDevToolsAgentHost::DidCommitProvisionalLoadForFrame(
402 RenderFrameHost* render_frame_host,
403 const GURL& url,
404 ui::PageTransition transition_type) {
405 if (!render_frame_host->GetParent())
dgozman 2015/03/08 15:27:08 To account for OOPIF: if (render_frame_host_ == re
pfeldman 2015/03/08 15:34:14 Done.
406 service_worker_handler_->SetURL(url);
407 }
408
400 void RenderFrameDevToolsAgentHost::Observe(int type, 409 void RenderFrameDevToolsAgentHost::Observe(int type,
401 const NotificationSource& source, 410 const NotificationSource& source,
402 const NotificationDetails& details) { 411 const NotificationDetails& details) {
403 if (type == content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED) { 412 if (type == content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED) {
404 bool visible = *Details<bool>(details).ptr(); 413 bool visible = *Details<bool>(details).ptr();
405 page_handler_->OnVisibilityChanged(visible); 414 page_handler_->OnVisibilityChanged(visible);
406 } 415 }
407 } 416 }
408 417
409 void RenderFrameDevToolsAgentHost::SetRenderFrameHost(RenderFrameHost* rfh) { 418 void RenderFrameDevToolsAgentHost::SetRenderFrameHost(RenderFrameHost* rfh) {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 } 537 }
529 538
530 void RenderFrameDevToolsAgentHost::DispatchOnInspectorFrontend( 539 void RenderFrameDevToolsAgentHost::DispatchOnInspectorFrontend(
531 const std::string& message) { 540 const std::string& message) {
532 if (!IsAttached() || !render_frame_host_) 541 if (!IsAttached() || !render_frame_host_)
533 return; 542 return;
534 SendMessageToClient(message); 543 SendMessageToClient(message);
535 } 544 }
536 545
537 } // namespace content 546 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698