| 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 if (context_) | 339 if (context_) |
| 340 context_->RemoveLiveVersion(version_id_); | 340 context_->RemoveLiveVersion(version_id_); |
| 341 | 341 |
| 342 if (running_status() == EmbeddedWorkerStatus::STARTING || | 342 if (running_status() == EmbeddedWorkerStatus::STARTING || |
| 343 running_status() == EmbeddedWorkerStatus::RUNNING) { | 343 running_status() == EmbeddedWorkerStatus::RUNNING) { |
| 344 embedded_worker_->Stop(); | 344 embedded_worker_->Stop(); |
| 345 } | 345 } |
| 346 embedded_worker_->RemoveListener(this); | 346 embedded_worker_->RemoveListener(this); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void ServiceWorkerVersion::SetNavigationPreloadState( |
| 350 const NavigationPreloadState& state) { |
| 351 navigation_preload_state_ = state; |
| 352 } |
| 353 |
| 349 void ServiceWorkerVersion::SetStatus(Status status) { | 354 void ServiceWorkerVersion::SetStatus(Status status) { |
| 350 if (status_ == status) | 355 if (status_ == status) |
| 351 return; | 356 return; |
| 352 | 357 |
| 353 TRACE_EVENT2("ServiceWorker", "ServiceWorkerVersion::SetStatus", "Script URL", | 358 TRACE_EVENT2("ServiceWorker", "ServiceWorkerVersion::SetStatus", "Script URL", |
| 354 script_url_.spec(), "New Status", VersionStatusToString(status)); | 359 script_url_.spec(), "New Status", VersionStatusToString(status)); |
| 355 | 360 |
| 356 // |fetch_handler_existence_| must be set before setting the status to | 361 // |fetch_handler_existence_| must be set before setting the status to |
| 357 // INSTALLED, | 362 // INSTALLED, |
| 358 // ACTIVATING or ACTIVATED. | 363 // ACTIVATING or ACTIVATED. |
| (...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1873 | 1878 |
| 1874 void ServiceWorkerVersion::CleanUpExternalRequest( | 1879 void ServiceWorkerVersion::CleanUpExternalRequest( |
| 1875 const std::string& request_uuid, | 1880 const std::string& request_uuid, |
| 1876 ServiceWorkerStatusCode status) { | 1881 ServiceWorkerStatusCode status) { |
| 1877 if (status == SERVICE_WORKER_OK) | 1882 if (status == SERVICE_WORKER_OK) |
| 1878 return; | 1883 return; |
| 1879 external_request_uuid_to_request_id_.erase(request_uuid); | 1884 external_request_uuid_to_request_id_.erase(request_uuid); |
| 1880 } | 1885 } |
| 1881 | 1886 |
| 1882 } // namespace content | 1887 } // namespace content |
| OLD | NEW |