Chromium Code Reviews| 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 "base/macros.h" | |
| 11 #include "content/common/content_export.h" | |
| 12 #include "content/public/common/network_service.mojom.h" | |
| 13 | |
| 14 namespace net { | |
| 15 class URLRequestContext; | |
| 16 class URLRequestContextBuilder; | |
| 17 } // namespace net | |
| 18 | |
| 19 namespace content { | |
| 20 | |
| 21 // Allows an in-process NetworkService to be set up. | |
|
Randy Smith (Not in Mondays)
2017/07/08 22:58:50
nit: extra space
mmenke
2017/07/10 15:52:22
Done.
| |
| 22 class CONTENT_EXPORT NetworkService : public mojom::NetworkService { | |
| 23 public: | |
| 24 // TODO(mmenke): Take in a NetworkServiceRequest. | |
|
kinuko
2017/07/10 08:10:33
(and extra space here too)
mmenke
2017/07/10 15:52:22
Done.
| |
| 25 static std::unique_ptr<NetworkService> Create(); | |
| 26 | |
| 27 // Can be used to seed a NetworkContext with a consumer-configured | |
| 28 // URLRequestContextBuilder, which |params| will then be applied to. The | |
| 29 // results URLRequestContext will be written to |url_request_context|, which | |
| 30 // is owned by the NetworkContext, and can be further modified before first | |
| 31 // use. The returned NetworkContext must be destroyed before the | |
| 32 // NetworkService. | |
| 33 // | |
| 34 // This method is intended to ease the transition to an out-of-process | |
| 35 // NetworkService, and will be removed once that ships. | |
| 36 virtual std::unique_ptr<mojom::NetworkContext> | |
| 37 CreateNetworkContextWithBuilder( | |
| 38 content::mojom::NetworkContextRequest request, | |
| 39 content::mojom::NetworkContextParamsPtr params, | |
| 40 std::unique_ptr<net::URLRequestContextBuilder> builder, | |
| 41 net::URLRequestContext** url_request_context) = 0; | |
| 42 | |
| 43 ~NetworkService() override{}; | |
| 44 | |
| 45 protected: | |
| 46 NetworkService(){}; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(NetworkService); | |
|
jam
2017/07/08 01:30:08
nit: not needed since interface isn't copyable
mmenke
2017/07/10 15:52:22
Done, though I'm not certain I agree. I feel it's
| |
| 49 }; | |
| 50 | |
| 51 } // namespace content | |
| 52 | |
| 53 #endif // CONTENT_PUBLIC_NETWORK_NETWORK_SERVICE_H_ | |
| OLD | NEW |