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

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

Issue 1471763003: [BackgroundSync] Only allow SyncManager.register to occur from main frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split
Patch Set: Address comments from PS6 Created 5 years, 1 month 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.h
diff --git a/content/browser/background_sync/background_sync_manager.h b/content/browser/background_sync/background_sync_manager.h
index 2eef23070455b744b905c7bb7f34be05e952e5bc..9a7cfe08aa0ed091953e0eef74a4186eee0d45e0 100644
--- a/content/browser/background_sync/background_sync_manager.h
+++ b/content/browser/background_sync/background_sync_manager.h
@@ -44,6 +44,7 @@ class ServiceWorkerContextWrapper;
class CONTENT_EXPORT BackgroundSyncManager
: NON_EXPORTED_BASE(public ServiceWorkerContextObserver) {
public:
+ using BoolCallback = base::Callback<void(bool)>;
using StatusCallback = base::Callback<void(BackgroundSyncStatus)>;
using StatusAndRegistrationCallback =
base::Callback<void(BackgroundSyncStatus,
@@ -146,6 +147,8 @@ class CONTENT_EXPORT BackgroundSyncManager
const ServiceWorkerVersion::StatusCallback& callback);
virtual void ScheduleDelayedTask(const base::Closure& callback,
base::TimeDelta delay);
+ virtual void HasMainFrameProviderHost(const GURL& origin,
+ const BoolCallback& callback);
private:
friend class BackgroundSyncManagerTest;
@@ -238,9 +241,17 @@ class CONTENT_EXPORT BackgroundSyncManager
ServiceWorkerStatusCode status);
// Register callbacks
+ void RegisterCheckIfHasMainFrame(
+ int64 sw_registration_id,
+ const BackgroundSyncRegistrationOptions& options,
+ const StatusAndRegistrationCallback& callback);
+ void RegisterDidCheckIfMainFrame(
+ int64 sw_registration_id,
+ const BackgroundSyncRegistrationOptions& options,
+ const StatusAndRegistrationCallback& callback,
+ bool has_main_frame_client);
void RegisterImpl(int64 sw_registration_id,
const BackgroundSyncRegistrationOptions& options,
- bool requested_from_service_worker,
const StatusAndRegistrationCallback& callback);
void RegisterDidStore(
int64 sw_registration_id,

Powered by Google App Engine
This is Rietveld 408576698