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/service_worker_version.h" | 5 #include "content/browser/service_worker/service_worker_version.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 TRACE_EVENT_ASYNC_BEGIN2( | 997 TRACE_EVENT_ASYNC_BEGIN2( |
998 "ServiceWorker", "ServiceWorkerVersion::OnGetClients", request_id, | 998 "ServiceWorker", "ServiceWorkerVersion::OnGetClients", request_id, |
999 "client_type", options.client_type, "include_uncontrolled", | 999 "client_type", options.client_type, "include_uncontrolled", |
1000 options.include_uncontrolled); | 1000 options.include_uncontrolled); |
1001 service_worker_client_utils::GetClients( | 1001 service_worker_client_utils::GetClients( |
1002 weak_factory_.GetWeakPtr(), options, | 1002 weak_factory_.GetWeakPtr(), options, |
1003 base::Bind(&ServiceWorkerVersion::OnGetClientsFinished, | 1003 base::Bind(&ServiceWorkerVersion::OnGetClientsFinished, |
1004 weak_factory_.GetWeakPtr(), request_id)); | 1004 weak_factory_.GetWeakPtr(), request_id)); |
1005 } | 1005 } |
1006 | 1006 |
1007 void ServiceWorkerVersion::OnGetClientsFinished(int request_id, | 1007 void ServiceWorkerVersion::OnGetClientsFinished( |
1008 ServiceWorkerClients* clients) { | 1008 int request_id, |
| 1009 std::unique_ptr<ServiceWorkerClients> clients) { |
1009 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1010 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1010 TRACE_EVENT_ASYNC_END1("ServiceWorker", "ServiceWorkerVersion::OnGetClients", | 1011 TRACE_EVENT_ASYNC_END1("ServiceWorker", "ServiceWorkerVersion::OnGetClients", |
1011 request_id, "The number of clients", clients->size()); | 1012 request_id, "The number of clients", clients->size()); |
1012 | 1013 |
1013 // When Clients.matchAll() is called on the script evaluation phase, the | 1014 // When Clients.matchAll() is called on the script evaluation phase, the |
1014 // running status can be STARTING here. | 1015 // running status can be STARTING here. |
1015 if (running_status() != EmbeddedWorkerStatus::STARTING && | 1016 if (running_status() != EmbeddedWorkerStatus::STARTING && |
1016 running_status() != EmbeddedWorkerStatus::RUNNING) { | 1017 running_status() != EmbeddedWorkerStatus::RUNNING) { |
1017 return; | 1018 return; |
1018 } | 1019 } |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1818 | 1819 |
1819 void ServiceWorkerVersion::CleanUpExternalRequest( | 1820 void ServiceWorkerVersion::CleanUpExternalRequest( |
1820 const std::string& request_uuid, | 1821 const std::string& request_uuid, |
1821 ServiceWorkerStatusCode status) { | 1822 ServiceWorkerStatusCode status) { |
1822 if (status == SERVICE_WORKER_OK) | 1823 if (status == SERVICE_WORKER_OK) |
1823 return; | 1824 return; |
1824 external_request_uuid_to_request_id_.erase(request_uuid); | 1825 external_request_uuid_to_request_id_.erase(request_uuid); |
1825 } | 1826 } |
1826 | 1827 |
1827 } // namespace content | 1828 } // namespace content |
OLD | NEW |