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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 default: | 456 default: |
457 NOTREACHED(); | 457 NOTREACHED(); |
458 } | 458 } |
459 | 459 |
460 if (status != SERVICE_WORKER_OK) { | 460 if (status != SERVICE_WORKER_OK) { |
461 OnInstallFailed(status); | 461 OnInstallFailed(status); |
462 return; | 462 return; |
463 } | 463 } |
464 | 464 |
465 ServiceWorkerMetrics::RecordInstallEventStatus(status); | 465 ServiceWorkerMetrics::RecordInstallEventStatus(status); |
| 466 ServiceWorkerMetrics::RecordForeignFetchRegistrationCount( |
| 467 new_version()->foreign_fetch_scopes().size(), |
| 468 new_version()->foreign_fetch_origins().size()); |
466 | 469 |
467 SetPhase(STORE); | 470 SetPhase(STORE); |
468 DCHECK(!registration()->last_update_check().is_null()); | 471 DCHECK(!registration()->last_update_check().is_null()); |
469 new_version()->set_has_fetch_handler(has_fetch_handler); | 472 new_version()->set_has_fetch_handler(has_fetch_handler); |
470 context_->storage()->StoreRegistration( | 473 context_->storage()->StoreRegistration( |
471 registration(), | 474 registration(), |
472 new_version(), | 475 new_version(), |
473 base::Bind(&ServiceWorkerRegisterJob::OnStoreRegistrationComplete, | 476 base::Bind(&ServiceWorkerRegisterJob::OnStoreRegistrationComplete, |
474 weak_factory_.GetWeakPtr())); | 477 weak_factory_.GetWeakPtr())); |
475 } | 478 } |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 new_version()->force_bypass_cache_for_scripts() || | 642 new_version()->force_bypass_cache_for_scripts() || |
640 registration()->last_update_check().is_null()) { | 643 registration()->last_update_check().is_null()) { |
641 registration()->set_last_update_check(base::Time::Now()); | 644 registration()->set_last_update_check(base::Time::Now()); |
642 | 645 |
643 if (registration()->has_installed_version()) | 646 if (registration()->has_installed_version()) |
644 context_->storage()->UpdateLastUpdateCheckTime(registration()); | 647 context_->storage()->UpdateLastUpdateCheckTime(registration()); |
645 } | 648 } |
646 } | 649 } |
647 | 650 |
648 } // namespace content | 651 } // namespace content |
OLD | NEW |