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

Side by Side Diff: chrome/browser/extensions/api/identity/identity_api.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/identity/identity_api.h" 5 #include "chrome/browser/extensions/api/identity/identity_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 return account_tracker_.FindAccountIdsByGaiaId(gaia_id).account_key; 177 return account_tracker_.FindAccountIdsByGaiaId(gaia_id).account_key;
178 } 178 }
179 179
180 void IdentityAPI::Shutdown() { 180 void IdentityAPI::Shutdown() {
181 if (get_auth_token_function_) 181 if (get_auth_token_function_)
182 get_auth_token_function_->Shutdown(); 182 get_auth_token_function_->Shutdown();
183 account_tracker_.RemoveObserver(this); 183 account_tracker_.RemoveObserver(this);
184 account_tracker_.Shutdown(); 184 account_tracker_.Shutdown();
185 } 185 }
186 186
187 static base::LazyInstance<BrowserContextKeyedAPIFactory<IdentityAPI> > 187 static base::LazyInstance<
188 g_factory = LAZY_INSTANCE_INITIALIZER; 188 BrowserContextKeyedAPIFactory<IdentityAPI>>::DestructorAtExit g_factory =
189 LAZY_INSTANCE_INITIALIZER;
189 190
190 // static 191 // static
191 BrowserContextKeyedAPIFactory<IdentityAPI>* IdentityAPI::GetFactoryInstance() { 192 BrowserContextKeyedAPIFactory<IdentityAPI>* IdentityAPI::GetFactoryInstance() {
192 return g_factory.Pointer(); 193 return g_factory.Pointer();
193 } 194 }
194 195
195 void IdentityAPI::OnAccountAdded(const gaia::AccountIds& ids) { 196 void IdentityAPI::OnAccountAdded(const gaia::AccountIds& ids) {
196 } 197 }
197 198
198 void IdentityAPI::OnAccountRemoved(const gaia::AccountIds& ids) { 199 void IdentityAPI::OnAccountRemoved(const gaia::AccountIds& ids) {
(...skipping 19 matching lines...) Expand all
218 account_tracker_.SetAccountStateForTest(ids, is_signed_in); 219 account_tracker_.SetAccountStateForTest(ids, is_signed_in);
219 } 220 }
220 221
221 template <> 222 template <>
222 void BrowserContextKeyedAPIFactory<IdentityAPI>::DeclareFactoryDependencies() { 223 void BrowserContextKeyedAPIFactory<IdentityAPI>::DeclareFactoryDependencies() {
223 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); 224 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
224 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); 225 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
225 } 226 }
226 227
227 } // namespace extensions 228 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698