summaryrefslogtreecommitdiffstats
path: root/chrome/browser/password_manager
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-11 20:34:49 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-11 20:34:49 +0000
commitabec1ad158c85bc85855c2032311c74cd318b962 (patch)
tree61fdd7502d1095ecb3d16548895cb1683ddbe110 /chrome/browser/password_manager
parent85404ad433cc88fc597b221f3932c8a5c819e44a (diff)
downloadchromium_src-abec1ad158c85bc85855c2032311c74cd318b962.zip
chromium_src-abec1ad158c85bc85855c2032311c74cd318b962.tar.gz
chromium_src-abec1ad158c85bc85855c2032311c74cd318b962.tar.bz2
Revert 146164 - Always query for the latest RenderViewHost from WebContents before sending the NOtBlacklistedMessage, since RenderViewHost can be changed if users navigate to a different site. We have seen crashes (highly possibly) because of this (http://code.google.com/p/chromium/issues/detail?id=134191)
BUG=134191 TEST=PasswordFormManagerTest Review URL: https://chromiumcodereview.appspot.com/10704147 TBR=zysxqn@google.com Review URL: https://chromiumcodereview.appspot.com/10696177 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146192 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/password_manager')
-rw-r--r--chrome/browser/password_manager/password_form_manager.cc8
-rw-r--r--chrome/browser/password_manager/password_form_manager.h9
-rw-r--r--chrome/browser/password_manager/password_manager.cc4
3 files changed, 9 insertions, 12 deletions
diff --git a/chrome/browser/password_manager/password_form_manager.cc b/chrome/browser/password_manager/password_form_manager.cc
index 7d3b698..b9cc0bc 100644
--- a/chrome/browser/password_manager/password_form_manager.cc
+++ b/chrome/browser/password_manager/password_form_manager.cc
@@ -15,7 +15,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/autofill_messages.h"
#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents.h"
#include "webkit/forms/password_form_dom_manager.h"
using base::Time;
@@ -24,7 +23,7 @@ using webkit::forms::PasswordFormMap;
PasswordFormManager::PasswordFormManager(Profile* profile,
PasswordManager* password_manager,
- content::WebContents* web_contents,
+ content::RenderViewHost* host,
const PasswordForm& observed_form,
bool ssl_valid)
: best_matches_deleter_(&best_matches_),
@@ -36,7 +35,7 @@ PasswordFormManager::PasswordFormManager(Profile* profile,
preferred_match_(NULL),
state_(PRE_MATCHING_PHASE),
profile_(profile),
- web_contents_(web_contents),
+ host_(host),
manager_action_(kManagerActionNone),
user_action_(kUserActionNone),
submit_result_(kSubmitResultNotSubmitted) {
@@ -508,7 +507,6 @@ void PasswordFormManager::SubmitFailed() {
}
void PasswordFormManager::SendNotBlacklistedToRenderer() {
- content::RenderViewHost* host = web_contents_->GetRenderViewHost();
- host->Send(new AutofillMsg_FormNotBlacklisted(host->GetRoutingID(),
+ host_->Send(new AutofillMsg_FormNotBlacklisted(host_->GetRoutingID(),
observed_form_));
}
diff --git a/chrome/browser/password_manager/password_form_manager.h b/chrome/browser/password_manager/password_form_manager.h
index 2552acbb..7ea07c3 100644
--- a/chrome/browser/password_manager/password_form_manager.h
+++ b/chrome/browser/password_manager/password_form_manager.h
@@ -15,7 +15,7 @@
#include "webkit/forms/password_form.h"
namespace content {
-class WebContents;
+class RenderViewHost;
} // namespace content
class PasswordManager;
@@ -34,7 +34,7 @@ class PasswordFormManager : public PasswordStoreConsumer {
// used to filter login results from database.
PasswordFormManager(Profile* profile,
PasswordManager* password_manager,
- content::WebContents* web_contents,
+ content::RenderViewHost* host,
const webkit::forms::PasswordForm& observed_form,
bool ssl_valid);
virtual ~PasswordFormManager();
@@ -242,9 +242,8 @@ class PasswordFormManager : public PasswordStoreConsumer {
// The profile from which we get the PasswordStore.
Profile* profile_;
- // Web contents from which we get the RenderViewHost for sending messages to
- // the corresponding renderer.
- content::WebContents* web_contents_;
+ // Render view host for sending messages to the corresponding renderer.
+ content::RenderViewHost* host_;
// These three fields record the "ActionsTaken" by the browser and
// the user with this form, and the result. They are combined and
diff --git a/chrome/browser/password_manager/password_manager.cc b/chrome/browser/password_manager/password_manager.cc
index 7885d21..46c8322 100644
--- a/chrome/browser/password_manager/password_manager.cc
+++ b/chrome/browser/password_manager/password_manager.cc
@@ -92,7 +92,7 @@ void PasswordManager::SetFormHasGeneratedPassword(const PasswordForm& form) {
PasswordFormManager* manager =
new PasswordFormManager(delegate_->GetProfile(),
this,
- web_contents(),
+ web_contents()->GetRenderViewHost(),
form,
ssl_valid);
pending_login_managers_.push_back(manager);
@@ -200,7 +200,7 @@ void PasswordManager::OnPasswordFormsParsed(
PasswordFormManager* manager =
new PasswordFormManager(delegate_->GetProfile(),
this,
- web_contents(),
+ web_contents()->GetRenderViewHost(),
*iter,
ssl_valid);
pending_login_managers_.push_back(manager);