OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_NETWORK_NETWORK_SERVICE_H_ |
| 6 #define CONTENT_PUBLIC_NETWORK_NETWORK_SERVICE_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "content/common/content_export.h" |
| 11 #include "content/public/common/network_service.mojom.h" |
| 12 |
| 13 namespace net { |
| 14 class URLRequestContext; |
| 15 class URLRequestContextBuilder; |
| 16 } // namespace net |
| 17 |
| 18 namespace content { |
| 19 |
| 20 // Allows an in-process NetworkService to be set up. |
| 21 class CONTENT_EXPORT NetworkService : public mojom::NetworkService { |
| 22 public: |
| 23 // TODO(mmenke): Take in a NetworkServiceRequest. |
| 24 static std::unique_ptr<NetworkService> Create(); |
| 25 |
| 26 // Can be used to seed a NetworkContext with a consumer-configured |
| 27 // URLRequestContextBuilder, which |params| will then be applied to. The |
| 28 // results URLRequestContext will be written to |url_request_context|, which |
| 29 // is owned by the NetworkContext, and can be further modified before first |
| 30 // use. The returned NetworkContext must be destroyed before the |
| 31 // NetworkService. |
| 32 // |
| 33 // This method is intended to ease the transition to an out-of-process |
| 34 // NetworkService, and will be removed once that ships. |
| 35 virtual std::unique_ptr<mojom::NetworkContext> |
| 36 CreateNetworkContextWithBuilder( |
| 37 content::mojom::NetworkContextRequest request, |
| 38 content::mojom::NetworkContextParamsPtr params, |
| 39 std::unique_ptr<net::URLRequestContextBuilder> builder, |
| 40 net::URLRequestContext** url_request_context) = 0; |
| 41 |
| 42 ~NetworkService() override {} |
| 43 |
| 44 protected: |
| 45 NetworkService() {} |
| 46 }; |
| 47 |
| 48 } // namespace content |
| 49 |
| 50 #endif // CONTENT_PUBLIC_NETWORK_NETWORK_SERVICE_H_ |
OLD | NEW |