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

Side by Side Diff: crypto/scoped_test_nss_chromeos_user.cc

Issue 401623006: Extract ScopedTestNSSDB from nss_util. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed function call that was missed during renaming. Created 6 years, 5 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
(Empty)
1 // Copyright 2014 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 "crypto/scoped_test_nss_chromeos_user.h"
6
7 #include "base/logging.h"
8 #include "crypto/nss_util.h"
9 #include "crypto/nss_util_internal.h"
10 #include "crypto/scoped_test_nss_db.h"
11
12 namespace crypto {
13
14 ScopedTestNSSChromeOSUser::ScopedTestNSSChromeOSUser(
15 const std::string& username_hash)
16 : username_hash_(username_hash), constructed_successfully_(false) {
17 if (!temp_dir_.CreateUniqueTempDir())
18 return;
19 // This opens a software DB in the given folder. In production code that is in
20 // the home folder, but for testing the temp folder is used.
21 constructed_successfully_ = InitializeNSSForChromeOSUser(
22 username_hash, username_hash, temp_dir_.path());
23 }
24
25 ScopedTestNSSChromeOSUser::~ScopedTestNSSChromeOSUser() {
26 if (constructed_successfully_)
27 CloseChromeOSUserForTesting(username_hash_);
28 }
29
30 void ScopedTestNSSChromeOSUser::FinishInit() {
31 DCHECK(constructed_successfully_);
32 if (!ShouldInitializeTPMForChromeOSUser(username_hash_))
33 return;
34 WillInitializeTPMForChromeOSUser(username_hash_);
35 InitializePrivateSoftwareSlotForChromeOSUser(username_hash_);
36 }
37
38 } // namespace crypto
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698