| 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_LOADER_NAVIGATION_URL_LOADER_NETWORK_SERVICE_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_NETWORK_SERVICE_H_ |
| 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_NETWORK_SERVICE_H_ | 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_NETWORK_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "content/browser/loader/navigation_url_loader.h" | 10 #include "content/browser/loader/navigation_url_loader.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/common/url_loader.mojom.h" | 12 #include "content/common/url_loader.mojom.h" |
| 13 #include "content/common/url_loader_factory.mojom.h" | 13 #include "content/common/url_loader_factory.mojom.h" |
| 14 #include "content/public/browser/ssl_status.h" | 14 #include "content/public/browser/ssl_status.h" |
| 15 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
| 16 #include "services/service_manager/public/cpp/connector.h" | 16 #include "services/service_manager/public/cpp/connector.h" |
| 17 | 17 |
| 18 namespace net { | 18 namespace net { |
| 19 struct RedirectInfo; | 19 struct RedirectInfo; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 class ResourceContext; | 24 class ResourceContext; |
| 25 class NavigationPostDataHandler; | 25 class NavigationPostDataHandler; |
| 26 class StoragePartitionImpl; |
| 26 | 27 |
| 27 // This is an implementation of NavigationURLLoader used when | 28 // This is an implementation of NavigationURLLoader used when |
| 28 // --enable-network-service is used. | 29 // --enable-network-service is used. |
| 29 class NavigationURLLoaderNetworkService : public NavigationURLLoader, | 30 class NavigationURLLoaderNetworkService : public NavigationURLLoader, |
| 30 public mojom::URLLoaderClient { | 31 public mojom::URLLoaderClient { |
| 31 public: | 32 public: |
| 32 // The caller is responsible for ensuring that |delegate| outlives the loader. | 33 // The caller is responsible for ensuring that |delegate| outlives the loader. |
| 33 NavigationURLLoaderNetworkService( | 34 NavigationURLLoaderNetworkService( |
| 34 ResourceContext* resource_context, | 35 ResourceContext* resource_context, |
| 35 StoragePartition* storage_partition, | 36 StoragePartition* storage_partition, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 void ConnectURLLoaderFactory( | 74 void ConnectURLLoaderFactory( |
| 74 std::unique_ptr<service_manager::Connector> connector); | 75 std::unique_ptr<service_manager::Connector> connector); |
| 75 | 76 |
| 76 mojom::URLLoaderFactory* GetURLLoaderFactory(); | 77 mojom::URLLoaderFactory* GetURLLoaderFactory(); |
| 77 | 78 |
| 78 NavigationURLLoaderDelegate* delegate_; | 79 NavigationURLLoaderDelegate* delegate_; |
| 79 | 80 |
| 80 mojo::Binding<mojom::URLLoaderClient> binding_; | 81 mojo::Binding<mojom::URLLoaderClient> binding_; |
| 82 StoragePartitionImpl* storage_partition_; |
| 81 std::unique_ptr<NavigationRequestInfo> request_info_; | 83 std::unique_ptr<NavigationRequestInfo> request_info_; |
| 82 mojom::URLLoaderAssociatedPtr url_loader_associated_ptr_; | 84 mojom::URLLoaderAssociatedPtr url_loader_associated_ptr_; |
| 83 scoped_refptr<ResourceResponse> response_; | 85 scoped_refptr<ResourceResponse> response_; |
| 84 SSLStatus ssl_status_; | 86 SSLStatus ssl_status_; |
| 85 | 87 |
| 86 base::WeakPtrFactory<NavigationURLLoaderNetworkService> weak_factory_; | 88 base::WeakPtrFactory<NavigationURLLoaderNetworkService> weak_factory_; |
| 87 | 89 |
| 88 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderNetworkService); | 90 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderNetworkService); |
| 89 }; | 91 }; |
| 90 | 92 |
| 91 } // namespace content | 93 } // namespace content |
| 92 | 94 |
| 93 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_NETWORK_SERVICE_H_ | 95 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_NETWORK_SERVICE_H_ |
| OLD | NEW |