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

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

Issue 2916533002: Introduce chrome://flags/#network-prediction-options-for-service-worker
Patch Set: Created 3 years, 7 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 22d13f9bd57ac84e19382a9430fc1a88f20b0199..e0a4074988f9f1594ce5068c249e1095200874fa 100644
--- a/content/public/browser/service_worker_context.h
+++ b/content/public/browser/service_worker_context.h
@@ -14,6 +14,8 @@
namespace content {
+class RenderProcessHost;
+
enum class ServiceWorkerCapability {
NO_SERVICE_WORKER,
SERVICE_WORKER_NO_FETCH_HANDLER,
@@ -139,6 +141,16 @@ class ServiceWorkerContext {
// be called on the UI thread.
virtual void ClearAllServiceWorkersForTest(const base::Closure& callback) = 0;
+ // Starts a Service Worker for |document_url| for a navigation preconnect in
+ // the specified render process |host|. Must be called from the UI thread. The
+ // |callback| will always be called on the UI thread. This method can fail if:
+ // * No Service Worker was registered for |document_url|.
+ // * The specified render process is not suitable for loading |document_url|.
+ virtual void StartServiceWorkerForNavigationPreconnect(
+ const GURL& document_url,
+ RenderProcessHost* host,
+ const ResultCallback& callback) = 0;
+
protected:
ServiceWorkerContext() {}
virtual ~ServiceWorkerContext() {}

Powered by Google App Engine
This is Rietveld 408576698