| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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_APPCACHE_APPCACHE_SUBRESOURCE_URL_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_SUBRESOURCE_URL_FACTORY_H_ |
| 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_SUBRESOURCE_URL_FACTORY_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_SUBRESOURCE_URL_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "content/common/url_loader_factory.mojom.h" | 9 #include "content/common/url_loader_factory.mojom.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // Factory function to create an instance of the factory. | 25 // Factory function to create an instance of the factory. |
| 26 // 1. The |factory_getter| parameter is used to query the network service | 26 // 1. The |factory_getter| parameter is used to query the network service |
| 27 // to pass network requests to. | 27 // to pass network requests to. |
| 28 // Returns a URLLoaderFactoryPtr instance which controls the lifetime of the | 28 // Returns a URLLoaderFactoryPtr instance which controls the lifetime of the |
| 29 // factory. | 29 // factory. |
| 30 static mojom::URLLoaderFactoryPtr CreateURLLoaderFactory( | 30 static mojom::URLLoaderFactoryPtr CreateURLLoaderFactory( |
| 31 URLLoaderFactoryGetter* factory_getter); | 31 URLLoaderFactoryGetter* factory_getter); |
| 32 | 32 |
| 33 // mojom::URLLoaderFactory implementation. | 33 // mojom::URLLoaderFactory implementation. |
| 34 void CreateLoaderAndStart( | 34 void CreateLoaderAndStart(mojom::URLLoaderRequest url_loader_request, |
| 35 mojom::URLLoaderAssociatedRequest url_loader_request, | 35 int32_t routing_id, |
| 36 int32_t routing_id, | 36 int32_t request_id, |
| 37 int32_t request_id, | 37 uint32_t options, |
| 38 uint32_t options, | 38 const ResourceRequest& request, |
| 39 const ResourceRequest& request, | 39 mojom::URLLoaderClientPtr client, |
| 40 mojom::URLLoaderClientPtr client, | 40 const net::MutableNetworkTrafficAnnotationTag& |
| 41 const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) | 41 traffic_annotation) override; |
| 42 override; | |
| 43 void SyncLoad(int32_t routing_id, | 42 void SyncLoad(int32_t routing_id, |
| 44 int32_t request_id, | 43 int32_t request_id, |
| 45 const ResourceRequest& request, | 44 const ResourceRequest& request, |
| 46 SyncLoadCallback callback) override; | 45 SyncLoadCallback callback) override; |
| 47 | 46 |
| 48 private: | 47 private: |
| 49 AppCacheSubresourceURLFactory(mojom::URLLoaderFactoryRequest request, | 48 AppCacheSubresourceURLFactory(mojom::URLLoaderFactoryRequest request, |
| 50 URLLoaderFactoryGetter* factory_getter); | 49 URLLoaderFactoryGetter* factory_getter); |
| 51 | 50 |
| 52 void OnConnectionError(); | 51 void OnConnectionError(); |
| 53 | 52 |
| 54 // Mojo binding. | 53 // Mojo binding. |
| 55 mojo::Binding<mojom::URLLoaderFactory> binding_; | 54 mojo::Binding<mojom::URLLoaderFactory> binding_; |
| 56 | 55 |
| 57 // Used to retrieve the network service factory to pass unhandled requests to | 56 // Used to retrieve the network service factory to pass unhandled requests to |
| 58 // the network service. | 57 // the network service. |
| 59 scoped_refptr<URLLoaderFactoryGetter> default_url_loader_factory_getter_; | 58 scoped_refptr<URLLoaderFactoryGetter> default_url_loader_factory_getter_; |
| 60 | 59 |
| 61 DISALLOW_COPY_AND_ASSIGN(AppCacheSubresourceURLFactory); | 60 DISALLOW_COPY_AND_ASSIGN(AppCacheSubresourceURLFactory); |
| 62 }; | 61 }; |
| 63 | 62 |
| 64 } // namespace content | 63 } // namespace content |
| 65 | 64 |
| 66 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_FACTORY_H_ | 65 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_URL_LOADER_FACTORY_H_ |
| OLD | NEW |