Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(545)

Side by Side Diff: content/browser/service_worker/service_worker_register_job.cc

Issue 2251633002: Use tri-state enum for the existence of Fetch Handler in ServiceWorkerVersion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/status/existence/ Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698