OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/os_crypt/key_storage_linux.h" | 5 #include "components/os_crypt/key_storage_linux.h" |
6 | 6 |
7 #include "base/environment.h" | 7 #include "base/environment.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/nix/xdg_util.h" | 10 #include "base/nix/xdg_util.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 namespace { | 32 namespace { |
33 | 33 |
34 // Parameters to OSCrypt, which are set before the first call to OSCrypt, are | 34 // Parameters to OSCrypt, which are set before the first call to OSCrypt, are |
35 // stored here. | 35 // stored here. |
36 struct Configuration { | 36 struct Configuration { |
37 std::string store; | 37 std::string store; |
38 std::string product_name; | 38 std::string product_name; |
39 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner; | 39 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner; |
40 }; | 40 }; |
41 | 41 |
42 base::LazyInstance<Configuration> g_config = LAZY_INSTANCE_INITIALIZER; | 42 base::LazyInstance<Configuration>::DestructorAtExit g_config = |
| 43 LAZY_INSTANCE_INITIALIZER; |
43 | 44 |
44 } // namespace | 45 } // namespace |
45 | 46 |
46 // static | 47 // static |
47 void KeyStorageLinux::SetStore(const std::string& store_type) { | 48 void KeyStorageLinux::SetStore(const std::string& store_type) { |
48 g_config.Get().store = store_type; | 49 g_config.Get().store = store_type; |
49 VLOG(1) << "OSCrypt store set to " << store_type; | 50 VLOG(1) << "OSCrypt store set to " << store_type; |
50 } | 51 } |
51 | 52 |
52 // static | 53 // static |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 113 } |
113 } | 114 } |
114 #endif // defined(USE_KWALLET) | 115 #endif // defined(USE_KWALLET) |
115 #endif // defined(USE_LIBSECRET) || defined(USE_KEYRING) || | 116 #endif // defined(USE_LIBSECRET) || defined(USE_KEYRING) || |
116 // defined(USE_KWALLET) | 117 // defined(USE_KWALLET) |
117 | 118 |
118 // The appropriate store was not available. | 119 // The appropriate store was not available. |
119 VLOG(1) << "OSCrypt could not initialize a backend."; | 120 VLOG(1) << "OSCrypt could not initialize a backend."; |
120 return nullptr; | 121 return nullptr; |
121 } | 122 } |
OLD | NEW |