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

Side by Side Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 1960023002: Destroy (Password)AutofillAgent safely (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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
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 "components/autofill/content/renderer/password_autofill_agent.h" 5 #include "components/autofill/content/renderer/password_autofill_agent.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 // RenderView to be instantiated (such as redirects to the WebStore) 1217 // RenderView to be instantiated (such as redirects to the WebStore)
1218 // we will never get to finish the load. 1218 // we will never get to finish the load.
1219 Send(new AutofillHostMsg_PasswordFormSubmitted(routing_id(), 1219 Send(new AutofillHostMsg_PasswordFormSubmitted(routing_id(),
1220 *submitted_form)); 1220 *submitted_form));
1221 provisionally_saved_form_.reset(); 1221 provisionally_saved_form_.reset();
1222 } else if (logger) { 1222 } else if (logger) {
1223 logger->LogMessage(Logger::STRING_FORM_IS_NOT_PASSWORD); 1223 logger->LogMessage(Logger::STRING_FORM_IS_NOT_PASSWORD);
1224 } 1224 }
1225 } 1225 }
1226 1226
1227 void PasswordAutofillAgent::OnDestruct() {
1228 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
1229 }
1230
1227 void PasswordAutofillAgent::DidStartProvisionalLoad() { 1231 void PasswordAutofillAgent::DidStartProvisionalLoad() {
1228 std::unique_ptr<RendererSavePasswordProgressLogger> logger; 1232 std::unique_ptr<RendererSavePasswordProgressLogger> logger;
1229 if (logging_state_active_) { 1233 if (logging_state_active_) {
1230 logger.reset(new RendererSavePasswordProgressLogger(this, routing_id())); 1234 logger.reset(new RendererSavePasswordProgressLogger(this, routing_id()));
1231 logger->LogMessage(Logger::STRING_DID_START_PROVISIONAL_LOAD_METHOD); 1235 logger->LogMessage(Logger::STRING_DID_START_PROVISIONAL_LOAD_METHOD);
1232 } 1236 }
1233 1237
1234 const blink::WebLocalFrame* navigated_frame = render_frame()->GetWebFrame(); 1238 const blink::WebLocalFrame* navigated_frame = render_frame()->GetWebFrame();
1235 if (navigated_frame->parent()) { 1239 if (navigated_frame->parent()) {
1236 if (logger) 1240 if (logger)
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 } 1505 }
1502 1506
1503 bool PasswordAutofillAgent::ProvisionallySavedPasswordIsValid() { 1507 bool PasswordAutofillAgent::ProvisionallySavedPasswordIsValid() {
1504 return provisionally_saved_form_ && 1508 return provisionally_saved_form_ &&
1505 !provisionally_saved_form_->username_value.empty() && 1509 !provisionally_saved_form_->username_value.empty() &&
1506 !(provisionally_saved_form_->password_value.empty() && 1510 !(provisionally_saved_form_->password_value.empty() &&
1507 provisionally_saved_form_->new_password_value.empty()); 1511 provisionally_saved_form_->new_password_value.empty());
1508 } 1512 }
1509 1513
1510 } // namespace autofill 1514 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698