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

Side by Side Diff: ios/chrome/browser/dom_distiller/dom_distiller_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/chrome/browser/dom_distiller/dom_distiller_service_factory.h" 5 #include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/threading/sequenced_worker_pool.h" 9 #include "base/threading/sequenced_worker_pool.h"
10 #include "components/dom_distiller/core/article_entry.h" 10 #include "components/dom_distiller/core/article_entry.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 private: 43 private:
44 DISALLOW_COPY_AND_ASSIGN(DomDistillerKeyedService); 44 DISALLOW_COPY_AND_ASSIGN(DomDistillerKeyedService);
45 }; 45 };
46 } // namespace 46 } // namespace
47 47
48 namespace dom_distiller { 48 namespace dom_distiller {
49 49
50 // static 50 // static
51 DomDistillerServiceFactory* DomDistillerServiceFactory::GetInstance() { 51 DomDistillerServiceFactory* DomDistillerServiceFactory::GetInstance() {
52 return Singleton<DomDistillerServiceFactory>::get(); 52 return base::Singleton<DomDistillerServiceFactory>::get();
53 } 53 }
54 54
55 // static 55 // static
56 DomDistillerService* DomDistillerServiceFactory::GetForBrowserState( 56 DomDistillerService* DomDistillerServiceFactory::GetForBrowserState(
57 ios::ChromeBrowserState* browser_state) { 57 ios::ChromeBrowserState* browser_state) {
58 return static_cast<DomDistillerKeyedService*>( 58 return static_cast<DomDistillerKeyedService*>(
59 GetInstance()->GetServiceForBrowserState(browser_state, true)); 59 GetInstance()->GetServiceForBrowserState(browser_state, true));
60 } 60 }
61 61
62 DomDistillerServiceFactory::DomDistillerServiceFactory() 62 DomDistillerServiceFactory::DomDistillerServiceFactory()
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 distiller_page_factory.Pass(), distilled_page_prefs.Pass())); 100 distiller_page_factory.Pass(), distilled_page_prefs.Pass()));
101 } 101 }
102 102
103 web::BrowserState* DomDistillerServiceFactory::GetBrowserStateToUse( 103 web::BrowserState* DomDistillerServiceFactory::GetBrowserStateToUse(
104 web::BrowserState* context) const { 104 web::BrowserState* context) const {
105 // Makes normal profile and off-the-record profile use same service instance. 105 // Makes normal profile and off-the-record profile use same service instance.
106 return GetBrowserStateRedirectedInIncognito(context); 106 return GetBrowserStateRedirectedInIncognito(context);
107 } 107 }
108 108
109 } // namespace dom_distiller 109 } // namespace dom_distiller
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698