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

Side by Side Diff: content/browser/service_worker/embedded_worker_instance.cc

Issue 349033009: DevTools: Added service workers to chrome://inspect/#devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added URLs Created 6 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/service_worker/embedded_worker_instance.h" 5 #include "content/browser/service_worker/embedded_worker_instance.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "content/browser/devtools/embedded_worker_devtools_manager.h" 8 #include "content/browser/devtools/embedded_worker_devtools_manager.h"
9 #include "content/browser/service_worker/embedded_worker_registry.h" 9 #include "content/browser/service_worker/embedded_worker_registry.h"
10 #include "content/browser/service_worker/service_worker_context_core.h" 10 #include "content/browser/service_worker/service_worker_context_core.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 FROM_HERE, 46 FROM_HERE,
47 base::Bind(NotifyWorkerDestroyed, worker_process_id, worker_route_id)); 47 base::Bind(NotifyWorkerDestroyed, worker_process_id, worker_route_id));
48 return; 48 return;
49 } 49 }
50 EmbeddedWorkerDevToolsManager::GetInstance()->WorkerDestroyed( 50 EmbeddedWorkerDevToolsManager::GetInstance()->WorkerDestroyed(
51 worker_process_id, worker_route_id); 51 worker_process_id, worker_route_id);
52 } 52 }
53 53
54 void RegisterToWorkerDevToolsManager( 54 void RegisterToWorkerDevToolsManager(
55 int process_id, 55 int process_id,
56 const ServiceWorkerContextCore* const service_worker_context, 56 ServiceWorkerContextCore* service_worker_context,
57 int64 service_worker_version_id, 57 int64 service_worker_version_id,
58 const base::Callback<void(int worker_devtools_agent_route_id, 58 const base::Callback<void(int worker_devtools_agent_route_id,
59 bool wait_for_debugger)>& callback) { 59 bool wait_for_debugger)>& callback) {
60 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { 60 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
61 BrowserThread::PostTask(BrowserThread::UI, 61 BrowserThread::PostTask(BrowserThread::UI,
62 FROM_HERE, 62 FROM_HERE,
63 base::Bind(RegisterToWorkerDevToolsManager, 63 base::Bind(RegisterToWorkerDevToolsManager,
64 process_id, 64 process_id,
65 service_worker_context, 65 service_worker_context,
66 service_worker_version_id, 66 service_worker_version_id,
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 // Sort descending by the reference count. 336 // Sort descending by the reference count.
337 std::sort(counted.begin(), counted.end(), SecondGreater()); 337 std::sort(counted.begin(), counted.end(), SecondGreater());
338 338
339 std::vector<int> result(counted.size()); 339 std::vector<int> result(counted.size());
340 for (size_t i = 0; i < counted.size(); ++i) 340 for (size_t i = 0; i < counted.size(); ++i)
341 result[i] = counted[i].first; 341 result[i] = counted[i].first;
342 return result; 342 return result;
343 } 343 }
344 344
345 } // namespace content 345 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698