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

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, 10 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 (c) 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_
7
8 #include <memory>
9
10 #include "base/memory/singleton.h"
11 #include "base/sequence_checker.h"
12 #include "components/autofill/core/browser/webdata/autofill_table_encryptor.h"
13
14 namespace autofill {
15 // Factory for creating Autofill table encryptor.
16 // If |delegate_| is set, then |delegate_| is used to create encryptor,
17 // else default encrytor (SystemEncryptor) is returned.
18 template <typename T>
19 struct DefaultSingletonTraits;
20 class AutofillTableEncryptorFactory {
21 public:
22 // Embedders are recommended to use this delegate to inject
23 // their encryptor into Autofill table.
24 class Delegate {
25 public:
26 virtual std::unique_ptr<AutofillTableEncryptor> Create();
27 };
28
29 static AutofillTableEncryptorFactory* GetInstance();
30
31 std::unique_ptr<AutofillTableEncryptor> Create();
32
33 void SetDelegate(std::unique_ptr<Delegate> delegate);
34
35 private:
36 AutofillTableEncryptorFactory();
Roger McFarlane (Chromium) 2017/02/22 18:01:27 you need an explicitly public out-of-line destruct
devarajn 2017/02/22 18:13:56 Sorry, I could not understand properly. Do you mea
Roger McFarlane (Chromium) 2017/02/22 18:32:56 Check the compilation/lint failures of the try bot
devarajn 2017/02/22 18:56:58 Acknowledged.
37 std::unique_ptr<Delegate> delegate_;
38 base::SequenceChecker sequence_checker_;
39
40 friend struct base::DefaultSingletonTraits<AutofillTableEncryptorFactory>;
41 DISALLOW_COPY_AND_ASSIGN(AutofillTableEncryptorFactory);
42 };
43
44 } // namespace autofill
45
46 #endif // COMPONENTS_WEBDATA_SERVICES_AUTOFILL_TABLE_ENCRYPTOR_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698