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

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

Issue 112203003: Fix renderer crashes when frame gets detached while injectng user scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Defer frame destruction until event loop. Created 6 years, 10 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 } 352 }
353 353
354 void PasswordAutofillAgent::OnDynamicFormsSeen(blink::WebFrame* frame) { 354 void PasswordAutofillAgent::OnDynamicFormsSeen(blink::WebFrame* frame) {
355 SendPasswordForms(frame, false /* only_visible */); 355 SendPasswordForms(frame, false /* only_visible */);
356 } 356 }
357 357
358 void PasswordAutofillAgent::SendPasswordForms(blink::WebFrame* frame, 358 void PasswordAutofillAgent::SendPasswordForms(blink::WebFrame* frame,
359 bool only_visible) { 359 bool only_visible) {
360 // Make sure that this security origin is allowed to use password manager. 360 // Make sure that this security origin is allowed to use password manager.
361 blink::WebSecurityOrigin origin = frame->document().securityOrigin(); 361 blink::WebSecurityOrigin origin = frame->document().securityOrigin();
362 if (!OriginCanAccessPasswordManager(origin)) 362 if (origin.isNull() || !OriginCanAccessPasswordManager(origin))
363 return; 363 return;
364 364
365 // Checks whether the webpage is a redirect page or an empty page. 365 // Checks whether the webpage is a redirect page or an empty page.
366 if (IsWebpageEmpty(frame)) 366 if (IsWebpageEmpty(frame))
367 return; 367 return;
368 368
369 blink::WebVector<blink::WebFormElement> forms; 369 blink::WebVector<blink::WebFormElement> forms;
370 frame->document().forms(forms); 370 frame->document().forms(forms);
371 371
372 std::vector<PasswordForm> password_forms; 372 std::vector<PasswordForm> password_forms;
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 } 870 }
871 871
872 PasswordAutofillAgent::AutofillWebUserGestureHandler:: 872 PasswordAutofillAgent::AutofillWebUserGestureHandler::
873 AutofillWebUserGestureHandler(PasswordAutofillAgent* agent) 873 AutofillWebUserGestureHandler(PasswordAutofillAgent* agent)
874 : agent_(agent) {} 874 : agent_(agent) {}
875 875
876 PasswordAutofillAgent::AutofillWebUserGestureHandler:: 876 PasswordAutofillAgent::AutofillWebUserGestureHandler::
877 ~AutofillWebUserGestureHandler() {} 877 ~AutofillWebUserGestureHandler() {}
878 878
879 } // namespace autofill 879 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698