Index: chrome/browser/extensions/extension_service.cc |
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc |
index 9f55624c7cad4da1e8f1250fbac0e648b0aeb198..4b6bbd9acdc582d0e02278a7170ef8832eb8e7fb 100644 |
--- a/chrome/browser/extensions/extension_service.cc |
+++ b/chrome/browser/extensions/extension_service.cc |
@@ -84,12 +84,13 @@ |
#include "chrome/common/extensions/extension_resource.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/common/url_constants.h" |
-#include "content/browser/debugger/devtools_manager.h" |
#include "content/browser/plugin_process_host.h" |
#include "content/browser/plugin_service.h" |
#include "content/browser/user_metrics.h" |
#include "content/common/pepper_plugin_registry.h" |
#include "content/public/browser/browser_thread.h" |
+#include "content/public/browser/devtools/devtools_agent_host_registry.h" |
+#include "content/public/browser/devtools/devtools_manager.h" |
#include "content/public/browser/notification_service.h" |
#include "content/public/browser/notification_types.h" |
#include "content/public/browser/render_process_host.h" |
@@ -116,6 +117,7 @@ |
using base::Time; |
using content::BrowserThread; |
+using content::DevToolsAgentHostRegistry; |
namespace errors = extension_manifest_errors; |
@@ -598,10 +600,15 @@ void ExtensionService::ReloadExtension(const std::string& extension_id) { |
ExtensionHost* host = manager->GetBackgroundHostForExtension(extension_id); |
if (host) { |
// Look for an open inspector for the background page. |
- int devtools_cookie = DevToolsManager::GetInstance()->DetachClientHost( |
- host->render_view_host()); |
- if (devtools_cookie >= 0) |
- orphaned_dev_tools_[extension_id] = devtools_cookie; |
+ DevToolsAgentHost* agent = |
+ DevToolsAgentHostRegistry::FindDevToolsAgentHost( |
+ host->render_view_host()); |
+ if (agent) { |
+ int devtools_cookie = |
+ content::DevToolsManager::GetInstance()->DetachClientHost(agent); |
+ if (devtools_cookie >= 0) |
+ orphaned_dev_tools_[extension_id] = devtools_cookie; |
+ } |
} |
path = current_extension->path(); |
@@ -2287,8 +2294,10 @@ void ExtensionService::DidCreateRenderViewForBackgroundPage( |
if (iter == orphaned_dev_tools_.end()) |
return; |
- DevToolsManager::GetInstance()->AttachClientHost( |
- iter->second, host->render_view_host()); |
+ DevToolsAgentHost* agent = DevToolsAgentHostRegistry::GetDevToolsAgentHost( |
+ host->render_view_host()); |
+ content::DevToolsManager::GetInstance()->AttachClientHost(iter->second, |
+ agent); |
orphaned_dev_tools_.erase(iter); |
} |