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

Unified Diff: content/browser/service_worker/service_worker_context_core.h

Issue 761923004: Keep alive ServiceWorkers when devtools is attached (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated comments Created 6 years 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 63522ea3b39ac1b8d1cf152bc06a5eaf01faff71..b0cd566b1d1a3c3dd8a9fcc685d642fa9101e983 100644
--- a/content/browser/service_worker/service_worker_context_core.h
+++ b/content/browser/service_worker/service_worker_context_core.h
@@ -187,6 +187,12 @@ class CONTENT_EXPORT ServiceWorkerContextCore
net::URLRequestContext* request_context,
base::WeakPtr<storage::BlobStorageContext> blob_storage_context);
+ // If |keep_alive_mode| is set to true, all existing and new service workers
+ // won't get stopped unless they are manually stopped or the process running
+ // the service worker is killed.
+ void SetKeepAliveMode(bool keep_alive_mode);
+ bool keep_alive_mode() const { return keep_alive_mode_; }
+
base::WeakPtr<ServiceWorkerContextCore> AsWeakPtr() {
return weak_factory_.GetWeakPtr();
}
@@ -229,6 +235,7 @@ class CONTENT_EXPORT ServiceWorkerContextCore
int next_registration_handle_id_;
scoped_refptr<ObserverListThreadSafe<ServiceWorkerContextObserver> >
observer_list_;
+ bool keep_alive_mode_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextCore);
};

Powered by Google App Engine
This is Rietveld 408576698