OLD | NEW |
---|---|
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/service_worker/service_worker_process_manager.h" | 5 #include "content/browser/service_worker/service_worker_process_manager.h" |
6 | 6 |
7 #include "content/browser/renderer_host/render_process_host_impl.h" | 7 #include "content/browser/renderer_host/render_process_host_impl.h" |
8 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 8 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "content/public/browser/site_instance.h" | 10 #include "content/public/browser/site_instance.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 std::sort(counted.begin(), counted.end(), SecondGreater()); | 260 std::sort(counted.begin(), counted.end(), SecondGreater()); |
261 | 261 |
262 std::vector<int> result(counted.size()); | 262 std::vector<int> result(counted.size()); |
263 for (size_t i = 0; i < counted.size(); ++i) | 263 for (size_t i = 0; i < counted.size(); ++i) |
264 result[i] = counted[i].first; | 264 result[i] = counted[i].first; |
265 return result; | 265 return result; |
266 } | 266 } |
267 | 267 |
268 } // namespace content | 268 } // namespace content |
269 | 269 |
270 namespace base { | 270 namespace std { |
271 // Destroying ServiceWorkerProcessManagers only on the UI thread allows the | 271 // Destroying ServiceWorkerProcessManagers only on the UI thread allows the |
272 // member WeakPtr to safely guard the object's lifetime when used on that | 272 // member WeakPtr to safely guard the object's lifetime when used on that |
273 // thread. | 273 // thread. |
274 void DefaultDeleter<content::ServiceWorkerProcessManager>::operator()( | 274 void default_delete<content::ServiceWorkerProcessManager>::operator()( |
dcheng
2015/11/16 18:22:59
This is permitted by the C++ standard but probably
danakj
2015/11/16 22:19:03
Oh.. thanks for the linky!
Why is this written as
dcheng
2015/11/17 17:08:42
This is the definition of operator() in the previo
danakj
2015/11/17 19:09:27
Er, oh yes. Magnets..
| |
275 content::ServiceWorkerProcessManager* ptr) const { | 275 content::ServiceWorkerProcessManager* ptr) const { |
276 content::BrowserThread::DeleteSoon( | 276 content::BrowserThread::DeleteSoon( |
277 content::BrowserThread::UI, FROM_HERE, ptr); | 277 content::BrowserThread::UI, FROM_HERE, ptr); |
278 } | 278 } |
279 } // namespace base | 279 } // namespace std |
OLD | NEW |