diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 17:28:43 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 17:28:43 +0000 |
commit | 38e0898607eea03649b7b07e9cf890af7dc33ac7 (patch) | |
tree | 6ac95fd496661a6e0718c349bba089144e0fef09 /chrome/browser/webdata | |
parent | 2a9662e31f18f77b856487b7266c70ccede557e0 (diff) | |
download | chromium_src-38e0898607eea03649b7b07e9cf890af7dc33ac7.zip chromium_src-38e0898607eea03649b7b07e9cf890af7dc33ac7.tar.gz chromium_src-38e0898607eea03649b7b07e9cf890af7dc33ac7.tar.bz2 |
FBTF: More dtor deinlining. (Can almost see the end!)
BUG=none
TEST=compiles
Review URL: http://codereview.chromium.org/3962004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63527 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata')
-rw-r--r-- | chrome/browser/webdata/autofill_change.cc | 36 | ||||
-rw-r--r-- | chrome/browser/webdata/autofill_change.h | 22 | ||||
-rw-r--r-- | chrome/browser/webdata/autofill_entry.cc | 28 | ||||
-rw-r--r-- | chrome/browser/webdata/autofill_entry.h | 23 |
4 files changed, 78 insertions, 31 deletions
diff --git a/chrome/browser/webdata/autofill_change.cc b/chrome/browser/webdata/autofill_change.cc new file mode 100644 index 0000000..7d51c0e --- /dev/null +++ b/chrome/browser/webdata/autofill_change.cc @@ -0,0 +1,36 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/webdata/autofill_change.h" + +AutofillProfileChange::AutofillProfileChange(Type t, + string16 k, + const AutoFillProfile* p, + const string16& pre_update_label) + : GenericAutofillChange<string16>(t, k), + profile_(p), + pre_update_label_(pre_update_label) { +} + +AutofillProfileChange::~AutofillProfileChange() {} + +bool AutofillProfileChange::operator==( + const AutofillProfileChange& change) const { + if (type() != change.type() || key() != change.key()) + return false; + if (type() == REMOVE) + return true; + // TODO(dhollowa): Replace with |AutoFillProfile::Compare|. + // http://crbug.com/58813 + if (*profile() != *change.profile()) + return false; + return type() == ADD || pre_update_label_ == change.pre_update_label(); +} + +AutofillCreditCardChange::AutofillCreditCardChange(Type t, + string16 k, + const CreditCard* card) + : GenericAutofillChange<string16>(t, k), credit_card_(card) {} + +AutofillCreditCardChange::~AutofillCreditCardChange() {} diff --git a/chrome/browser/webdata/autofill_change.h b/chrome/browser/webdata/autofill_change.h index 11723d3..73c9c79 100644 --- a/chrome/browser/webdata/autofill_change.h +++ b/chrome/browser/webdata/autofill_change.h @@ -52,23 +52,13 @@ class AutofillProfileChange : public GenericAutofillChange<string16> { // If t == REMOVE, |p| should be NULL. |pre_update_label| only applies to // UPDATE changes. AutofillProfileChange(Type t, string16 k, const AutoFillProfile* p, - const string16& pre_update_label) - : GenericAutofillChange<string16>(t, k), profile_(p), - pre_update_label_(pre_update_label) {} + const string16& pre_update_label); + virtual ~AutofillProfileChange(); const AutoFillProfile* profile() const { return profile_; } const string16& pre_update_label() const { return pre_update_label_; } - bool operator==(const AutofillProfileChange& change) const { - if (type() != change.type() || key() != change.key()) - return false; - if (type() == REMOVE) - return true; - // TODO(dhollowa): Replace with |AutoFillProfile::Compare|. - // http://crbug.com/58813 - if (*profile() != *change.profile()) - return false; - return type() == ADD || pre_update_label_ == change.pre_update_label(); - } + bool operator==(const AutofillProfileChange& change) const; + private: const AutoFillProfile* profile_; // Unowned pointer, can be NULL. const string16 pre_update_label_; @@ -77,8 +67,8 @@ class AutofillProfileChange : public GenericAutofillChange<string16> { class AutofillCreditCardChange : public GenericAutofillChange<string16> { public: // If t == REMOVE, |card| should be NULL. - AutofillCreditCardChange(Type t, string16 k, const CreditCard* card) - : GenericAutofillChange<string16>(t, k), credit_card_(card) {} + AutofillCreditCardChange(Type t, string16 k, const CreditCard* card); + virtual ~AutofillCreditCardChange(); const CreditCard* credit_card() const { return credit_card_; } bool operator==(const AutofillCreditCardChange& change) const { diff --git a/chrome/browser/webdata/autofill_entry.cc b/chrome/browser/webdata/autofill_entry.cc index d0f8913..31bc406 100644 --- a/chrome/browser/webdata/autofill_entry.cc +++ b/chrome/browser/webdata/autofill_entry.cc @@ -4,6 +4,26 @@ #include <set> #include "chrome/browser/webdata/autofill_entry.h" +#include "base/utf_string_conversions.h" + +AutofillKey::AutofillKey() {} + +AutofillKey::AutofillKey(const string16& name, const string16& value) + : name_(name), + value_(value) { +} + +AutofillKey::AutofillKey(const char* name, const char* value) + : name_(UTF8ToUTF16(name)), + value_(UTF8ToUTF16(value)) { +} + +AutofillKey::AutofillKey(const AutofillKey& key) + : name_(key.name()), + value_(key.value()) { +} + +AutofillKey::~AutofillKey() {} bool AutofillKey::operator==(const AutofillKey& key) const { return name_ == key.name() && value_ == key.value(); @@ -20,6 +40,14 @@ bool AutofillKey::operator<(const AutofillKey& key) const { } } +AutofillEntry::AutofillEntry(const AutofillKey& key, + const std::vector<base::Time>& timestamps) + : key_(key), + timestamps_(timestamps) { +} + +AutofillEntry::~AutofillEntry() {} + bool AutofillEntry::operator==(const AutofillEntry& entry) const { if (!(key_ == entry.key())) return false; diff --git a/chrome/browser/webdata/autofill_entry.h b/chrome/browser/webdata/autofill_entry.h index 4917b29..7aa9139 100644 --- a/chrome/browser/webdata/autofill_entry.h +++ b/chrome/browser/webdata/autofill_entry.h @@ -9,21 +9,15 @@ #include <vector> #include "base/string16.h" #include "base/time.h" -#include "base/utf_string_conversions.h" class AutofillKey { public: - AutofillKey() {} - AutofillKey(const string16& name, const string16& value) - : name_(name), - value_(value) {} - AutofillKey(const char* name, const char* value) - : name_(UTF8ToUTF16(name)), - value_(UTF8ToUTF16(value)) {} - AutofillKey(const AutofillKey& key) - : name_(key.name()), - value_(key.value()) {} - virtual ~AutofillKey() {} + AutofillKey(); + AutofillKey(const string16& name, const string16& value); + AutofillKey(const char* name, const char* value); + AutofillKey(const AutofillKey& key); + virtual ~AutofillKey(); + const string16& name() const { return name_; } const string16& value() const { return value_; } @@ -38,9 +32,8 @@ class AutofillKey { class AutofillEntry { public: AutofillEntry(const AutofillKey& key, - const std::vector<base::Time>& timestamps) - : key_(key), - timestamps_(timestamps) {} + const std::vector<base::Time>& timestamps); + ~AutofillEntry(); const AutofillKey& key() const { return key_; } const std::vector<base::Time>& timestamps() const { return timestamps_; } |