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

Unified Diff: extensions/browser/process_manager.cc

Issue 442303002: DevTools: migrate DevTools APIs to use WebContents instead of RenderViewHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments addressed. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/process_manager.cc
diff --git a/extensions/browser/process_manager.cc b/extensions/browser/process_manager.cc
index 5ba8c13eadf7a7db18e2efcd88c2adaa300c43c7..fc45e6933cd0ab655e378df13216a20870ce54e4 100644
--- a/extensions/browser/process_manager.cc
+++ b/extensions/browser/process_manager.cc
@@ -759,16 +759,14 @@ void ProcessManager::Observe(int type,
void ProcessManager::OnDevToolsStateChanged(
content::DevToolsAgentHost* agent_host,
bool attached) {
- RenderViewHost* rvh = agent_host->GetRenderViewHost();
+ WebContents* web_contents = agent_host->GetWebContents();
// Ignore unrelated notifications.
- if (!rvh ||
- rvh->GetSiteInstance()->GetProcess()->GetBrowserContext() !=
- GetBrowserContext())
+ if (!web_contents || web_contents->GetBrowserContext() != GetBrowserContext())
return;
- if (GetViewType(WebContents::FromRenderViewHost(rvh)) !=
- VIEW_TYPE_EXTENSION_BACKGROUND_PAGE)
+ if (GetViewType(web_contents) != VIEW_TYPE_EXTENSION_BACKGROUND_PAGE)
return;
- const Extension* extension = GetExtensionForRenderViewHost(rvh);
+ const Extension* extension =
+ GetExtensionForRenderViewHost(web_contents->GetRenderViewHost());
if (!extension)
return;
if (attached) {

Powered by Google App Engine
This is Rietveld 408576698