| 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 "base/single_thread_task_runner.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/common/url_loader_factory.mojom.h" | 12 #include "content/common/url_loader_factory.mojom.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 class ResourceRequesterInfo; | 16 class ResourceRequesterInfo; |
| 17 | 17 |
| 18 // This class is an implementation of mojom::URLLoaderFactory that creates | 18 // This class is an implementation of mojom::URLLoaderFactory that creates |
| 19 // a mojom::URLLoader. This class is instantiated only for Service Worker | 19 // a mojom::URLLoader. This class is instantiated only for Service Worker |
| 20 // navigation preload or test caseses. | 20 // navigation preload or test caseses. |
| 21 class URLLoaderFactoryImpl final : public mojom::URLLoaderFactory { | 21 class URLLoaderFactoryImpl final : public mojom::URLLoaderFactory { |
| 22 public: | 22 public: |
| 23 ~URLLoaderFactoryImpl() override; | 23 ~URLLoaderFactoryImpl() override; |
| 24 | 24 |
| 25 void CreateLoaderAndStart(mojom::URLLoaderAssociatedRequest request, | 25 void CreateLoaderAndStart(mojom::URLLoaderAssociatedRequest request, |
| 26 int32_t routing_id, | 26 int32_t routing_id, |
| 27 int32_t request_id, | 27 int32_t request_id, |
| 28 uint32_t options, |
| 28 const ResourceRequest& url_request, | 29 const ResourceRequest& url_request, |
| 29 mojom::URLLoaderClientPtr client) override; | 30 mojom::URLLoaderClientPtr client) override; |
| 30 void SyncLoad(int32_t routing_id, | 31 void SyncLoad(int32_t routing_id, |
| 31 int32_t request_id, | 32 int32_t request_id, |
| 32 const ResourceRequest& request, | 33 const ResourceRequest& request, |
| 33 const SyncLoadCallback& callback) override; | 34 const SyncLoadCallback& callback) override; |
| 34 | 35 |
| 35 static void CreateLoaderAndStart(ResourceRequesterInfo* requester_info, | 36 static void CreateLoaderAndStart(ResourceRequesterInfo* requester_info, |
| 36 mojom::URLLoaderAssociatedRequest request, | 37 mojom::URLLoaderAssociatedRequest request, |
| 37 int32_t routing_id, | 38 int32_t routing_id, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 60 | 61 |
| 61 // Task runner for the IO thead. | 62 // Task runner for the IO thead. |
| 62 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; | 63 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_; |
| 63 | 64 |
| 64 DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryImpl); | 65 DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryImpl); |
| 65 }; | 66 }; |
| 66 | 67 |
| 67 } // namespace content | 68 } // namespace content |
| 68 | 69 |
| 69 #endif // CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ | 70 #endif // CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ |
| OLD | NEW |