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

Unified Diff: content/child/service_worker/service_worker_dispatcher.h

Issue 2840343002: network service: pass a URLLoaderFactory to renderers on SW registration
Patch Set: . 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/child/service_worker/service_worker_dispatcher.h
diff --git a/content/child/service_worker/service_worker_dispatcher.h b/content/child/service_worker/service_worker_dispatcher.h
index 5c6cabe573209ca19149d42d47dfb5c1e9af6902..d76d3c03275669f20041c664acf93c4c56464a4a 100644
--- a/content/child/service_worker/service_worker_dispatcher.h
+++ b/content/child/service_worker/service_worker_dispatcher.h
@@ -17,6 +17,7 @@
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "content/common/service_worker/service_worker_types.h"
+#include "content/common/url_loader_factory.mojom.h"
#include "content/public/child/worker_thread.h"
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerError.h"
#include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerProvider.h"
@@ -175,6 +176,10 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
return main_thread_task_runner_.get();
}
+ mojom::URLLoaderFactory* GetURLLoaderFactory() {
+ return url_loader_factory_.get();
+ }
+
private:
using RegistrationCallbackMap =
IDMap<std::unique_ptr<WebServiceWorkerRegistrationCallbacks>>;
@@ -219,7 +224,8 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
void OnRegistered(int thread_id,
int request_id,
const ServiceWorkerRegistrationObjectInfo& info,
- const ServiceWorkerVersionAttributes& attrs);
+ const ServiceWorkerVersionAttributes& attrs,
+ const mojo::MessagePipeHandle& url_loader_factory);
void OnUpdated(int thread_id, int request_id);
void OnUnregistered(int thread_id,
int request_id,
@@ -227,17 +233,20 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
void OnDidGetRegistration(int thread_id,
int request_id,
const ServiceWorkerRegistrationObjectInfo& info,
- const ServiceWorkerVersionAttributes& attrs);
+ const ServiceWorkerVersionAttributes& attrs,
+ const mojo::MessagePipeHandle& url_loader_factory);
void OnDidGetRegistrations(
int thread_id,
int request_id,
const std::vector<ServiceWorkerRegistrationObjectInfo>& infos,
- const std::vector<ServiceWorkerVersionAttributes>& attrs);
+ const std::vector<ServiceWorkerVersionAttributes>& attrs,
+ const std::vector<mojo::MessagePipeHandle>& url_loade_factories);
void OnDidGetRegistrationForReady(
int thread_id,
int request_id,
const ServiceWorkerRegistrationObjectInfo& info,
- const ServiceWorkerVersionAttributes& attrs);
+ const ServiceWorkerVersionAttributes& attrs,
+ const mojo::MessagePipeHandle& url_loader_factory);
void OnDidEnableNavigationPreload(int thread_id, int request_id);
void OnDidGetNavigationPreloadState(int thread_id,
int request_id,
@@ -335,6 +344,8 @@ class CONTENT_EXPORT ServiceWorkerDispatcher : public WorkerThread::Observer {
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
+ mojom::URLLoaderFactoryPtr url_loader_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher);
};

Powered by Google App Engine
This is Rietveld 408576698