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

Side by Side Diff: ios/chrome/browser/signin/signin_manager_factory.cc

Issue 1861593005: Convert //ios from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 4 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 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/signin/signin_manager_factory.h" 5 #include "ios/chrome/browser/signin/signin_manager_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 SigninManagerFactoryObserver* observer) { 72 SigninManagerFactoryObserver* observer) {
73 observer_list_.RemoveObserver(observer); 73 observer_list_.RemoveObserver(observer);
74 } 74 }
75 75
76 void SigninManagerFactory::NotifyObserversOfSigninManagerCreationForTesting( 76 void SigninManagerFactory::NotifyObserversOfSigninManagerCreationForTesting(
77 SigninManager* manager) { 77 SigninManager* manager) {
78 FOR_EACH_OBSERVER(SigninManagerFactoryObserver, observer_list_, 78 FOR_EACH_OBSERVER(SigninManagerFactoryObserver, observer_list_,
79 SigninManagerCreated(manager)); 79 SigninManagerCreated(manager));
80 } 80 }
81 81
82 scoped_ptr<KeyedService> SigninManagerFactory::BuildServiceInstanceFor( 82 std::unique_ptr<KeyedService> SigninManagerFactory::BuildServiceInstanceFor(
83 web::BrowserState* context) const { 83 web::BrowserState* context) const {
84 ios::ChromeBrowserState* chrome_browser_state = 84 ios::ChromeBrowserState* chrome_browser_state =
85 ios::ChromeBrowserState::FromBrowserState(context); 85 ios::ChromeBrowserState::FromBrowserState(context);
86 scoped_ptr<SigninManager> service(new SigninManager( 86 std::unique_ptr<SigninManager> service(new SigninManager(
87 SigninClientFactory::GetForBrowserState(chrome_browser_state), 87 SigninClientFactory::GetForBrowserState(chrome_browser_state),
88 OAuth2TokenServiceFactory::GetForBrowserState(chrome_browser_state), 88 OAuth2TokenServiceFactory::GetForBrowserState(chrome_browser_state),
89 ios::AccountTrackerServiceFactory::GetForBrowserState( 89 ios::AccountTrackerServiceFactory::GetForBrowserState(
90 chrome_browser_state), 90 chrome_browser_state),
91 ios::GaiaCookieManagerServiceFactory::GetForBrowserState( 91 ios::GaiaCookieManagerServiceFactory::GetForBrowserState(
92 chrome_browser_state))); 92 chrome_browser_state)));
93 service->Initialize(GetApplicationContext()->GetLocalState()); 93 service->Initialize(GetApplicationContext()->GetLocalState());
94 FOR_EACH_OBSERVER(SigninManagerFactoryObserver, observer_list_, 94 FOR_EACH_OBSERVER(SigninManagerFactoryObserver, observer_list_,
95 SigninManagerCreated(service.get())); 95 SigninManagerCreated(service.get()));
96 return std::move(service); 96 return std::move(service);
97 } 97 }
98 98
99 void SigninManagerFactory::BrowserStateShutdown(web::BrowserState* context) { 99 void SigninManagerFactory::BrowserStateShutdown(web::BrowserState* context) {
100 SigninManager* manager = 100 SigninManager* manager =
101 static_cast<SigninManager*>(GetServiceForBrowserState(context, false)); 101 static_cast<SigninManager*>(GetServiceForBrowserState(context, false));
102 if (manager) 102 if (manager)
103 FOR_EACH_OBSERVER(SigninManagerFactoryObserver, observer_list_, 103 FOR_EACH_OBSERVER(SigninManagerFactoryObserver, observer_list_,
104 SigninManagerShutdown(manager)); 104 SigninManagerShutdown(manager));
105 BrowserStateKeyedServiceFactory::BrowserStateShutdown(context); 105 BrowserStateKeyedServiceFactory::BrowserStateShutdown(context);
106 } 106 }
107 107
108 } // namespace ios 108 } // namespace ios
OLDNEW
« no previous file with comments | « ios/chrome/browser/signin/signin_manager_factory.h ('k') | ios/chrome/browser/snapshots/lru_cache.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698