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

Side by Side Diff: components/os_crypt/os_crypt.h

Issue 2385413003: Thread safe initialization of OSCrypt cache (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | components/os_crypt/os_crypt_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef COMPONENTS_OS_CRYPT_OS_CRYPT_H_ 5 #ifndef COMPONENTS_OS_CRYPT_OS_CRYPT_H_
6 #define COMPONENTS_OS_CRYPT_OS_CRYPT_H_ 6 #define COMPONENTS_OS_CRYPT_OS_CRYPT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 private: 70 private:
71 DISALLOW_IMPLICIT_CONSTRUCTORS(OSCrypt); 71 DISALLOW_IMPLICIT_CONSTRUCTORS(OSCrypt);
72 }; 72 };
73 73
74 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(UNIT_TEST) 74 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(UNIT_TEST)
75 // For unit testing purposes, inject methods to be used. 75 // For unit testing purposes, inject methods to be used.
76 // |get_key_storage_mock| provides the desired |KeyStorage| implementation. 76 // |get_key_storage_mock| provides the desired |KeyStorage| implementation.
77 // If the provider returns |nullptr|, a hardcoded password will be used. 77 // If the provider returns |nullptr|, a hardcoded password will be used.
78 // |get_password_v11_mock| provides a password to derive the encryption key from 78 // |get_password_v11_mock| provides a password to derive the encryption key from
79 // If both parameters are |nullptr|, the real implementation is restored. 79 // If one parameter is |nullptr|, the function will be not be replaced.
80 // If all parameters are |nullptr|, the real implementation is restored.
80 void UseMockKeyStorageForTesting(KeyStorageLinux* (*get_key_storage_mock)(), 81 void UseMockKeyStorageForTesting(KeyStorageLinux* (*get_key_storage_mock)(),
81 std::string* (*get_password_v11_mock)()); 82 std::string* (*get_password_v11_mock)());
82 #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(UNIT_TEST) 83 #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(UNIT_TEST)
83 84
84 #endif // COMPONENTS_OS_CRYPT_OS_CRYPT_H_ 85 #endif // COMPONENTS_OS_CRYPT_OS_CRYPT_H_
OLDNEW
« no previous file with comments | « no previous file | components/os_crypt/os_crypt_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698