Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Unified Diff: content/public/network/network_service.h

Issue 2968293002: Introduce SystemNetworkContextManager. (Closed)
Patch Set: Response to comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/network/DEPS ('k') | content/public/test/test_url_loader_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/network/network_service.h
diff --git a/content/public/network/network_service.h b/content/public/network/network_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..a4bb4de08bf9df1dd2c9fbf4db58410e93bfc76b
--- /dev/null
+++ b/content/public/network/network_service.h
@@ -0,0 +1,50 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_NETWORK_NETWORK_SERVICE_H_
+#define CONTENT_PUBLIC_NETWORK_NETWORK_SERVICE_H_
+
+#include <memory>
+
+#include "content/common/content_export.h"
+#include "content/public/common/network_service.mojom.h"
+
+namespace net {
+class URLRequestContext;
+class URLRequestContextBuilder;
+} // namespace net
+
+namespace content {
+
+// Allows an in-process NetworkService to be set up.
+class CONTENT_EXPORT NetworkService : public mojom::NetworkService {
+ public:
+ // TODO(mmenke): Take in a NetworkServiceRequest.
+ static std::unique_ptr<NetworkService> Create();
+
+ // Can be used to seed a NetworkContext with a consumer-configured
+ // URLRequestContextBuilder, which |params| will then be applied to. The
+ // results URLRequestContext will be written to |url_request_context|, which
+ // is owned by the NetworkContext, and can be further modified before first
+ // use. The returned NetworkContext must be destroyed before the
+ // NetworkService.
+ //
+ // This method is intended to ease the transition to an out-of-process
+ // NetworkService, and will be removed once that ships.
+ virtual std::unique_ptr<mojom::NetworkContext>
+ CreateNetworkContextWithBuilder(
+ content::mojom::NetworkContextRequest request,
+ content::mojom::NetworkContextParamsPtr params,
+ std::unique_ptr<net::URLRequestContextBuilder> builder,
+ net::URLRequestContext** url_request_context) = 0;
+
+ ~NetworkService() override {}
+
+ protected:
+ NetworkService() {}
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_NETWORK_NETWORK_SERVICE_H_
« no previous file with comments | « content/public/network/DEPS ('k') | content/public/test/test_url_loader_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698