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

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.
please use gerrit instead 2017/02/22 19:05:42 no "(c)" necessary
devarajn 2017/02/22 19:24:26 Done.
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.
please use gerrit instead 2017/02/22 19:05:42 The comment should be on AutofillTableEncryptorFac
devarajn 2017/02/22 19:24:26 Done.
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;
Roger McFarlane (Chromium) 2017/02/22 19:29:50 This isn't doing what you want. It's declaring Def
devarajn 2017/02/22 22:07:59 Yeah, I realized it. This was a good catch!
20 class AutofillTableEncryptorFactory {
please use gerrit instead 2017/02/22 19:05:42 Very strange to have autofill::DefaultSingletonTra
devarajn 2017/02/22 19:24:26 removed base:: one. Done
21 public:
22 // Embedders are recommended to use this delegate to inject
23 // their encryptor into Autofill table.
24 class Delegate {
please use gerrit instead 2017/02/22 19:05:42 Need a virtual empty destructor.
devarajn 2017/02/22 19:24:26 I am not sure how I missed this. Done
25 public:
26 virtual std::unique_ptr<AutofillTableEncryptor> Create();
please use gerrit instead 2017/02/22 19:05:42 = 0;
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();
37 ~AutofillTableEncryptorFactory() {}
Roger McFarlane (Chromium) 2017/02/22 18:32:56 move the implementation to the cc file.
devarajn 2017/02/22 18:56:58 Yup I am on it, just saw below link https://www.ch
Roger McFarlane (Chromium) 2017/02/22 19:59:44 # after git cl upload git cl try I think you nee
38
39 std::unique_ptr<Delegate> delegate_;
40 base::SequenceChecker sequence_checker_;
41
42 friend struct base::DefaultSingletonTraits<AutofillTableEncryptorFactory>;
43 DISALLOW_COPY_AND_ASSIGN(AutofillTableEncryptorFactory);
44 };
45
46 } // namespace autofill
47
48 #endif // COMPONENTS_WEBDATA_SERVICES_AUTOFILL_TABLE_ENCRYPTOR_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698