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

Unified Diff: components/autofill/core/browser/credit_card_field_unittest.cc

Issue 1859453002: components/autofill: scoped_ptr -> unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 4 years, 8 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/credit_card_field_unittest.cc
diff --git a/components/autofill/core/browser/credit_card_field_unittest.cc b/components/autofill/core/browser/credit_card_field_unittest.cc
index 8b4b8380e285a7d2bda2d70986df4ebee6a47847..609ff17597895337512974984c889702fddfad83 100644
--- a/components/autofill/core/browser/credit_card_field_unittest.cc
+++ b/components/autofill/core/browser/credit_card_field_unittest.cc
@@ -2,13 +2,16 @@
// 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/credit_card_field.h"
+
+#include <memory>
+
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/scoped_vector.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/autofill_scanner.h"
-#include "components/autofill/core/browser/credit_card_field.h"
#include "components/autofill/core/common/form_field_data.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -23,24 +26,24 @@ class CreditCardFieldTest : public testing::Test {
protected:
ScopedVector<AutofillField> list_;
- scoped_ptr<const CreditCardField> field_;
+ std::unique_ptr<const CreditCardField> field_;
FieldCandidatesMap field_candidates_map_;
// Parses the contents of |list_| as a form, and stores the result into
// |field_|.
void Parse() {
AutofillScanner scanner(list_.get());
- scoped_ptr<FormField> field = CreditCardField::Parse(&scanner);
- field_ = make_scoped_ptr(static_cast<CreditCardField*>(field.release()));
+ std::unique_ptr<FormField> field = CreditCardField::Parse(&scanner);
+ field_ = base::WrapUnique(static_cast<CreditCardField*>(field.release()));
}
void MultipleParses() {
- scoped_ptr<FormField> field;
+ std::unique_ptr<FormField> field;
AutofillScanner scanner(list_.get());
while (!scanner.IsEnd()) {
field = CreditCardField::Parse(&scanner);
- field_ = make_scoped_ptr(static_cast<CreditCardField*>(field.release()));
+ field_ = base::WrapUnique(static_cast<CreditCardField*>(field.release()));
if (field_ == nullptr) {
scanner.Advance();
} else {
« no previous file with comments | « components/autofill/core/browser/credit_card_field.cc ('k') | components/autofill/core/browser/crypto/rc4_decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698