summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-02 01:15:38 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-02 01:15:38 +0000
commitaa95dcbcd337503c94ba7a6fce01856df2ae9af9 (patch)
treefd07303b80d25c936fea57961d5b98f2245d3043
parent8527c0a1a25c4af1181fc0c12d0ff045707b030a (diff)
downloadchromium_src-aa95dcbcd337503c94ba7a6fce01856df2ae9af9.zip
chromium_src-aa95dcbcd337503c94ba7a6fce01856df2ae9af9.tar.gz
chromium_src-aa95dcbcd337503c94ba7a6fce01856df2ae9af9.tar.bz2
Add extra DCHECKs to the AutoFillManager class. This is follow-up for review http://codereview.chromium.org/661297.
BUG=36938 TEST=none Review URL: http://codereview.chromium.org/660329 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40340 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autofill/autofill_manager.cc6
-rw-r--r--chrome/browser/autofill/autofill_manager.h4
2 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
index b83c9b4..e95b1c6 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -22,7 +22,9 @@
AutoFillManager::AutoFillManager(TabContents* tab_contents)
: tab_contents_(tab_contents),
+ personal_data_(NULL),
infobar_(NULL) {
+ DCHECK(tab_contents);
personal_data_ = tab_contents_->profile()->GetPersonalDataManager();
}
@@ -233,6 +235,8 @@ void AutoFillManager::OnPersonalDataLoaded() {
void AutoFillManager::DeterminePossibleFieldTypes(
FormStructure* form_structure) {
+ DCHECK(personal_data_);
+
// TODO(jhawkins): Update field text.
form_structure->GetHeuristicAutoFillTypes();
@@ -246,6 +250,8 @@ void AutoFillManager::DeterminePossibleFieldTypes(
}
void AutoFillManager::HandleSubmit() {
+ DCHECK(personal_data_);
+
// If there wasn't enough data to import then we don't want to send an upload
// to the server.
if (!personal_data_->ImportFormData(form_structures_.get(), this))
diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h
index d629e4f..9263e08 100644
--- a/chrome/browser/autofill/autofill_manager.h
+++ b/chrome/browser/autofill/autofill_manager.h
@@ -81,10 +81,14 @@ class AutoFillManager : public RenderViewHostDelegate::AutoFill,
private:
// The TabContents hosting this AutoFillManager.
+ // Weak reference.
+ // May not be NULL.
TabContents* tab_contents_;
// The personal data manager, used to save and load personal data to/from the
// web database.
+ // Weak reference.
+ // May be NULL. NULL indicates OTR.
PersonalDataManager* personal_data_;
// Our copy of the form data.