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

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

Issue 2968293002: Introduce SystemNetworkContextManager. (Closed)
Patch Set: Fix windows non-component build (??) 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
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..3d5b9a180c8ab88df4ca2ae811f6f387d10a1a5a
--- /dev/null
+++ b/content/public/network/network_service.h
@@ -0,0 +1,53 @@
+// 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 "base/macros.h"
+#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.
Randy Smith (Not in Mondays) 2017/07/08 22:58:50 nit: extra space
mmenke 2017/07/10 15:52:22 Done.
+class CONTENT_EXPORT NetworkService : public mojom::NetworkService {
+ public:
+ // 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.
+ 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(){};
+
+ 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
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_NETWORK_NETWORK_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698