summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 02:23:06 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-21 02:23:06 +0000
commit12f71c607aba62863bb8d7fb044ec0b7d548f638 (patch)
tree49087c0047ba095b3019336125324823c17df6b5 /chrome
parent37aee1c3698e50522c05d3729181c0de73063388 (diff)
downloadchromium_src-12f71c607aba62863bb8d7fb044ec0b7d548f638.zip
chromium_src-12f71c607aba62863bb8d7fb044ec0b7d548f638.tar.gz
chromium_src-12f71c607aba62863bb8d7fb044ec0b7d548f638.tar.bz2
DOMUI: Cancel pending queries to the PasswordStore on destruction to avoid
being notified after the object has been destroyed. BUG=69441 TEST=none Review URL: http://codereview.chromium.org/6299014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72092 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/dom_ui/options/password_manager_handler.cc20
-rw-r--r--chrome/browser/dom_ui/options/password_manager_handler.h16
2 files changed, 24 insertions, 12 deletions
diff --git a/chrome/browser/dom_ui/options/password_manager_handler.cc b/chrome/browser/dom_ui/options/password_manager_handler.cc
index b6769e6b..0c9eaa5 100644
--- a/chrome/browser/dom_ui/options/password_manager_handler.cc
+++ b/chrome/browser/dom_ui/options/password_manager_handler.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -153,6 +153,19 @@ void PasswordManagerHandler::SetPasswordExceptionList() {
L"PasswordManager.setPasswordExceptionsList", entries);
}
+PasswordManagerHandler::ListPopulater::ListPopulater(
+ PasswordManagerHandler* page) : page_(page),
+ pending_login_query_(0) {
+}
+
+PasswordManagerHandler::ListPopulater::~ListPopulater() {
+ page_->GetPasswordStore()->CancelLoginsQuery(pending_login_query_);
+}
+
+PasswordManagerHandler::PasswordListPopulater::PasswordListPopulater(
+ PasswordManagerHandler* page) : ListPopulater(page) {
+}
+
void PasswordManagerHandler::PasswordListPopulater::Populate() {
DCHECK(!pending_login_query_);
PasswordStore* store = page_->GetPasswordStore();
@@ -171,6 +184,11 @@ void PasswordManagerHandler::PasswordListPopulater::
page_->SetPasswordList();
}
+PasswordManagerHandler::PasswordExceptionListPopulater::
+ PasswordExceptionListPopulater(PasswordManagerHandler* page)
+ : ListPopulater(page) {
+}
+
void PasswordManagerHandler::PasswordExceptionListPopulater::Populate() {
DCHECK(!pending_login_query_);
PasswordStore* store = page_->GetPasswordStore();
diff --git a/chrome/browser/dom_ui/options/password_manager_handler.h b/chrome/browser/dom_ui/options/password_manager_handler.h
index 5cd3080..af94e6b 100644
--- a/chrome/browser/dom_ui/options/password_manager_handler.h
+++ b/chrome/browser/dom_ui/options/password_manager_handler.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -56,10 +56,8 @@ class PasswordManagerHandler : public OptionsPageUIHandler {
// A short class to mediate requests to the password store.
class ListPopulater : public PasswordStoreConsumer {
public:
- explicit ListPopulater(PasswordManagerHandler* page)
- : page_(page),
- pending_login_query_(0) {
- }
+ explicit ListPopulater(PasswordManagerHandler* page);
+ virtual ~ListPopulater();
// Send a query to the password store to populate a list.
virtual void Populate() = 0;
@@ -76,9 +74,7 @@ class PasswordManagerHandler : public OptionsPageUIHandler {
// A short class to mediate requests to the password store for passwordlist.
class PasswordListPopulater : public ListPopulater {
public:
- explicit PasswordListPopulater(PasswordManagerHandler* page)
- : ListPopulater(page) {
- }
+ explicit PasswordListPopulater(PasswordManagerHandler* page);
// Send a query to the password store to populate a password list.
virtual void Populate();
@@ -91,9 +87,7 @@ class PasswordManagerHandler : public OptionsPageUIHandler {
// A short class to mediate requests to the password store for exceptions.
class PasswordExceptionListPopulater : public ListPopulater {
public:
- explicit PasswordExceptionListPopulater(
- PasswordManagerHandler* page) : ListPopulater(page) {
- }
+ explicit PasswordExceptionListPopulater(PasswordManagerHandler* page);
// Send a query to the password store to populate a passwordException list.
virtual void Populate();