Commit fb074bc0 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Fix comments of KeyedService factories.

The GetDefaultFactory return a factory that can create instance as
the default factory does. It can be used by factories when default
is to not create the instance for test BrowserStates.

Bug: none
Change-Id: I02192ff82e16748eb8f7b69a4c482b3589527b5b
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Reviewed-on: https://chromium-review.googlesource.com/811085Reviewed-by: default avatarElodie Banel <lod@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522430}
parent 0c787794
......@@ -29,9 +29,8 @@ class AutocompleteClassifierFactory : public BrowserStateKeyedServiceFactory {
ios::ChromeBrowserState* browser_state);
static AutocompleteClassifierFactory* GetInstance();
// Returns the default factory used to build AutocompleteClassifier. Can be
// registered with SetTestingFactory to use the AutocompleteClassifier
// instance during testing.
// Returns the default factory used to build AutocompleteClassifiers. Can be
// registered with SetTestingFactory to use real instances during testing.
static TestingFactoryFunction GetDefaultFactory();
private:
......
......@@ -29,9 +29,8 @@ class InMemoryURLIndexFactory : public BrowserStateKeyedServiceFactory {
ios::ChromeBrowserState* browser_state);
static InMemoryURLIndexFactory* GetInstance();
// Returns the default factory used to build InMemoryURLIndex. Can be
// registered with SetTestingFactory to use the InMemoryURLIndex instance
// during testing.
// Returns the default factory used to build InMemoryURLIndexs. Can be
// registered with SetTestingFactory to use real instances during testing.
static TestingFactoryFunction GetDefaultFactory();
private:
......
......@@ -35,9 +35,8 @@ class IOSChromeLargeIconServiceFactory
static IOSChromeLargeIconServiceFactory* GetInstance();
// Returns the default factory used to build IOSChromeLargeIconServiceFactory.
// Can be registered with SetTestingFactory to use the
// IOSChromeLargeIconServiceFactory instance during testing.
// Returns the default factory used to build LargeIconServices. Can be
// registered with SetTestingFactory to use real instances during testing.
static TestingFactoryFunction GetDefaultFactory();
private:
......
......@@ -20,12 +20,6 @@
using ntp_snippets::ContentSuggestionsService;
// static
IOSChromeContentSuggestionsServiceFactory*
IOSChromeContentSuggestionsServiceFactory::GetInstance() {
return base::Singleton<IOSChromeContentSuggestionsServiceFactory>::get();
}
// static
ContentSuggestionsService*
IOSChromeContentSuggestionsServiceFactory::GetForBrowserState(
......@@ -35,6 +29,12 @@ IOSChromeContentSuggestionsServiceFactory::GetForBrowserState(
GetInstance()->GetServiceForBrowserState(browser_state, true));
}
// static
IOSChromeContentSuggestionsServiceFactory*
IOSChromeContentSuggestionsServiceFactory::GetInstance() {
return base::Singleton<IOSChromeContentSuggestionsServiceFactory>::get();
}
// static
BrowserStateKeyedServiceFactory::TestingFactoryFunction
IOSChromeContentSuggestionsServiceFactory::GetDefaultFactory() {
......
......@@ -28,12 +28,13 @@ class ContentSuggestionsService;
class IOSChromeContentSuggestionsServiceFactory
: public BrowserStateKeyedServiceFactory {
public:
static IOSChromeContentSuggestionsServiceFactory* GetInstance();
static ntp_snippets::ContentSuggestionsService* GetForBrowserState(
ios::ChromeBrowserState* browser_state);
// Returns the default factory used to build ContentSuggestionsService. Can be
// registered with SetTestingFactory to use the ContentSuggestionsService
// instance during testing.
static IOSChromeContentSuggestionsServiceFactory* GetInstance();
// Returns the default factory used to build ContentSuggestionsServices. Can
// be registered with SetTestingFactory to use real instances during testing.
static TestingFactoryFunction GetDefaultFactory();
private:
......
......@@ -27,11 +27,11 @@ class TemplateURLServiceFactory : public BrowserStateKeyedServiceFactory {
public:
static TemplateURLService* GetForBrowserState(
ios::ChromeBrowserState* browser_state);
static TemplateURLServiceFactory* GetInstance();
// Returns the default factory used to build TemplateURLService. Can be
// registered with SetTestingFactory to use the TemplateURLService instance
// during testing.
// Returns the default factory used to build TemplateURLServices. Can be
// registered with SetTestingFactory to use real instances during testing.
static TestingFactoryFunction GetDefaultFactory();
private:
......
......@@ -33,9 +33,8 @@ class IOSChromeTabRestoreServiceFactory
static IOSChromeTabRestoreServiceFactory* GetInstance();
// Returns the default factory used to build TabRestoreService. Can be
// registered with SetTestingFactory to use the TabRestoreService instance
// during testing.
// Returns the default factory used to build TabRestoreServices. Can be
// registered with SetTestingFactory to use real instances during testing.
static TestingFactoryFunction GetDefaultFactory();
private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment