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

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

Issue 2297573002: Implement gnome-keyring for OSCrypt (Closed)
Patch Set: removed thread checker Created 4 years, 3 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 | « components/os_crypt/BUILD.gn ('k') | components/os_crypt/key_storage_keyring.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_OS_CRYPT_KEY_STORAGE_KEYRING_H_
6 #define COMPONENTS_OS_CRYPT_KEY_STORAGE_KEYRING_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "components/os_crypt/key_storage_linux.h"
12
13 namespace base {
14 class SingleThreadTaskRunner;
15 class WaitableEvent;
16 } // namespace base
17
18 // Specialisation of KeyStorageLinux that uses Libsecret.
19 class KeyStorageKeyring : public KeyStorageLinux {
20 public:
21 explicit KeyStorageKeyring(
22 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner);
23 ~KeyStorageKeyring() override;
24
25 // KeyStorageLinux
26 std::string GetKey() override;
27
28 protected:
29 // KeyStorageLinux
30 bool Init() override;
31
32 private:
33 // Gnome keyring requires calls to originate from the main thread.
34 // This is the part of GetKey() that gets dispatched to the main thread.
35 // The password is stored in |password_ptr|. If |password_loaded_ptr| is not
36 // null, it will be signaled when |password_ptr| is safe to read.
37 void GetKeyDelegate(std::string* password_ptr,
38 base::WaitableEvent* password_loaded_ptr);
39
40 // Generate a random string and store it as OScrypt's new password.
41 std::string AddRandomPasswordInKeyring();
42
43 // Keyring calls need to originate from the main thread.
44 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner_;
45
46 DISALLOW_COPY_AND_ASSIGN(KeyStorageKeyring);
47 };
48
49 #endif // COMPONENTS_OS_CRYPT_KEY_STORAGE_KEYRING_H_
OLDNEW
« no previous file with comments | « components/os_crypt/BUILD.gn ('k') | components/os_crypt/key_storage_keyring.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698