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

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

Issue 2751343002: Adds a basic offline check to InstallableManager. (Closed)
Patch Set: Rebase Created 3 years, 9 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/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 c095f9d1314c7fe028441bb19479c2f73d4fc99e..90c3d93ad587025b5c88774716313c632e1a94e7 100644
--- a/content/public/browser/service_worker_context.h
+++ b/content/public/browser/service_worker_context.h
@@ -18,6 +18,12 @@ enum class WebNavigationHintType;
namespace content {
+enum class ServiceWorkerCapability {
+ NO_SERVICE_WORKER,
+ SERVICE_WORKER_NO_FETCH_HANDLER,
+ SERVICE_WORKER_WITH_FETCH_HANDLER,
+};
+
// Represents the per-StoragePartition ServiceWorker data.
class ServiceWorkerContext {
public:
@@ -31,7 +37,7 @@ class ServiceWorkerContext {
const std::vector<ServiceWorkerUsageInfo>& usage_info)>;
using CheckHasServiceWorkerCallback =
- base::Callback<void(bool has_service_worker)>;
+ base::Callback<void(ServiceWorkerCapability capability)>;
using CountExternalRequestsCallback =
base::Callback<void(size_t external_request_count)>;
@@ -102,10 +108,14 @@ class ServiceWorkerContext {
virtual void DeleteForOrigin(const GURL& origin_url,
const ResultCallback& callback) = 0;
- // Returns true if a 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|.
+ // Returns ServiceWorkerCapability describing existence and properties of a
+ // Service Worker registration matching |url|. Found service worker
+ // registration must also encompass the |other_url|, otherwise it will be
+ // considered non existent by this method. Note that the longest matching
+ // registration for |url| is described, which is not necessarily the longest
+ // matching registration for |other_url|. In case the service worker is being
+ // installed as of calling this method, it will wait for the installation to
+ // finish before coming back with the result.
//
// This function can be called from any thread, but the callback will always
// be called on the UI thread.
« no previous file with comments | « content/browser/service_worker/service_worker_context_wrapper.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698