| 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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 386 } |
| 387 | 387 |
| 388 void ServiceWorkerVersion::RegisterStatusChangeCallback( | 388 void ServiceWorkerVersion::RegisterStatusChangeCallback( |
| 389 const base::Closure& callback) { | 389 const base::Closure& callback) { |
| 390 status_change_callbacks_.push_back(callback); | 390 status_change_callbacks_.push_back(callback); |
| 391 } | 391 } |
| 392 | 392 |
| 393 ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() { | 393 ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() { |
| 394 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 394 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 395 ServiceWorkerVersionInfo info( | 395 ServiceWorkerVersionInfo info( |
| 396 running_status(), status(), script_url(), registration_id(), version_id(), | 396 running_status(), status(), fetch_handler_existence(), script_url(), |
| 397 embedded_worker()->process_id(), embedded_worker()->thread_id(), | 397 registration_id(), version_id(), embedded_worker()->process_id(), |
| 398 embedded_worker()->thread_id(), |
| 398 embedded_worker()->worker_devtools_agent_route_id()); | 399 embedded_worker()->worker_devtools_agent_route_id()); |
| 399 for (const auto& controllee : controllee_map_) { | 400 for (const auto& controllee : controllee_map_) { |
| 400 const ServiceWorkerProviderHost* host = controllee.second; | 401 const ServiceWorkerProviderHost* host = controllee.second; |
| 401 info.clients.insert(std::make_pair( | 402 info.clients.insert(std::make_pair( |
| 402 host->client_uuid(), | 403 host->client_uuid(), |
| 403 ServiceWorkerVersionInfo::ClientInfo( | 404 ServiceWorkerVersionInfo::ClientInfo( |
| 404 host->process_id(), host->route_id(), host->provider_type()))); | 405 host->process_id(), host->route_id(), host->provider_type()))); |
| 405 } | 406 } |
| 406 if (!main_script_http_info_) | 407 if (!main_script_http_info_) |
| 407 return info; | 408 return info; |
| (...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1789 ServiceWorkerMetrics::RecordTimeBetweenEvents(base::TimeTicks::Now() - | 1790 ServiceWorkerMetrics::RecordTimeBetweenEvents(base::TimeTicks::Now() - |
| 1790 idle_time_); | 1791 idle_time_); |
| 1791 } | 1792 } |
| 1792 | 1793 |
| 1793 void ServiceWorkerVersion::FinishStartWorker(ServiceWorkerStatusCode status) { | 1794 void ServiceWorkerVersion::FinishStartWorker(ServiceWorkerStatusCode status) { |
| 1794 start_worker_first_purpose_ = base::nullopt; | 1795 start_worker_first_purpose_ = base::nullopt; |
| 1795 RunCallbacks(this, &start_callbacks_, status); | 1796 RunCallbacks(this, &start_callbacks_, status); |
| 1796 } | 1797 } |
| 1797 | 1798 |
| 1798 } // namespace content | 1799 } // namespace content |
| OLD | NEW |