OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ |
6 #define CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ | 6 #define CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/single_thread_task_runner.h" |
10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
11 #include "content/common/url_loader_factory.mojom.h" | 12 #include "content/common/url_loader_factory.mojom.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 | 15 |
15 class ResourceRequesterInfo; | 16 class ResourceRequesterInfo; |
16 | 17 |
17 // This class is an implementation of mojom::URLLoaderFactory that creates | 18 // This class is an implementation of mojom::URLLoaderFactory that creates |
18 // a mojom::URLLoader. This class is instantiated only for Service Worker | 19 // a mojom::URLLoader. This class is instantiated only for Service Worker |
19 // navigation preload or test caseses. | 20 // navigation preload or test caseses. |
(...skipping 20 matching lines...) Expand all Loading... |
40 static void SyncLoad(ResourceRequesterInfo* requester_info, | 41 static void SyncLoad(ResourceRequesterInfo* requester_info, |
41 int32_t routing_id, | 42 int32_t routing_id, |
42 int32_t request_id, | 43 int32_t request_id, |
43 const ResourceRequest& request, | 44 const ResourceRequest& request, |
44 const SyncLoadCallback& callback); | 45 const SyncLoadCallback& callback); |
45 | 46 |
46 // Creates a URLLoaderFactoryImpl instance. The instance is held by the | 47 // Creates a URLLoaderFactoryImpl instance. The instance is held by the |
47 // StrongBinding in it, so this function doesn't return the instance. | 48 // StrongBinding in it, so this function doesn't return the instance. |
48 CONTENT_EXPORT static void Create( | 49 CONTENT_EXPORT static void Create( |
49 scoped_refptr<ResourceRequesterInfo> requester_info, | 50 scoped_refptr<ResourceRequesterInfo> requester_info, |
50 mojom::URLLoaderFactoryRequest request); | 51 mojom::URLLoaderFactoryRequest request, |
| 52 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_runner); |
51 | 53 |
52 private: | 54 private: |
53 explicit URLLoaderFactoryImpl( | 55 explicit URLLoaderFactoryImpl( |
54 scoped_refptr<ResourceRequesterInfo> requester_info); | 56 scoped_refptr<ResourceRequesterInfo> requester_info, |
| 57 const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_runner); |
55 | 58 |
56 scoped_refptr<ResourceRequesterInfo> requester_info_; | 59 scoped_refptr<ResourceRequesterInfo> requester_info_; |
57 | 60 |
| 61 // Task runner for the IO thead. |
| 62 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; |
| 63 |
58 DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryImpl); | 64 DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryImpl); |
59 }; | 65 }; |
60 | 66 |
61 } // namespace content | 67 } // namespace content |
62 | 68 |
63 #endif // CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ | 69 #endif // CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ |
OLD | NEW |