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

Side by Side Diff: ios/public/test/fake_sync_service_factory.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
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/fake_sync_service_factory.h" 5 #include "ios/public/test/fake_sync_service_factory.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "components/keyed_service/core/keyed_service.h" 9 #include "components/keyed_service/core/keyed_service.h"
10 #include "components/keyed_service/ios/browser_state_dependency_manager.h" 10 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
(...skipping 13 matching lines...) Expand all
24 private: 24 private:
25 sync_driver::FakeSyncService fake_sync_service_; 25 sync_driver::FakeSyncService fake_sync_service_;
26 }; 26 };
27 27
28 } // namespace 28 } // namespace
29 29
30 namespace ios { 30 namespace ios {
31 31
32 // static 32 // static
33 FakeSyncServiceFactory* FakeSyncServiceFactory::GetInstance() { 33 FakeSyncServiceFactory* FakeSyncServiceFactory::GetInstance() {
34 return Singleton<FakeSyncServiceFactory>::get(); 34 return base::Singleton<FakeSyncServiceFactory>::get();
35 } 35 }
36 36
37 // static 37 // static
38 sync_driver::FakeSyncService* FakeSyncServiceFactory::GetForBrowserState( 38 sync_driver::FakeSyncService* FakeSyncServiceFactory::GetForBrowserState(
39 ios::ChromeBrowserState* browser_state) { 39 ios::ChromeBrowserState* browser_state) {
40 return static_cast<KeyedFakeSyncService*>( 40 return static_cast<KeyedFakeSyncService*>(
41 FakeSyncServiceFactory::GetInstance()->GetServiceForBrowserState( 41 FakeSyncServiceFactory::GetInstance()->GetServiceForBrowserState(
42 browser_state, true))->fake_sync_service(); 42 browser_state, true))->fake_sync_service();
43 } 43 }
44 44
(...skipping 14 matching lines...) Expand all
59 59
60 FakeSyncServiceFactory::~FakeSyncServiceFactory() { 60 FakeSyncServiceFactory::~FakeSyncServiceFactory() {
61 } 61 }
62 62
63 scoped_ptr<KeyedService> FakeSyncServiceFactory::BuildServiceInstanceFor( 63 scoped_ptr<KeyedService> FakeSyncServiceFactory::BuildServiceInstanceFor(
64 web::BrowserState* context) const { 64 web::BrowserState* context) const {
65 return make_scoped_ptr(new KeyedFakeSyncService); 65 return make_scoped_ptr(new KeyedFakeSyncService);
66 } 66 }
67 67
68 } // namespace ios 68 } // namespace ios
OLDNEW
« no previous file with comments | « ios/public/test/fake_sync_service_factory.h ('k') | ios/public/test/test_keyed_service_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698