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_register_job.h" | 5 #include "content/browser/service_worker/service_worker_register_job.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 return; | 462 return; |
463 } | 463 } |
464 | 464 |
465 ServiceWorkerMetrics::RecordInstallEventStatus(status); | 465 ServiceWorkerMetrics::RecordInstallEventStatus(status); |
466 ServiceWorkerMetrics::RecordForeignFetchRegistrationCount( | 466 ServiceWorkerMetrics::RecordForeignFetchRegistrationCount( |
467 new_version()->foreign_fetch_scopes().size(), | 467 new_version()->foreign_fetch_scopes().size(), |
468 new_version()->foreign_fetch_origins().size()); | 468 new_version()->foreign_fetch_origins().size()); |
469 | 469 |
470 SetPhase(STORE); | 470 SetPhase(STORE); |
471 DCHECK(!registration()->last_update_check().is_null()); | 471 DCHECK(!registration()->last_update_check().is_null()); |
472 new_version()->set_has_fetch_handler(has_fetch_handler); | 472 new_version()->set_fetch_handler_existence( |
| 473 has_fetch_handler |
| 474 ? ServiceWorkerVersion::FetchHandlerExistence::EXISTS |
| 475 : ServiceWorkerVersion::FetchHandlerExistence::DOES_NOT_EXIST); |
473 context_->storage()->StoreRegistration( | 476 context_->storage()->StoreRegistration( |
474 registration(), | 477 registration(), |
475 new_version(), | 478 new_version(), |
476 base::Bind(&ServiceWorkerRegisterJob::OnStoreRegistrationComplete, | 479 base::Bind(&ServiceWorkerRegisterJob::OnStoreRegistrationComplete, |
477 weak_factory_.GetWeakPtr())); | 480 weak_factory_.GetWeakPtr())); |
478 } | 481 } |
479 | 482 |
480 void ServiceWorkerRegisterJob::OnInstallFailed(ServiceWorkerStatusCode status) { | 483 void ServiceWorkerRegisterJob::OnInstallFailed(ServiceWorkerStatusCode status) { |
481 ServiceWorkerMetrics::RecordInstallEventStatus(status); | 484 ServiceWorkerMetrics::RecordInstallEventStatus(status); |
482 | 485 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 new_version()->force_bypass_cache_for_scripts() || | 645 new_version()->force_bypass_cache_for_scripts() || |
643 registration()->last_update_check().is_null()) { | 646 registration()->last_update_check().is_null()) { |
644 registration()->set_last_update_check(base::Time::Now()); | 647 registration()->set_last_update_check(base::Time::Now()); |
645 | 648 |
646 if (registration()->has_installed_version()) | 649 if (registration()->has_installed_version()) |
647 context_->storage()->UpdateLastUpdateCheckTime(registration()); | 650 context_->storage()->UpdateLastUpdateCheckTime(registration()); |
648 } | 651 } |
649 } | 652 } |
650 | 653 |
651 } // namespace content | 654 } // namespace content |
OLD | NEW |