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

Unified Diff: content/common/worker_fetch_context_factory.mojom

Issue 2804843005: Implement the infrastructure of creating WorkerFetchContext in worker global scope. (Closed)
Patch Set: incorporated nhiroki and kinuko's comment Created 3 years, 8 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/common/worker_fetch_context_factory.mojom
diff --git a/content/common/worker_fetch_context_factory.mojom b/content/common/worker_fetch_context_factory.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..3e3c6d75fef52dc8bb37e83b3bc21124e1b4ae8e
--- /dev/null
+++ b/content/common/worker_fetch_context_factory.mojom
@@ -0,0 +1,29 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module content.mojom;
+
+import "url_loader_factory.mojom";
+
+interface ServiceWorkerClient {
+ // Called when the ServiceWorkerClient (which is Dedicated Worker or Shared
kinuko 2017/04/14 14:00:26 Too generic name if it's only for clients that liv
horo 2017/04/17 15:12:04 Done.
+ // Worker) is controlled by a new service worker.
+ SetControllerServiceWorker(int64 controller_version_id);
+};
+
+interface WorkerFetchContextFactory {
kinuko 2017/04/14 14:00:26 Can we also have a interface-level comment? I'm h
horo 2017/04/17 15:12:04 Done.
+ // Called from a dedicated (or shared) worker thread to create a worker fetch
+ // context.
+ // The browser process returns a URLLoaderFactory. SetControllerServiceWorker
+ // method of the passed ServiceWorkerClient interface will be called when the
+ // parent frame and the worker context is controlled by a service worker.
+ // |service_worker_provider_id| is the service worker provider id of the
+ // parent frame.
+ CreateWorkerFetchContext(associated URLLoaderFactory& loader,
+ associated ServiceWorkerClient client,
+ int32 service_worker_provider_id);
kinuko 2017/04/14 14:00:26 Similarly, this seems to be more about setting up
horo 2017/04/17 15:12:04 Does 'this' mean GetURLLoaderFactory? GetURLLoader
kinuko 2017/04/18 08:00:31 Sorry, I meant 'CreateWorkerFetchContext' one. Th
horo 2017/04/18 12:53:33 This IPC is used to get the URLLoaderFactory and r
kinuko 2017/04/19 03:24:49 This IPC is used to get the URLLoaderFactory and r
+
+ // Called from the service worker thread to get the URLLoaderFactory.
+ GetURLLoaderFactory(associated URLLoaderFactory& loader);
+};

Powered by Google App Engine
This is Rietveld 408576698