summaryrefslogtreecommitdiffstats
path: root/content/browser/background_sync/background_sync_manager.cc
diff options
context:
space:
mode:
authornhiroki <nhiroki@chromium.org>2015-10-28 23:26:29 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-29 06:27:09 +0000
commit3596edca6c7b7fe8819cafb143808360226ead19 (patch)
treec34762cc50f0df97b334cbbdc5584fe97a67df46 /content/browser/background_sync/background_sync_manager.cc
parent7feb7b0b9330748ea2ffb81f43ddcaaa45198118 (diff)
downloadchromium_src-3596edca6c7b7fe8819cafb143808360226ead19.zip
chromium_src-3596edca6c7b7fe8819cafb143808360226ead19.tar.gz
chromium_src-3596edca6c7b7fe8819cafb143808360226ead19.tar.bz2
ServiceWorker: Stop exposing FindRegistrationForId for external modules
This CL stops exposing ServiceWorkerContextWrapper::FindRegistrationForId and instead encourages external modules to use FindReadyRegistrationForId that ensures the returned registration has the activated worker. External modules have used FindRegistrationForId to dispatch events on the activated worker. The function does not ensure that the returned registration has the activated worker, so the callers need to check it before dispatching the events. This is error-prone and actually there was a bug (see http://crbug.com/532410). BUG=548563 Review URL: https://codereview.chromium.org/1419963003 Cr-Commit-Position: refs/heads/master@{#356779}
Diffstat (limited to 'content/browser/background_sync/background_sync_manager.cc')
-rw-r--r--content/browser/background_sync/background_sync_manager.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/content/browser/background_sync/background_sync_manager.cc b/content/browser/background_sync/background_sync_manager.cc
index 5c3289d..5624239 100644
--- a/content/browser/background_sync/background_sync_manager.cc
+++ b/content/browser/background_sync/background_sync_manager.cc
@@ -1081,7 +1081,7 @@ void BackgroundSyncManager::FireReadyEventsImpl(const base::Closure& callback) {
LookupActiveRegistration(service_worker_id, sw_id_and_key.second);
DCHECK(registration);
- service_worker_context_->FindRegistrationForId(
+ service_worker_context_->FindReadyRegistrationForId(
service_worker_id, active_registrations_[service_worker_id].origin,
base::Bind(&BackgroundSyncManager::FireReadyEventsDidFindRegistration,
weak_ptr_factory_.GetWeakPtr(), sw_id_and_key.second,