summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/autofill_download.cc
diff options
context:
space:
mode:
authorgeorgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 00:12:56 +0000
committergeorgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 00:12:56 +0000
commit28e9bb85d5575e27dc8d527675d34cb1af2e73c5 (patch)
treecbb16edbb93ba4f582823f6e01fd0169dbee2ba0 /chrome/browser/autofill/autofill_download.cc
parent5fb586a686da09db00362bebdc282b0c3fae0ec5 (diff)
downloadchromium_src-28e9bb85d5575e27dc8d527675d34cb1af2e73c5.zip
chromium_src-28e9bb85d5575e27dc8d527675d34cb1af2e73c5.tar.gz
chromium_src-28e9bb85d5575e27dc8d527675d34cb1af2e73c5.tar.bz2
Fix for autofill DCHECK
BUG=74492 TEST=unit-tested Review URL: http://codereview.chromium.org/6621004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77213 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_download.cc')
-rw-r--r--chrome/browser/autofill/autofill_download.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/autofill/autofill_download.cc b/chrome/browser/autofill/autofill_download.cc
index d4cb32a..3583f73 100644
--- a/chrome/browser/autofill/autofill_download.cc
+++ b/chrome/browser/autofill/autofill_download.cc
@@ -173,6 +173,15 @@ void AutofillDownloadManager::SetNegativeUploadRate(double rate) {
bool AutofillDownloadManager::StartRequest(
const std::string& form_xml,
const FormRequestData& request_data) {
+ URLRequestContextGetter* request_context =
+ Profile::GetDefaultRequestContext();
+ // Check if default request context is NULL: this very rarely happens,
+ // I think, this could happen only if user opens chrome with some pages
+ // loading the forms immediately; I cannot reproduce this even in that
+ // scenario, but bug 74492 shows it happened at least once. In that case bail
+ // out and fall back on our own heuristics.
+ if (!request_context)
+ return false;
std::string request_url;
if (request_data.request_type == AutofillDownloadManager::REQUEST_QUERY)
request_url = AUTO_FILL_QUERY_SERVER_REQUEST_URL;
@@ -187,7 +196,7 @@ bool AutofillDownloadManager::StartRequest(
this);
url_fetchers_[fetcher] = request_data;
fetcher->set_automatically_retry_on_5xx(false);
- fetcher->set_request_context(Profile::GetDefaultRequestContext());
+ fetcher->set_request_context(request_context);
fetcher->set_upload_data("text/plain", form_xml);
fetcher->Start();
return true;