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 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 StartTimeoutTimer(); | 1499 StartTimeoutTimer(); |
1500 | 1500 |
1501 auto params = base::MakeUnique<EmbeddedWorkerStartParams>(); | 1501 auto params = base::MakeUnique<EmbeddedWorkerStartParams>(); |
1502 params->service_worker_version_id = version_id_; | 1502 params->service_worker_version_id = version_id_; |
1503 params->scope = scope_; | 1503 params->scope = scope_; |
1504 params->script_url = script_url_; | 1504 params->script_url = script_url_; |
1505 params->is_installed = IsInstalled(status_); | 1505 params->is_installed = IsInstalled(status_); |
1506 params->pause_after_download = pause_after_download_; | 1506 params->pause_after_download = pause_after_download_; |
1507 | 1507 |
1508 embedded_worker_->Start( | 1508 embedded_worker_->Start( |
1509 std::move(params), mojo::GetProxy(&event_dispatcher_), | 1509 std::move(params), mojo::MakeRequest(&event_dispatcher_), |
1510 base::Bind(&ServiceWorkerVersion::OnStartSentAndScriptEvaluated, | 1510 base::Bind(&ServiceWorkerVersion::OnStartSentAndScriptEvaluated, |
1511 weak_factory_.GetWeakPtr())); | 1511 weak_factory_.GetWeakPtr())); |
1512 } | 1512 } |
1513 | 1513 |
1514 void ServiceWorkerVersion::StartTimeoutTimer() { | 1514 void ServiceWorkerVersion::StartTimeoutTimer() { |
1515 DCHECK(!timeout_timer_.IsRunning()); | 1515 DCHECK(!timeout_timer_.IsRunning()); |
1516 | 1516 |
1517 if (embedded_worker_->devtools_attached()) { | 1517 if (embedded_worker_->devtools_attached()) { |
1518 // Don't record the startup time metric once DevTools is attached. | 1518 // Don't record the startup time metric once DevTools is attached. |
1519 ClearTick(&start_time_); | 1519 ClearTick(&start_time_); |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 | 1893 |
1894 void ServiceWorkerVersion::CleanUpExternalRequest( | 1894 void ServiceWorkerVersion::CleanUpExternalRequest( |
1895 const std::string& request_uuid, | 1895 const std::string& request_uuid, |
1896 ServiceWorkerStatusCode status) { | 1896 ServiceWorkerStatusCode status) { |
1897 if (status == SERVICE_WORKER_OK) | 1897 if (status == SERVICE_WORKER_OK) |
1898 return; | 1898 return; |
1899 external_request_uuid_to_request_id_.erase(request_uuid); | 1899 external_request_uuid_to_request_id_.erase(request_uuid); |
1900 } | 1900 } |
1901 | 1901 |
1902 } // namespace content | 1902 } // namespace content |
OLD | NEW |