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

Side by Side Diff: ios/public/test/test_keyed_service_provider.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « ios/public/test/fake_sync_service_factory.cc ('k') | ios/web/browser_url_rewriter_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ios/public/test/test_keyed_service_provider.h" 5 #include "ios/public/test/test_keyed_service_provider.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
11 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 11 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
12 #include "components/keyed_service/core/keyed_service.h" 12 #include "components/keyed_service/core/keyed_service.h"
13 #include "components/keyed_service/ios/browser_state_dependency_manager.h" 13 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
14 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" 14 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
15 #include "components/sync_driver/fake_sync_service.h" 15 #include "components/sync_driver/fake_sync_service.h"
16 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state. h" 16 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state. h"
17 #include "ios/public/test/fake_sync_service_factory.h" 17 #include "ios/public/test/fake_sync_service_factory.h"
18 18
19 namespace ios { 19 namespace ios {
20 namespace { 20 namespace {
21 21
22 class MissingServiceKeyedServiceFactory 22 class MissingServiceKeyedServiceFactory
23 : public BrowserStateKeyedServiceFactory { 23 : public BrowserStateKeyedServiceFactory {
24 public: 24 public:
25 static MissingServiceKeyedServiceFactory* GetInstance(); 25 static MissingServiceKeyedServiceFactory* GetInstance();
26 26
27 private: 27 private:
28 friend struct DefaultSingletonTraits<MissingServiceKeyedServiceFactory>; 28 friend struct base::DefaultSingletonTraits<MissingServiceKeyedServiceFactory>;
29 29
30 MissingServiceKeyedServiceFactory(); 30 MissingServiceKeyedServiceFactory();
31 ~MissingServiceKeyedServiceFactory() override; 31 ~MissingServiceKeyedServiceFactory() override;
32 32
33 // BrowserStateKeyedServiceFactory implementation. 33 // BrowserStateKeyedServiceFactory implementation.
34 scoped_ptr<KeyedService> BuildServiceInstanceFor( 34 scoped_ptr<KeyedService> BuildServiceInstanceFor(
35 web::BrowserState* context) const override; 35 web::BrowserState* context) const override;
36 36
37 DISALLOW_COPY_AND_ASSIGN(MissingServiceKeyedServiceFactory); 37 DISALLOW_COPY_AND_ASSIGN(MissingServiceKeyedServiceFactory);
38 }; 38 };
39 39
40 // static 40 // static
41 MissingServiceKeyedServiceFactory* 41 MissingServiceKeyedServiceFactory*
42 MissingServiceKeyedServiceFactory::GetInstance() { 42 MissingServiceKeyedServiceFactory::GetInstance() {
43 return Singleton<MissingServiceKeyedServiceFactory>::get(); 43 return base::Singleton<MissingServiceKeyedServiceFactory>::get();
44 } 44 }
45 45
46 MissingServiceKeyedServiceFactory::MissingServiceKeyedServiceFactory() 46 MissingServiceKeyedServiceFactory::MissingServiceKeyedServiceFactory()
47 : BrowserStateKeyedServiceFactory( 47 : BrowserStateKeyedServiceFactory(
48 "MissingService", 48 "MissingService",
49 BrowserStateDependencyManager::GetInstance()) { 49 BrowserStateDependencyManager::GetInstance()) {
50 } 50 }
51 51
52 MissingServiceKeyedServiceFactory::~MissingServiceKeyedServiceFactory() { 52 MissingServiceKeyedServiceFactory::~MissingServiceKeyedServiceFactory() {
53 } 53 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 return MissingServiceKeyedServiceFactory::GetInstance(); 99 return MissingServiceKeyedServiceFactory::GetInstance();
100 } 100 }
101 101
102 invalidation::ProfileInvalidationProvider* 102 invalidation::ProfileInvalidationProvider*
103 TestKeyedServiceProvider::GetProfileInvalidationProviderForBrowserState( 103 TestKeyedServiceProvider::GetProfileInvalidationProviderForBrowserState(
104 ios::ChromeBrowserState* browser_state) { 104 ios::ChromeBrowserState* browser_state) {
105 return nullptr; 105 return nullptr;
106 } 106 }
107 107
108 } // namespace ios 108 } // namespace ios
OLDNEW
« no previous file with comments | « ios/public/test/fake_sync_service_factory.cc ('k') | ios/web/browser_url_rewriter_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698