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

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

Issue 2943583002: [extension SW] Support lazy events from extension service workers. (Closed)
Patch Set: Address comments Created 3 years, 6 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 9a9aa0a823a13218c9f0e3a37a533eaf6ea702f8..0cfa362c02bf3778c5548d5d2fc90bd5c3682d69 100644
--- a/content/public/browser/service_worker_context.h
+++ b/content/public/browser/service_worker_context.h
@@ -58,6 +58,9 @@ class ServiceWorkerContext {
using StartServiceWorkerForNavigationHintCallback =
base::Callback<void(StartServiceWorkerForNavigationHintResult result)>;
+ using GetWorkerInfoCallback =
+ base::OnceCallback<void(int process_id, int thread_id)>;
+
// Registers the header name which should not be passed to the ServiceWorker.
// Must be called from the IO thread.
CONTENT_EXPORT static void AddExcludedHeadersForFetchEvent(
@@ -107,6 +110,16 @@ class ServiceWorkerContext {
virtual bool FinishedExternalRequest(int64_t service_worker_version_id,
const std::string& request_uuid) = 0;
+ // Starts a previously registered worker at |origin| and returns running
falken 2017/06/22 03:35:57 Starts the active worker of the registration whose
lazyboy 2017/06/23 02:18:30 Done.
+ // worker info via |info_callback|.
+ // |info_callback| contains worker render process id and worker thread id.
falken 2017/06/22 03:35:57 Is "contains" the conventional wording for a callb
lazyboy 2017/06/23 02:18:30 That's better, thanks. Done.
+ //
+ // Must be called on IO thread.
+ virtual void GetWorkerInfoAfterStartWorker(
+ const GURL& origin,
falken 2017/06/22 03:35:57 |origin| looks weird to me because an origin can h
lazyboy 2017/06/23 02:18:30 It is origin + scope, For example, chrome-extensio
+ GetWorkerInfoCallback info_callback,
+ base::OnceClosure failure_callback) = 0;
+
// Equivalent to calling navigator.serviceWorker.unregister(pattern) from a
// renderer, except that |pattern| is an absolute URL instead of relative to
// some current origin. |callback| is passed true when the JS promise is

Powered by Google App Engine
This is Rietveld 408576698