Chromium Code Reviews| 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 "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/common/url_loader_factory.mojom.h" | 11 #include "content/common/url_loader_factory.mojom.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class ResourceMessageFilter; | 15 class ResourceMessageFilter; |
|
yhirano
2016/11/10 06:42:29
Not needed.
horo
2016/11/10 14:46:33
Done.
| |
| 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. | 19 // a mojom::URLLoader. |
| 19 class URLLoaderFactoryImpl final : public mojom::URLLoaderFactory { | 20 class URLLoaderFactoryImpl final : public mojom::URLLoaderFactory { |
| 20 public: | 21 public: |
| 21 ~URLLoaderFactoryImpl() override; | 22 ~URLLoaderFactoryImpl() override; |
| 22 | 23 |
| 23 void CreateLoaderAndStart( | 24 void CreateLoaderAndStart( |
| 24 mojom::URLLoaderAssociatedRequest request, | 25 mojom::URLLoaderAssociatedRequest request, |
| 25 int32_t routing_id, | 26 int32_t routing_id, |
| 26 int32_t request_id, | 27 int32_t request_id, |
| 27 const ResourceRequest& url_request, | 28 const ResourceRequest& url_request, |
| 28 mojom::URLLoaderClientAssociatedPtrInfo client_ptr_info) override; | 29 mojom::URLLoaderClientAssociatedPtrInfo client_ptr_info) override; |
| 29 void SyncLoad(int32_t routing_id, | 30 void SyncLoad(int32_t routing_id, |
| 30 int32_t request_id, | 31 int32_t request_id, |
| 31 const ResourceRequest& request, | 32 const ResourceRequest& request, |
| 32 const SyncLoadCallback& callback) override; | 33 const SyncLoadCallback& callback) override; |
| 33 | 34 |
| 34 static void CreateLoaderAndStart( | 35 static void CreateLoaderAndStart( |
| 35 mojom::URLLoaderAssociatedRequest request, | 36 mojom::URLLoaderAssociatedRequest request, |
| 36 int32_t routing_id, | 37 int32_t routing_id, |
| 37 int32_t request_id, | 38 int32_t request_id, |
| 38 const ResourceRequest& url_request, | 39 const ResourceRequest& url_request, |
| 39 mojom::URLLoaderClientAssociatedPtrInfo client_ptr_info, | 40 mojom::URLLoaderClientAssociatedPtrInfo client_ptr_info, |
| 40 ResourceMessageFilter* filter); | 41 std::unique_ptr<ResourceRequesterInfo> requester_info); |
| 41 static void SyncLoad(int32_t routing_id, | 42 static void SyncLoad(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 ResourceMessageFilter* filter); | 46 std::unique_ptr<ResourceRequesterInfo> requester_info); |
| 46 | 47 |
| 47 // Creates a URLLoaderFactoryImpl instance. The instance is held by the | 48 // Creates a URLLoaderFactoryImpl instance. The instance is held by the |
| 48 // StrongBinding in it, so this function doesn't return the instance. | 49 // StrongBinding in it, so this function doesn't return the instance. |
| 49 CONTENT_EXPORT static void Create( | 50 CONTENT_EXPORT static void Create( |
| 50 scoped_refptr<ResourceMessageFilter> resource_message_filter, | 51 std::unique_ptr<ResourceRequesterInfo> requester_info, |
| 51 mojom::URLLoaderFactoryRequest request); | 52 mojom::URLLoaderFactoryRequest request); |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 explicit URLLoaderFactoryImpl( | 55 explicit URLLoaderFactoryImpl( |
| 55 scoped_refptr<ResourceMessageFilter> resource_message_filter); | 56 std::unique_ptr<ResourceRequesterInfo> requester_info); |
| 56 | 57 |
| 57 scoped_refptr<ResourceMessageFilter> resource_message_filter_; | 58 std::unique_ptr<ResourceRequesterInfo> requester_info_; |
| 58 | 59 |
| 59 DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryImpl); | 60 DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryImpl); |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 } // namespace content | 63 } // namespace content |
| 63 | 64 |
| 64 #endif // CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ | 65 #endif // CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ |
| OLD | NEW |