Chromium Code Reviews| Index: components/autofill/core/browser/webdata/autofill_table_encryptor_factory.h |
| diff --git a/components/autofill/core/browser/webdata/autofill_table_encryptor_factory.h b/components/autofill/core/browser/webdata/autofill_table_encryptor_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..99bd08d11cb927b2b7f6c4d8e618106dfb32fa83 |
| --- /dev/null |
| +++ b/components/autofill/core/browser/webdata/autofill_table_encryptor_factory.h |
| @@ -0,0 +1,48 @@ |
| +// 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.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_WEBDATA_SERVICES_AUTOFILL_TABLE_ENCRYPTOR_FACTORY_H_ |
| +#define COMPONENTS_WEBDATA_SERVICES_AUTOFILL_TABLE_ENCRYPTOR_FACTORY_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/memory/singleton.h" |
| +#include "base/sequence_checker.h" |
| +#include "components/autofill/core/browser/webdata/autofill_table_encryptor.h" |
| + |
| +namespace autofill { |
| +// 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.
|
| +// If |delegate_| is set, then |delegate_| is used to create encryptor, |
| +// else default encrytor (SystemEncryptor) is returned. |
| +template <typename T> |
| +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!
|
| +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
|
| + public: |
| + // Embedders are recommended to use this delegate to inject |
| + // their encryptor into Autofill table. |
| + 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
|
| + public: |
| + virtual std::unique_ptr<AutofillTableEncryptor> Create(); |
|
please use gerrit instead
2017/02/22 19:05:42
= 0;
|
| + }; |
| + |
| + static AutofillTableEncryptorFactory* GetInstance(); |
| + |
| + std::unique_ptr<AutofillTableEncryptor> Create(); |
| + |
| + void SetDelegate(std::unique_ptr<Delegate> delegate); |
| + |
| + private: |
| + AutofillTableEncryptorFactory(); |
| + ~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
|
| + |
| + std::unique_ptr<Delegate> delegate_; |
| + base::SequenceChecker sequence_checker_; |
| + |
| + friend struct base::DefaultSingletonTraits<AutofillTableEncryptorFactory>; |
| + DISALLOW_COPY_AND_ASSIGN(AutofillTableEncryptorFactory); |
| +}; |
| + |
| +} // namespace autofill |
| + |
| +#endif // COMPONENTS_WEBDATA_SERVICES_AUTOFILL_TABLE_ENCRYPTOR_FACTORY_H_ |