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 <utility> |
| 8 |
| 9 #include "content/browser/service_worker/service_worker_provider_host.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 std::unique_ptr<ServiceWorkerProviderHost> CreateProviderHostForWindow( |
| 14 int process_id, |
| 15 int provider_id, |
| 16 bool is_parent_frame_secure, |
| 17 base::WeakPtr<ServiceWorkerContextCore> context) { |
| 18 ServiceWorkerProviderHostInfo info(provider_id, MSG_ROUTING_NONE, |
| 19 SERVICE_WORKER_PROVIDER_FOR_WINDOW, |
| 20 is_parent_frame_secure); |
| 21 return ServiceWorkerProviderHost::Create(process_id, std::move(info), |
| 22 std::move(context), nullptr); |
| 23 } |
| 24 |
| 25 std::unique_ptr<ServiceWorkerProviderHost> |
| 26 CreateProviderHostForServiceWorkerContext( |
| 27 int process_id, |
| 28 int provider_id, |
| 29 bool is_parent_frame_secure, |
| 30 base::WeakPtr<ServiceWorkerContextCore> context) { |
| 31 ServiceWorkerProviderHostInfo info(provider_id, MSG_ROUTING_NONE, |
| 32 SERVICE_WORKER_PROVIDER_FOR_CONTROLLER, |
| 33 is_parent_frame_secure); |
| 34 return ServiceWorkerProviderHost::Create(process_id, std::move(info), |
| 35 std::move(context), nullptr); |
| 36 } |
| 37 |
| 38 std::unique_ptr<ServiceWorkerProviderHost> CreateProviderHostWithDispatcherHost( |
| 39 int process_id, |
| 40 int provider_id, |
| 41 base::WeakPtr<ServiceWorkerContextCore> context, |
| 42 int route_id, |
| 43 ServiceWorkerDispatcherHost* dispatcher_host) { |
| 44 ServiceWorkerProviderHostInfo info(provider_id, route_id, |
| 45 SERVICE_WORKER_PROVIDER_FOR_WINDOW, true); |
| 46 return ServiceWorkerProviderHost::Create(process_id, std::move(info), |
| 47 std::move(context), dispatcher_host); |
| 48 } |
| 49 |
| 50 } // namespace content |
OLD | NEW |