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

Unified Diff: content/browser/service_worker/service_worker_context_core.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/service_worker/service_worker_context_core.h
diff --git a/content/browser/service_worker/service_worker_context_core.h b/content/browser/service_worker/service_worker_context_core.h
index f822e475b421ef782299c5b72d9c698514b2060f..0db24473027e55d22a1515fbbc8d5934c6243a88 100644
--- a/content/browser/service_worker/service_worker_context_core.h
+++ b/content/browser/service_worker/service_worker_context_core.h
@@ -56,6 +56,7 @@ class ServiceWorkerStorage;
class CONTENT_EXPORT ServiceWorkerContextCore
: NON_EXPORTED_BASE(public ServiceWorkerVersion::Listener) {
public:
+ using BoolCallback = base::Callback<void(bool)>;
typedef base::Callback<void(ServiceWorkerStatusCode status)> StatusCallback;
typedef base::Callback<void(ServiceWorkerStatusCode status,
const std::string& status_message,
@@ -161,9 +162,10 @@ class CONTENT_EXPORT ServiceWorkerContextCore
scoped_ptr<ProviderHostIterator> GetClientProviderHostIterator(
const GURL& origin);
- // Returns true if there is a ProviderHost for |origin| of type
- // SERVICE_WORKER_PROVIDER_FOR_WINDOW.
- bool HasWindowProviderHost(const GURL& origin) const;
+ // Runs the callback with true if there is a ProviderHost for |origin| of type
+ // SERVICE_WORKER_PROVIDER_FOR_WINDOW which is a main (top-level) frame.
+ void HasMainFrameProviderHost(const GURL& origin,
+ const BoolCallback& callback) const;
// Maintains a map from Client UUID to ProviderHost.
// (Note: instead of maintaining 2 maps we might be able to uniformly use

Powered by Google App Engine
This is Rietveld 408576698