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

Unified Diff: content/renderer/service_worker/service_worker_context_client.h

Issue 2779763004: Create ServiceWorkerProviderHost before starting worker (Closed)
Patch Set: Pass the param of BindWithProviderInfo by value instead of pointer 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/renderer/service_worker/service_worker_context_client.h
diff --git a/content/renderer/service_worker/service_worker_context_client.h b/content/renderer/service_worker/service_worker_context_client.h
index 5b5cac9d8306369ff8fd6c724e50ea4bfe51060a..fcbc9ea7f83759fbdc5edcc4930dedd14d6c761f 100644
--- a/content/renderer/service_worker/service_worker_context_client.h
+++ b/content/renderer/service_worker/service_worker_context_client.h
@@ -23,6 +23,7 @@
#include "content/child/webmessageportchannel_impl.h"
#include "content/common/service_worker/embedded_worker.mojom.h"
#include "content/common/service_worker/service_worker_event_dispatcher.mojom.h"
+#include "content/common/service_worker/service_worker_provider.mojom.h"
#include "content/common/service_worker/service_worker_status_code.h"
#include "content/common/service_worker/service_worker_types.h"
#include "ipc/ipc_listener.h"
@@ -57,8 +58,8 @@ namespace content {
struct PlatformNotificationData;
struct PushEventPayload;
struct ServiceWorkerClientInfo;
+class ServiceWorkerNetworkProvider;
class ServiceWorkerProviderContext;
-class ServiceWorkerContextClient;
class ThreadSafeSender;
class EmbeddedWorkerInstanceClientImpl;
class WebWorkerFetchContext;
@@ -87,6 +88,7 @@ class ServiceWorkerContextClient : public blink::WebServiceWorkerContextClient,
const GURL& script_url,
mojom::ServiceWorkerEventDispatcherRequest dispatcher_request,
mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo instance_host,
+ mojom::ServiceWorkerProviderInfoForStartWorkerPtr provider_info,
std::unique_ptr<EmbeddedWorkerInstanceClientImpl> embedded_worker_client);
~ServiceWorkerContextClient() override;
@@ -342,7 +344,6 @@ class ServiceWorkerContextClient : public blink::WebServiceWorkerContextClient,
const int64_t service_worker_version_id_;
const GURL service_worker_scope_;
const GURL script_url_;
- int network_provider_id_ = kInvalidServiceWorkerProviderId;
scoped_refptr<ThreadSafeSender> sender_;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
scoped_refptr<base::TaskRunner> worker_task_runner_;
@@ -359,6 +360,10 @@ class ServiceWorkerContextClient : public blink::WebServiceWorkerContextClient,
scoped_refptr<mojom::ThreadSafeEmbeddedWorkerInstanceHostAssociatedPtr>
instance_host_;
+ // This is passed to ServiceWorkerNetworkProvider when
+ // createServiceWorkerNetworkProvider is called.
+ std::unique_ptr<ServiceWorkerNetworkProvider> pending_network_provider_;
+
// Renderer-side object corresponding to WebEmbeddedWorkerInstance.
// This is valid from the ctor to workerContextDestroyed.
std::unique_ptr<EmbeddedWorkerInstanceClientImpl> embedded_worker_client_;

Powered by Google App Engine
This is Rietveld 408576698