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

Side by Side Diff: chrome/browser/chromeos/settings/device_oauth2_token_service_factory.cc

Issue 12647008: Refactor OAuth2TokenService to have profile- and device-based implementations. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Wired in new device-level encryption calls. Created 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h "
6
7 #include "base/lazy_instance.h"
8 #include "chrome/browser/browser_process.h"
9 #include "content/public/browser/browser_thread.h"
10
11 namespace chromeos {
12
13 static base::LazyInstance<DeviceOAuth2TokenServiceFactory>
14 g_device_oauth2_token_service_factory_ = LAZY_INSTANCE_INITIALIZER;
15
16 DeviceOAuth2TokenServiceFactory::DeviceOAuth2TokenServiceFactory() {
17 }
18
19 DeviceOAuth2TokenServiceFactory::~DeviceOAuth2TokenServiceFactory() {
20 // The OAuth2TokenService destructor will cancel all pending fetchers.
21 }
22
23 // static
24 DeviceOAuth2TokenService* DeviceOAuth2TokenServiceFactory::Get() {
25 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
26 DeviceOAuth2TokenServiceFactory factory =
27 g_device_oauth2_token_service_factory_.Get();
28
29 return factory.GetImpl();
30 }
31
32 DeviceOAuth2TokenService* DeviceOAuth2TokenServiceFactory::GetImpl() {
33 if (!device_oauth2_token_service_) {
34 device_oauth2_token_service_.reset(
35 new DeviceOAuth2TokenService(
36 g_browser_process->system_request_context()));
Mattias Nissler (ping if slow) 2013/03/21 06:59:15 Ha, so the factory design is broken here after all
David Roche 2013/03/21 20:36:31 The factory singleton doesn't have an external dep
37 }
38 return device_oauth2_token_service_.get();
39 }
40
41 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h ('k') | chrome/browser/history/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698