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

Unified Diff: chrome/browser/net/profile_network_context_service_factory.cc

Issue 2976323002: Hook up ProfileIOData's URLRequestContext to a NetworkService. (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
Index: chrome/browser/net/profile_network_context_service_factory.cc
diff --git a/chrome/browser/net/profile_network_context_service_factory.cc b/chrome/browser/net/profile_network_context_service_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3ab33703e4c6479f40c3aa829e74a13b88f4f81f
--- /dev/null
+++ b/chrome/browser/net/profile_network_context_service_factory.cc
@@ -0,0 +1,40 @@
+// 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 "chrome/browser/net/profile_network_context_service_factory.h"
+
+#include "chrome/browser/net/profile_network_context_service.h"
+#include "chrome/browser/profiles/profile.h"
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+
+ProfileNetworkContextService*
+ProfileNetworkContextServiceFactory::GetForContext(
+ content::BrowserContext* browser_context) {
+ return static_cast<ProfileNetworkContextService*>(
+ GetInstance()->GetServiceForBrowserContext(browser_context, true));
+}
+
+ProfileNetworkContextServiceFactory*
+ProfileNetworkContextServiceFactory::GetInstance() {
+ return base::Singleton<ProfileNetworkContextServiceFactory>::get();
+}
+
+ProfileNetworkContextServiceFactory::ProfileNetworkContextServiceFactory()
+ : BrowserContextKeyedServiceFactory(
+ "ProfileNetworkContextService",
+ BrowserContextDependencyManager::GetInstance()) {}
+
+ProfileNetworkContextServiceFactory::~ProfileNetworkContextServiceFactory() {}
+
+KeyedService* ProfileNetworkContextServiceFactory::BuildServiceInstanceFor(
+ content::BrowserContext* profile) const {
+ return new ProfileNetworkContextService(Profile::FromBrowserContext(profile));
+}
+
+content::BrowserContext*
+ProfileNetworkContextServiceFactory::GetBrowserContextToUse(
+ content::BrowserContext* context) const {
+ // Create separate service for incognito profiles.
+ return context;
+}

Powered by Google App Engine
This is Rietveld 408576698