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

Unified Diff: components/autofill/core/browser/webdata/autofill_table_encryptor_factory.cc

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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/webdata/autofill_table_encryptor_factory.cc
diff --git a/components/autofill/core/browser/webdata/autofill_table_encryptor_factory.cc b/components/autofill/core/browser/webdata/autofill_table_encryptor_factory.cc
new file mode 100644
index 0000000000000000000000000000000000000000..aac4dbec20941220d95dc6b21fd6324daaced30a
--- /dev/null
+++ b/components/autofill/core/browser/webdata/autofill_table_encryptor_factory.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
please use gerrit instead 2017/02/22 19:05:42 no "(c)" necessary
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/autofill/core/browser/webdata/autofill_table_encryptor_factory.h"
+
+#include "base/memory/ptr_util.h"
+#include "components/autofill/core/browser/webdata/system_encryptor.h"
+
+namespace autofill {
+
+AutofillTableEncryptorFactory::AutofillTableEncryptorFactory() {}
+
+AutofillTableEncryptorFactory* AutofillTableEncryptorFactory::GetInstance() {
+ return base::Singleton<AutofillTableEncryptorFactory>::get();
+}
+
+std::unique_ptr<AutofillTableEncryptor>
+AutofillTableEncryptorFactory::Create() {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ if (delegate_)
please use gerrit instead 2017/02/22 19:05:42 Single line: return delegate_ ? delgate_->Create(
devarajn 2017/02/22 19:24:26 Done.
+ return delegate_->Create();
+
+ return base::MakeUnique<SystemEncryptor>();
+}
+
+void AutofillTableEncryptorFactory::SetDelegate(
+ std::unique_ptr<Delegate> delegate) {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ delegate_ = std::move(delegate);
+}
+
+} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698