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

Unified Diff: content/public/browser/network_service_instance.cc

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/browser/network_service_instance.h ('k') | content/public/network/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/network_service_instance.cc
diff --git a/content/public/browser/network_service_instance.cc b/content/public/browser/network_service_instance.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5cf29702c7eb0b447203bc5a84dd908c60d2b0de
--- /dev/null
+++ b/content/public/browser/network_service_instance.cc
@@ -0,0 +1,30 @@
+// 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.
+
+#include "content/public/browser/network_service_instance.h"
+
+#include "base/feature_list.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/common/content_features.h"
+#include "content/public/common/network_service.mojom.h"
+#include "content/public/common/service_manager_connection.h"
+#include "content/public/common/service_names.mojom.h"
+#include "services/service_manager/public/cpp/connector.h"
+
+namespace content {
+
+mojom::NetworkService* GetNetworkService() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ DCHECK(base::FeatureList::IsEnabled(features::kNetworkService));
+
+ static mojom::NetworkServicePtr* g_network_service =
+ new mojom::NetworkServicePtr;
+ if (!g_network_service->is_bound()) {
+ ServiceManagerConnection::GetForProcess()->GetConnector()->BindInterface(
+ mojom::kNetworkServiceName, g_network_service);
+ }
+ return g_network_service->get();
+}
+
+} // namespace content
« no previous file with comments | « content/public/browser/network_service_instance.h ('k') | content/public/network/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698