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 <ostream> | 5 #include <ostream> |
6 #include <sstream> | 6 #include <sstream> |
7 | 7 |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 password_autocomplete_set(true), | 69 password_autocomplete_set(true), |
70 new_password_marked_by_site(false), | 70 new_password_marked_by_site(false), |
71 ssl_valid(false), | 71 ssl_valid(false), |
72 preferred(false), | 72 preferred(false), |
73 blacklisted_by_user(false), | 73 blacklisted_by_user(false), |
74 type(TYPE_MANUAL), | 74 type(TYPE_MANUAL), |
75 times_used(0), | 75 times_used(0), |
76 generation_upload_status(NO_SIGNAL_SENT), | 76 generation_upload_status(NO_SIGNAL_SENT), |
77 skip_zero_click(false), | 77 skip_zero_click(false), |
78 layout(Layout::LAYOUT_OTHER), | 78 layout(Layout::LAYOUT_OTHER), |
79 was_parsed_using_autofill_predictions(false) { | 79 was_parsed_using_autofill_predictions(false), |
| 80 is_alive(true) { |
80 } | 81 } |
81 | 82 |
82 PasswordForm::~PasswordForm() { | 83 PasswordForm::~PasswordForm() { |
| 84 CHECK(is_alive); |
| 85 is_alive = false; |
83 } | 86 } |
84 | 87 |
85 bool PasswordForm::IsPublicSuffixMatch() const { | 88 bool PasswordForm::IsPublicSuffixMatch() const { |
| 89 CHECK(is_alive); |
86 return !original_signon_realm.empty(); | 90 return !original_signon_realm.empty(); |
87 } | 91 } |
88 | 92 |
89 bool PasswordForm::operator==(const PasswordForm& form) const { | 93 bool PasswordForm::operator==(const PasswordForm& form) const { |
90 return scheme == form.scheme && | 94 return scheme == form.scheme && |
91 signon_realm == form.signon_realm && | 95 signon_realm == form.signon_realm && |
92 original_signon_realm == form.original_signon_realm && | 96 original_signon_realm == form.original_signon_realm && |
93 origin == form.origin && | 97 origin == form.origin && |
94 action == form.action && | 98 action == form.action && |
95 submit_element == form.submit_element && | 99 submit_element == form.submit_element && |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 &form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); | 163 &form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); |
160 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); | 164 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); |
161 return os << "PasswordForm(" << form_as_string << ")"; | 165 return os << "PasswordForm(" << form_as_string << ")"; |
162 } | 166 } |
163 | 167 |
164 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { | 168 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { |
165 return os << "&" << *form; | 169 return os << "&" << *form; |
166 } | 170 } |
167 | 171 |
168 } // namespace autofill | 172 } // namespace autofill |
OLD | NEW |