Chromium Code Reviews| Index: content/browser/service_worker/service_worker_test_utils.h |
| diff --git a/content/browser/service_worker/service_worker_test_utils.h b/content/browser/service_worker/service_worker_test_utils.h |
| index 279faf37c1c6e87ae7f6db350dbee76ad29fee9a..057bf7078b56d28b019232b5c2f346a06bdb05a7 100644 |
| --- a/content/browser/service_worker/service_worker_test_utils.h |
| +++ b/content/browser/service_worker/service_worker_test_utils.h |
| @@ -11,6 +11,7 @@ |
| #include "base/callback.h" |
| #include "base/command_line.h" |
| #include "base/memory/weak_ptr.h" |
| +#include "content/common/service_worker/service_worker_provider_interfaces.mojom.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/common/content_switches.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -46,25 +47,47 @@ base::Callback<void(Arg)> CreateReceiverOnCurrentThread( |
| return base::Bind(&ReceiveResult<Arg>, id, quit, out); |
| } |
| +// Container for keeping the Mojo endpoints which should be on the renderer. |
|
falken
2017/05/22 08:28:12
The comment should probably mention "provider" som
shimazu
2017/05/23 06:29:34
Done.
|
| +// When destroying the pointer or request, its error handler will be called. |
|
falken
2017/05/22 08:28:12
its means "the |client_request|'s" ?
shimazu
2017/05/23 06:29:34
Removed this line because the comment seems duplic
falken
2017/05/23 08:31:49
Acknowledged.
|
| +struct ServiceWorkerRemoteProviderEndpoint { |
| + ServiceWorkerRemoteProviderEndpoint(); |
| + ServiceWorkerRemoteProviderEndpoint( |
| + ServiceWorkerRemoteProviderEndpoint&& other); |
| + ~ServiceWorkerRemoteProviderEndpoint(); |
| + |
| + // Bound with content::ServiceWorkerProviderHost. The provider host will be |
| + // removed asynchronously when this pointer is closed. |
| + mojom::ServiceWorkerProviderHostAssociatedPtr host_ptr; |
| + // This is the other end of ServiceWorkerProviderAssociatedPtr owned by |
| + // ServiceWorkerProviderHost. |
|
falken
2017/05/22 08:28:12
content::ServiceWorkerProviderHost?
shimazu
2017/05/23 06:29:34
Done.
|
| + mojom::ServiceWorkerProviderAssociatedRequest client_request; |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRemoteProviderEndpoint); |
| +}; |
| + |
| std::unique_ptr<ServiceWorkerProviderHost> CreateProviderHostForWindow( |
| int process_id, |
| int provider_id, |
| bool is_parent_frame_secure, |
| - base::WeakPtr<ServiceWorkerContextCore> context); |
| + base::WeakPtr<ServiceWorkerContextCore> context, |
| + ServiceWorkerRemoteProviderEndpoint* output_endpoint); |
| std::unique_ptr<ServiceWorkerProviderHost> |
| CreateProviderHostForServiceWorkerContext( |
| int process_id, |
| int provider_id, |
| bool is_parent_frame_secure, |
| - base::WeakPtr<ServiceWorkerContextCore> context); |
| + base::WeakPtr<ServiceWorkerContextCore> context, |
| + ServiceWorkerRemoteProviderEndpoint* output_endpoint); |
| std::unique_ptr<ServiceWorkerProviderHost> CreateProviderHostWithDispatcherHost( |
| int process_id, |
| int provider_id, |
| base::WeakPtr<ServiceWorkerContextCore> context, |
| int route_id, |
| - ServiceWorkerDispatcherHost* dispatcher_host); |
| + ServiceWorkerDispatcherHost* dispatcher_host, |
| + ServiceWorkerRemoteProviderEndpoint* output_endpoint); |
| } // namespace content |