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

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

Issue 380533003: Flush form cache when next document is loaded to avoid Document leak. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseline Created 6 years, 5 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 | Annotate | Revision Log
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/autofill_agent.h" 5 #include "components/autofill/content/renderer/autofill_agent.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 174 }
175 175
176 void AutofillAgent::DidFinishDocumentLoad(WebLocalFrame* frame) { 176 void AutofillAgent::DidFinishDocumentLoad(WebLocalFrame* frame) {
177 // If the main frame just finished loading, we should process it. 177 // If the main frame just finished loading, we should process it.
178 if (!frame->parent()) 178 if (!frame->parent())
179 main_frame_processed_ = false; 179 main_frame_processed_ = false;
180 180
181 ProcessForms(*frame); 181 ProcessForms(*frame);
182 } 182 }
183 183
184 void AutofillAgent::DidCommitProvisionalLoad(WebLocalFrame* frame,
185 bool is_new_navigation) {
186 form_cache_.ResetFrame(*frame);
187 }
188
184 void AutofillAgent::FrameDetached(WebFrame* frame) { 189 void AutofillAgent::FrameDetached(WebFrame* frame) {
185 form_cache_.ResetFrame(*frame); 190 form_cache_.ResetFrame(*frame);
186 } 191 }
187 192
188 void AutofillAgent::FrameWillClose(WebFrame* frame) { 193 void AutofillAgent::FrameWillClose(WebFrame* frame) {
189 if (in_flight_request_form_.isNull()) 194 if (in_flight_request_form_.isNull())
190 return; 195 return;
191 196
192 for (WebFrame* temp = in_flight_request_form_.document().frame(); 197 for (WebFrame* temp = in_flight_request_form_.document().frame();
193 temp; temp = temp->parent()) { 198 temp; temp = temp->parent()) {
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 // parsed form. 730 // parsed form.
726 if (frame && !frame->parent() && !frame->isLoading()) { 731 if (frame && !frame->parent() && !frame->isLoading()) {
727 ProcessForms(*frame); 732 ProcessForms(*frame);
728 password_autofill_agent_->OnDynamicFormsSeen(frame); 733 password_autofill_agent_->OnDynamicFormsSeen(frame);
729 return; 734 return;
730 } 735 }
731 } 736 }
732 } 737 }
733 738
734 } // namespace autofill 739 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698