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

Side by Side Diff: components/autofill/core/browser/webdata/autofill_table_encryptor_factory.h

Issue 2698103002: Allow embedder to use custom cryptography in Autofill table. (Closed)
Patch Set: Allow embedder to use custom cryptography in Autofill table. Created 3 years, 9 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
OLDNEW
(Empty)
1 // Copyright 2017 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_WEBDATA_SERVICES_AUTOFILL_TABLE_ENCRYPTOR_FACTORY_H_
6 #define COMPONENTS_WEBDATA_SERVICES_AUTOFILL_TABLE_ENCRYPTOR_FACTORY_H_
Roger McFarlane (Chromium) 2017/02/24 03:00:13 Sorry I didn't see this before (and I'm surprised
devarajn 2017/02/24 03:09:40 Good catch!. Done. Will post a new revision in a m
7
8 #include <memory>
9
10 #include "base/sequence_checker.h"
11
12 namespace base {
13 template <typename T>
14 struct DefaultSingletonTraits;
15 } // namespace base
16
17 namespace autofill {
18
19 class AutofillTableEncryptor;
20
21 // Factory for creating Autofill table encryptor.
22 // If |delegate_| is set, then |delegate_| is used to create encryptor,
23 // else default encrytor (SystemEncryptor) is returned.
24 class AutofillTableEncryptorFactory {
25 public:
26 // Embedders are recommended to use this delegate to inject
27 // their encryptor into Autofill table.
28 class Delegate {
29 public:
30 virtual ~Delegate() = default;
31
32 virtual std::unique_ptr<AutofillTableEncryptor> Create() = 0;
33 };
34
35 static AutofillTableEncryptorFactory* GetInstance();
36
37 std::unique_ptr<AutofillTableEncryptor> Create();
38
39 void SetDelegate(std::unique_ptr<Delegate> delegate);
40
41 private:
42 AutofillTableEncryptorFactory();
43 ~AutofillTableEncryptorFactory();
44
45 std::unique_ptr<Delegate> delegate_;
46 base::SequenceChecker sequence_checker_;
47
48 friend struct base::DefaultSingletonTraits<AutofillTableEncryptorFactory>;
49 DISALLOW_COPY_AND_ASSIGN(AutofillTableEncryptorFactory);
50 };
51
52 } // namespace autofill
53
54 #endif // COMPONENTS_WEBDATA_SERVICES_AUTOFILL_TABLE_ENCRYPTOR_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698