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

Side by Side Diff: components/autofill/core/common/password_form.cc

Issue 1636813003: Remove checks for a crasher in PasswordForm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « components/autofill/core/common/password_form.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 new_password_marked_by_site(false), 76 new_password_marked_by_site(false),
77 ssl_valid(false), 77 ssl_valid(false),
78 preferred(false), 78 preferred(false),
79 blacklisted_by_user(false), 79 blacklisted_by_user(false),
80 type(TYPE_MANUAL), 80 type(TYPE_MANUAL),
81 times_used(0), 81 times_used(0),
82 generation_upload_status(NO_SIGNAL_SENT), 82 generation_upload_status(NO_SIGNAL_SENT),
83 skip_zero_click(false), 83 skip_zero_click(false),
84 layout(Layout::LAYOUT_OTHER), 84 layout(Layout::LAYOUT_OTHER),
85 was_parsed_using_autofill_predictions(false), 85 was_parsed_using_autofill_predictions(false),
86 is_alive(true),
87 is_public_suffix_match(false), 86 is_public_suffix_match(false),
88 is_affiliation_based_match(false) {} 87 is_affiliation_based_match(false) {}
89 88
90 PasswordForm::~PasswordForm() { 89 PasswordForm::~PasswordForm() {
91 CHECK(is_alive);
92 is_alive = false;
93 } 90 }
94 91
95 bool PasswordForm::IsPossibleChangePasswordForm() const { 92 bool PasswordForm::IsPossibleChangePasswordForm() const {
96 return !new_password_element.empty() && 93 return !new_password_element.empty() &&
97 layout != PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP; 94 layout != PasswordForm::Layout::LAYOUT_LOGIN_AND_SIGNUP;
98 } 95 }
99 96
100 bool PasswordForm::IsPossibleChangePasswordFormWithoutUsername() const { 97 bool PasswordForm::IsPossibleChangePasswordFormWithoutUsername() const {
101 return IsPossibleChangePasswordForm() && username_element.empty(); 98 return IsPossibleChangePasswordForm() && username_element.empty();
102 } 99 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string); 194 form_json, base::JSONWriter::OPTIONS_PRETTY_PRINT, &form_as_string);
198 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string); 195 base::TrimWhitespaceASCII(form_as_string, base::TRIM_ALL, &form_as_string);
199 return os << "PasswordForm(" << form_as_string << ")"; 196 return os << "PasswordForm(" << form_as_string << ")";
200 } 197 }
201 198
202 std::ostream& operator<<(std::ostream& os, PasswordForm* form) { 199 std::ostream& operator<<(std::ostream& os, PasswordForm* form) {
203 return os << "&" << *form; 200 return os << "&" << *form;
204 } 201 }
205 202
206 } // namespace autofill 203 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/common/password_form.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698