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

Unified Diff: ios/chrome/browser/browser_state/browser_state_keyed_service_factories.mm

Issue 1111193002: [Upstream] Force instantiation of BSKSF during unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « ios/chrome/browser/browser_state/browser_state_keyed_service_factories.h ('k') | ios/chrome/ios_chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/browser_state/browser_state_keyed_service_factories.mm
diff --git a/ios/chrome/browser/browser_state/browser_state_keyed_service_factories.mm b/ios/chrome/browser/browser_state/browser_state_keyed_service_factories.mm
new file mode 100644
index 0000000000000000000000000000000000000000..7ddb34d799787e152d6a78cee3f964bf330acd6f
--- /dev/null
+++ b/ios/chrome/browser/browser_state/browser_state_keyed_service_factories.mm
@@ -0,0 +1,24 @@
+// Copyright 2015 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 "ios/chrome/browser/browser_state/browser_state_keyed_service_factories.h"
+
+#include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h"
+#include "ios/chrome/browser/suggestions/suggestions_service_factory.h"
+#include "ios/chrome/browser/translate/translate_accept_languages_factory.h"
+
+// This method gets the instance of each ServiceFactory. We do this so that
+// each ServiceFactory initializes itself and registers its dependencies with
+// the global PreferenceDependencyManager. We need to have a complete
+// dependency graph when we create a browser state so we can dispatch the
+// browser state creation message to the services that want to create their
+// services at browser state creation time.
+//
+// TODO(erg): This needs to be something else. I don't think putting every
+// FooServiceFactory here will scale or is desirable long term.
+void EnsureBrowserStateKeyedServiceFactoriesBuilt() {
+ TranslateAcceptLanguagesFactory::GetInstance();
+ dom_distiller::DomDistillerServiceFactory::GetInstance();
+ suggestions::SuggestionsServiceFactory::GetInstance();
+}
« no previous file with comments | « ios/chrome/browser/browser_state/browser_state_keyed_service_factories.h ('k') | ios/chrome/ios_chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698