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

Unified Diff: components/variations/service/variations_service.cc

Issue 2678783003: Fix variations service DCHECK and add LOAD_DO_NOT_SEND_AUTH_DATA. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/service/variations_service.cc
diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc
index 6b95b26f6e63d91c85a0c0a52095e7a96b12adb4..cb5bb9d5fee7a7d00381cecd009ca277a805b0e4 100644
--- a/components/variations/service/variations_service.cc
+++ b/components/variations/service/variations_service.cc
@@ -521,7 +521,14 @@ std::unique_ptr<VariationsService> VariationsService::CreateForTesting(
void VariationsService::DoActualFetch() {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(!pending_seed_request_);
+
+ // Normally, there shouldn't be a |pending_request_| when this fires. However
+ // it's not impossible - for example if Chrome was paused (e.g. in a debugger
+ // or if the machine was suspended) and OnURLFetchComplete() hasn't had a
+ // chance to run yet from the previous request. In this case, don't start a
+ // new request and just let the previous one finish.
+ if (pending_seed_request_)
+ return;
pending_seed_request_ = net::URLFetcher::Create(0, variations_server_url_,
net::URLFetcher::GET, this);
@@ -529,6 +536,7 @@ void VariationsService::DoActualFetch() {
pending_seed_request_.get(),
data_use_measurement::DataUseUserData::VARIATIONS);
pending_seed_request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
+ net::LOAD_DO_NOT_SEND_AUTH_DATA |
net::LOAD_DO_NOT_SAVE_COOKIES);
pending_seed_request_->SetRequestContext(client_->GetURLRequestContext());
bool enable_deltas = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698