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

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

Issue 2289773002: Revert of DevTools: merge devtools target with devtools host, part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/service_worker_devtools_manager.h" 5 #include "content/browser/devtools/service_worker_devtools_manager.h"
6 6
7 #include "content/browser/devtools/service_worker_devtools_agent_host.h" 7 #include "content/browser/devtools/service_worker_devtools_agent_host.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/render_process_host.h" 9 #include "content/public/browser/render_process_host.h"
10 #include "content/public/browser/worker_service.h" 10 #include "content/public/browser/worker_service.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 const WorkerId id(worker_process_id, worker_route_id); 110 const WorkerId id(worker_process_id, worker_route_id);
111 AgentHostMap::iterator it = workers_.find(id); 111 AgentHostMap::iterator it = workers_.find(id);
112 if (it == workers_.end()) 112 if (it == workers_.end())
113 return; 113 return;
114 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; 114 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second;
115 host->WorkerReadyForInspection(); 115 host->WorkerReadyForInspection();
116 FOR_EACH_OBSERVER(Observer, observer_list_, 116 FOR_EACH_OBSERVER(Observer, observer_list_,
117 WorkerReadyForInspection(host.get())); 117 WorkerReadyForInspection(host.get()));
118 118
119 // Then bring up UI for the ones not picked by other clients. 119 // Then bring up UI for the ones not picked by other clients.
120 if (host->IsPausedForDebugOnStart() && !host->IsAttached()) 120 if (host->IsPausedForDebugOnStart() && !host->IsAttached()) {
121 host->Inspect(); 121 host->Inspect(RenderProcessHost::FromID(worker_process_id)->
122 GetBrowserContext());
123 }
122 } 124 }
123 125
124 void ServiceWorkerDevToolsManager::WorkerVersionInstalled(int worker_process_id, 126 void ServiceWorkerDevToolsManager::WorkerVersionInstalled(int worker_process_id,
125 int worker_route_id) { 127 int worker_route_id) {
126 DCHECK_CURRENTLY_ON(BrowserThread::UI); 128 DCHECK_CURRENTLY_ON(BrowserThread::UI);
127 const WorkerId id(worker_process_id, worker_route_id); 129 const WorkerId id(worker_process_id, worker_route_id);
128 AgentHostMap::iterator it = workers_.find(id); 130 AgentHostMap::iterator it = workers_.find(id);
129 if (it == workers_.end()) 131 if (it == workers_.end())
130 return; 132 return;
131 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second; 133 scoped_refptr<ServiceWorkerDevToolsAgentHost> host = it->second;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 break; 194 break;
193 } 195 }
194 return it; 196 return it;
195 } 197 }
196 198
197 void ServiceWorkerDevToolsManager::ResetForTesting() { 199 void ServiceWorkerDevToolsManager::ResetForTesting() {
198 workers_.clear(); 200 workers_.clear();
199 } 201 }
200 202
201 } // namespace content 203 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698