Index: content/browser/devtools/protocol/service_worker_handler.cc |
diff --git a/content/browser/devtools/protocol/service_worker_handler.cc b/content/browser/devtools/protocol/service_worker_handler.cc |
index a5de8d577f7d2fa82cbf373e0c18f1d8020e4f2b..127b0c0a09387da4b8e718713669d4b7a551dbec 100644 |
--- a/content/browser/devtools/protocol/service_worker_handler.cc |
+++ b/content/browser/devtools/protocol/service_worker_handler.cc |
@@ -244,6 +244,26 @@ |
return Response::InternalError("Invalid version ID"); |
} |
+const std::string GetDevToolsAgentHostTypeString( |
+ content::DevToolsAgentHost::Type type) { |
+ switch (type) { |
+ case DevToolsAgentHost::TYPE_WEB_CONTENTS: |
+ return "web_contents"; |
+ case DevToolsAgentHost::TYPE_FRAME: |
+ return "frame"; |
+ case DevToolsAgentHost::TYPE_SHARED_WORKER: |
+ return "shared_worker"; |
+ case DevToolsAgentHost::TYPE_SERVICE_WORKER: |
+ return "service_worker"; |
+ case DevToolsAgentHost::TYPE_EXTERNAL: |
+ return "external"; |
+ case DevToolsAgentHost::TYPE_BROWSER: |
+ return "browser"; |
+ } |
+ NOTREACHED() << type; |
+ return std::string(); |
+} |
+ |
void DidFindRegistrationForDispatchSyncEventOnIO( |
scoped_refptr<BackgroundSyncContext> sync_context, |
const std::string& tag, |
@@ -526,7 +546,7 @@ |
*target_info = |
TargetInfo::Create() |
->set_id(agent_host->GetId()) |
- ->set_type(agent_host->GetType()) |
+ ->set_type(GetDevToolsAgentHostTypeString(agent_host->GetType())) |
->set_title(agent_host->GetTitle()) |
->set_url(agent_host->GetURL().spec()); |
return Response::OK(); |
@@ -548,7 +568,7 @@ |
->GetDevToolsAgentHostForWorker(process_id, devtools_agent_route_id)); |
if (!agent_host.get()) |
return; |
- agent_host->Inspect(); |
+ agent_host->Inspect(render_frame_host_->GetProcess()->GetBrowserContext()); |
} |
void ServiceWorkerHandler::OnWorkerRegistrationUpdated( |