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

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

Issue 25975002: cryptohome: Move Encrypt/DecryptWithSystemSalt() out of CryptohomeLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add GetCachedSystemSalt Created 7 years, 2 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 | Annotate | Revision Log
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/chromeos/settings/device_oauth2_token_service_factory.h " 5 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h "
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" 8 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h"
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 10
11 namespace chromeos { 11 namespace chromeos {
12 12
13 static DeviceOAuth2TokenService* g_device_oauth2_token_service_ = NULL; 13 static DeviceOAuth2TokenService* g_device_oauth2_token_service_ = NULL;
14 14
15 DeviceOAuth2TokenServiceFactory::DeviceOAuth2TokenServiceFactory() { 15 DeviceOAuth2TokenServiceFactory::DeviceOAuth2TokenServiceFactory() {
16 } 16 }
17 17
18 // static 18 // static
19 DeviceOAuth2TokenService* DeviceOAuth2TokenServiceFactory::Get() { 19 DeviceOAuth2TokenService* DeviceOAuth2TokenServiceFactory::Get() {
20 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 20 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
21 return g_device_oauth2_token_service_; 21 return g_device_oauth2_token_service_;
22 } 22 }
23 23
24 // static 24 // static
25 void DeviceOAuth2TokenServiceFactory::Initialize() { 25 void DeviceOAuth2TokenServiceFactory::Initialize() {
26 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 26 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
27 DCHECK(!g_device_oauth2_token_service_); 27 DCHECK(!g_device_oauth2_token_service_);
28 g_device_oauth2_token_service_ = new DeviceOAuth2TokenService( 28 g_device_oauth2_token_service_ = new DeviceOAuth2TokenService(
29 g_browser_process->system_request_context(), 29 g_browser_process->system_request_context(),
30 g_browser_process->local_state()); 30 g_browser_process->local_state(),
31 new CryptohomeTokenEncryptor);
31 } 32 }
32 33
33 // static 34 // static
34 void DeviceOAuth2TokenServiceFactory::Shutdown() { 35 void DeviceOAuth2TokenServiceFactory::Shutdown() {
35 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 36 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
36 if (g_device_oauth2_token_service_) { 37 if (g_device_oauth2_token_service_) {
37 delete g_device_oauth2_token_service_; 38 delete g_device_oauth2_token_service_;
38 g_device_oauth2_token_service_ = NULL; 39 g_device_oauth2_token_service_ = NULL;
39 } 40 }
40 } 41 }
41 42
42 } // namespace chromeos 43 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698