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

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

Issue 2052613003: Speculatively launch Service Workers on mouse/touch events. [3/5] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use OverrideThreadForMessage to call StartServiceWorkerForNavigationHinton UI thread Created 4 years, 5 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 72650154c721daaa19b9511aabc62f9ff028e167..8525949005d60bc5c8ba8fa26b4c1c4d9fd4b2e6 100644
--- a/content/public/browser/service_worker_context.h
+++ b/content/public/browser/service_worker_context.h
@@ -12,6 +12,10 @@
#include "content/public/browser/service_worker_usage_info.h"
#include "url/gurl.h"
+namespace blink {
+enum class WebNavigationHintType;
+}
+
namespace content {
// Represents the per-StoragePartition ServiceWorker data.
@@ -105,6 +109,20 @@ 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 hint in the
+ // specified render process |render_process_id|. Must be called from the UI
+ // thread. The |callback| will always be called on the UI thred.
nhiroki 2016/07/25 06:15:13 s/UI thred/UI thread/
horo 2016/07/25 08:24:27 Done.
+ // This method can fail if:
+ // * No Service Worker was registered for |document_url|.
+ // * The specified render process is suitable for loading |document_url|.
nhiroki 2016/07/25 06:15:13 is suitable -> is not suitable ?
horo 2016/07/25 08:24:27 Done.
+ // This check is done by RenderProcessHostImpl::IsSuitableHost().
nhiroki 2016/07/25 06:15:13 RenderProcessHostImpl::IsSuitableHost() is an impl
horo 2016/07/25 08:24:27 Done.
+ // * Something unexpected goes wrong, like a renderer crash.
nhiroki 2016/07/25 06:15:13 This would be obvious and not necessary.
horo 2016/07/25 08:24:27 Done.
+ virtual void StartServiceWorkerForNavigationHint(
+ const GURL& document_url,
+ blink::WebNavigationHintType type,
+ int render_process_id,
+ const ResultCallback& callback) = 0;
+
protected:
ServiceWorkerContext() {}
virtual ~ServiceWorkerContext() {}

Powered by Google App Engine
This is Rietveld 408576698