OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |