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

Unified Diff: content/browser/background_sync/background_sync_manager.cc

Issue 1317813003: Revert of [Background Sync] Allow sync manager access from uncontrolled clients (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/background_sync/background_sync_manager.cc
diff --git a/content/browser/background_sync/background_sync_manager.cc b/content/browser/background_sync/background_sync_manager.cc
index 6ba38b57924d1e0dbe2ded9e8775ea56e176531d..018bbae5ab270ecfc3905a191a9fbb48dd63cb93 100644
--- a/content/browser/background_sync/background_sync_manager.cc
+++ b/content/browser/background_sync/background_sync_manager.cc
@@ -73,7 +73,6 @@
void BackgroundSyncManager::Register(
int64 sw_registration_id,
const BackgroundSyncRegistrationOptions& options,
- bool requested_from_service_worker,
const StatusAndRegistrationCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -94,10 +93,10 @@
return;
}
- op_scheduler_.ScheduleOperation(base::Bind(
- &BackgroundSyncManager::RegisterImpl, weak_ptr_factory_.GetWeakPtr(),
- sw_registration_id, options, requested_from_service_worker,
- MakeStatusAndRegistrationCompletion(callback)));
+ op_scheduler_.ScheduleOperation(
+ base::Bind(&BackgroundSyncManager::RegisterImpl,
+ weak_ptr_factory_.GetWeakPtr(), sw_registration_id, options,
+ MakeStatusAndRegistrationCompletion(callback)));
}
void BackgroundSyncManager::Unregister(
@@ -302,7 +301,6 @@
void BackgroundSyncManager::RegisterImpl(
int64 sw_registration_id,
const BackgroundSyncRegistrationOptions& options,
- bool requested_from_service_worker,
const StatusAndRegistrationCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -337,8 +335,7 @@
return;
}
- if (requested_from_service_worker &&
- !sw_registration->active_version()->HasWindowClients()) {
+ if (!sw_registration->active_version()->HasWindowClients()) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(callback, BACKGROUND_SYNC_STATUS_NOT_ALLOWED,
BackgroundSyncRegistration()));

Powered by Google App Engine
This is Rietveld 408576698