OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/service_worker/service_worker_test_utils.h" |
| 6 |
| 7 #include "content/browser/service_worker/service_worker_provider_host.h" |
| 8 |
| 9 namespace content { |
| 10 |
| 11 std::unique_ptr<ServiceWorkerProviderHost> CreateProviderHostForWindow( |
| 12 int process_id, |
| 13 int provider_id, |
| 14 bool is_parent_frame_secure, |
| 15 base::WeakPtr<ServiceWorkerContextCore> context) { |
| 16 ServiceWorkerProviderHostInfo info(provider_id, MSG_ROUTING_NONE, |
| 17 SERVICE_WORKER_PROVIDER_FOR_WINDOW, |
| 18 is_parent_frame_secure); |
| 19 return ServiceWorkerProviderHost::Create(process_id, std::move(info), context, |
| 20 nullptr); |
| 21 } |
| 22 |
| 23 std::unique_ptr<ServiceWorkerProviderHost> |
| 24 CreateProviderHostForServiceWorkerContext( |
| 25 int process_id, |
| 26 int provider_id, |
| 27 bool is_parent_frame_secure, |
| 28 base::WeakPtr<ServiceWorkerContextCore> context) { |
| 29 ServiceWorkerProviderHostInfo info(provider_id, MSG_ROUTING_NONE, |
| 30 SERVICE_WORKER_PROVIDER_FOR_CONTROLLER, |
| 31 is_parent_frame_secure); |
| 32 return ServiceWorkerProviderHost::Create(process_id, std::move(info), context, |
| 33 nullptr); |
| 34 } |
| 35 |
| 36 std::unique_ptr<ServiceWorkerProviderHost> CreateProviderHostWithDispatcherHost( |
| 37 int process_id, |
| 38 int provider_id, |
| 39 base::WeakPtr<ServiceWorkerContextCore> context, |
| 40 int route_id, |
| 41 ServiceWorkerDispatcherHost* dispatcher_host) { |
| 42 ServiceWorkerProviderHostInfo info(provider_id, route_id, |
| 43 SERVICE_WORKER_PROVIDER_FOR_WINDOW, true); |
| 44 return ServiceWorkerProviderHost::Create(process_id, std::move(info), context, |
| 45 dispatcher_host); |
| 46 } |
| 47 |
| 48 } // namespace content |
OLD | NEW |