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

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

Issue 2751343002: Adds a basic offline check to InstallableManager. (Closed)
Patch Set: Updated tests 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..06a4b2d033e2a8324cc507934458293f1df3b396 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 ServiceWorkerStatus {
falken 2017/03/17 07:54:37 I'm a bit worried we have too many types named "St
piotrs 2017/03/21 00:00:44 It's not just about existence but about the extent
falken 2017/03/21 01:53:24 SGTM.
+ NO_SERVICE_WORKER,
+ SERVICE_WORKER_NO_FETCH_HANDLER,
+ SERVICE_WORKER_WITH_FETCH_HANDLER,
+};
+
// Represents the per-StoragePartition ServiceWorker data.
class ServiceWorkerContext {
public:
@@ -30,8 +36,8 @@ class ServiceWorkerContext {
using GetUsageInfoCallback = base::Callback<void(
const std::vector<ServiceWorkerUsageInfo>& usage_info)>;
- using CheckHasServiceWorkerCallback =
- base::Callback<void(bool has_service_worker)>;
+ using CheckServiceWorkerStatusCallback =
+ base::Callback<void(ServiceWorkerStatus status)>;
using CountExternalRequestsCallback =
base::Callback<void(size_t external_request_count)>;
@@ -109,10 +115,10 @@ class ServiceWorkerContext {
//
// This function can be called from any thread, but the callback will always
// be called on the UI thread.
- virtual void CheckHasServiceWorker(
+ virtual void CheckServiceWorkerStatus(
falken 2017/03/17 07:54:37 I think the original name may be clearer.
piotrs 2017/03/21 00:00:44 Reverted, Done.
const GURL& url,
const GURL& other_url,
- const CheckHasServiceWorkerCallback& callback) = 0;
+ const CheckServiceWorkerStatusCallback& callback) = 0;
// Returns the pending external request count for the worker with the
// specified |origin| via |callback|.

Powered by Google App Engine
This is Rietveld 408576698