Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/autofill/core/browser/webdata/autofill_entry.h" | 5 #include "components/autofill/core/browser/webdata/autofill_entry.h" |
| 6 | 6 |
| 7 #include <tuple> | 7 #include <tuple> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 AutofillKey::~AutofillKey() {} | 31 AutofillKey::~AutofillKey() {} |
| 32 | 32 |
| 33 bool AutofillKey::operator==(const AutofillKey& key) const { | 33 bool AutofillKey::operator==(const AutofillKey& key) const { |
| 34 return name_ == key.name() && value_ == key.value(); | 34 return name_ == key.name() && value_ == key.value(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool AutofillKey::operator<(const AutofillKey& key) const { | 37 bool AutofillKey::operator<(const AutofillKey& key) const { |
| 38 return std::tie(name_, value_) < std::tie(key.name(), key.value()); | 38 return std::tie(name_, value_) < std::tie(key.name(), key.value()); |
| 39 } | 39 } |
| 40 | 40 |
| 41 AutofillEntry::AutofillEntry() {} | |
| 42 | |
| 41 AutofillEntry::AutofillEntry(const AutofillKey& key, | 43 AutofillEntry::AutofillEntry(const AutofillKey& key, |
| 42 const base::Time& date_created, | 44 const base::Time& date_created, |
| 43 const base::Time& date_last_used) | 45 const base::Time& date_last_used) |
| 44 : key_(key), | 46 : key_(key), |
| 45 date_created_(date_created), | 47 date_created_(date_created), |
| 46 date_last_used_(date_last_used) {} | 48 date_last_used_(date_last_used) {} |
| 47 | 49 |
| 48 AutofillEntry::~AutofillEntry() {} | 50 AutofillEntry::~AutofillEntry() {} |
| 49 | 51 |
| 50 bool AutofillEntry::operator==(const AutofillEntry& entry) const { | 52 bool AutofillEntry::operator==(const AutofillEntry& entry) const { |
| 51 return key() == entry.key() && | 53 return key() == entry.key() && |
| 52 date_created() == entry.date_created() && | 54 date_created() == entry.date_created() && |
| 53 date_last_used() == entry.date_last_used(); | 55 date_last_used() == entry.date_last_used(); |
| 54 } | 56 } |
| 55 | 57 |
| 58 bool AutofillEntry::operator!=(const AutofillEntry& entry) const { | |
|
maxbogue
2017/01/12 00:15:17
How does this not come with operator==...? Oh C++.
skym
2017/01/12 17:44:00
Acknowledged.
| |
| 59 return !(*this == entry); | |
| 60 } | |
| 61 | |
| 56 bool AutofillEntry::operator<(const AutofillEntry& entry) const { | 62 bool AutofillEntry::operator<(const AutofillEntry& entry) const { |
| 57 return key_ < entry.key(); | 63 return key_ < entry.key(); |
| 58 } | 64 } |
| 59 | 65 |
| 60 } // namespace autofill | 66 } // namespace autofill |
| OLD | NEW |