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

Unified Diff: content/public/browser/service_worker_context.h

Issue 893793005: Check if there is a SW controlling the start page for app banner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and naming / comment tweaks Created 5 years, 10 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
« no previous file with comments | « content/browser/service_worker/service_worker_context_wrapper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/service_worker_context.h
diff --git a/content/public/browser/service_worker_context.h b/content/public/browser/service_worker_context.h
index 22c989b4ce8254ddfd423421af59aec9cec2f69c..a28662bb171c90ee915347ae391472b292bb13c9 100644
--- a/content/public/browser/service_worker_context.h
+++ b/content/public/browser/service_worker_context.h
@@ -32,6 +32,9 @@ class ServiceWorkerContext {
typedef base::Callback<void(const std::vector<ServiceWorkerUsageInfo>&
usage_info)> GetUsageInfoCallback;
+ typedef base::Callback<void(bool has_service_worker)>
+ CheckHasServiceWorkerCallback;
+
// Registers the header name which should not be passed to the ServiceWorker.
// Must be called from the IO thread.
CONTENT_EXPORT static void AddExcludedHeadersForFetchEvent(
@@ -73,7 +76,7 @@ class ServiceWorkerContext {
// TODO(jyasskin): Provide a way to SendMessage to a Scope.
- // Determines if a request for 'url' can be satisfied while offline.
+ // Determines if a request for |url| can be satisfied while offline.
// This method always completes asynchronously.
virtual void CanHandleMainResourceOffline(const GURL& url,
const GURL& first_party,
@@ -84,6 +87,17 @@ class ServiceWorkerContext {
virtual void GetAllOriginsInfo(const GetUsageInfoCallback& callback) = 0;
virtual void DeleteForOrigin(const GURL& origin_url) = 0;
+ // Returns true if an active Service Worker registration exists that matches
+ // |url|, and if |other_url| falls inside the scope of the same registration.
+ // Note this still returns true even if there is a Service Worker registration
+ // which has a longer match for |other_url|.
+ // This function can be called from any thread, but the callback will always
+ // be called on the UI thread.
+ virtual void CheckHasServiceWorker(
+ const GURL& url,
+ const GURL& other_url,
+ const CheckHasServiceWorkerCallback& callback) = 0;
+
protected:
ServiceWorkerContext() {}
virtual ~ServiceWorkerContext() {}
« no previous file with comments | « content/browser/service_worker/service_worker_context_wrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698