OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/metrics/variations/variations_service.h" | 5 #include "chrome/browser/metrics/variations/variations_service.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/build_time.h" | 10 #include "base/build_time.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 create_trials_from_seed_called_ = called; | 170 create_trials_from_seed_called_ = called; |
171 } | 171 } |
172 | 172 |
173 void VariationsService::DoActualFetch() { | 173 void VariationsService::DoActualFetch() { |
174 pending_seed_request_.reset(net::URLFetcher::Create( | 174 pending_seed_request_.reset(net::URLFetcher::Create( |
175 variations_server_url_, net::URLFetcher::GET, this)); | 175 variations_server_url_, net::URLFetcher::GET, this)); |
176 pending_seed_request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | | 176 pending_seed_request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | |
177 net::LOAD_DO_NOT_SAVE_COOKIES); | 177 net::LOAD_DO_NOT_SAVE_COOKIES); |
178 pending_seed_request_->SetRequestContext( | 178 pending_seed_request_->SetRequestContext( |
179 g_browser_process->system_request_context()); | 179 g_browser_process->system_request_context()); |
180 pending_seed_request_->SetMaxRetries(kMaxRetrySeedFetch); | 180 pending_seed_request_->SetMaxRetriesOn5xx(kMaxRetrySeedFetch); |
181 if (!variations_serial_number_.empty()) { | 181 if (!variations_serial_number_.empty()) { |
182 pending_seed_request_->AddExtraRequestHeader("If-Match:" + | 182 pending_seed_request_->AddExtraRequestHeader("If-Match:" + |
183 variations_serial_number_); | 183 variations_serial_number_); |
184 } | 184 } |
185 pending_seed_request_->Start(); | 185 pending_seed_request_->Start(); |
186 | 186 |
187 last_request_started_time_ = base::TimeTicks::Now(); | 187 last_request_started_time_ = base::TimeTicks::Now(); |
188 } | 188 } |
189 | 189 |
190 void VariationsService::FetchVariationsSeed() { | 190 void VariationsService::FetchVariationsSeed() { |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 variation_id); | 511 variation_id); |
512 } | 512 } |
513 } | 513 } |
514 | 514 |
515 trial->SetForced(); | 515 trial->SetForced(); |
516 if (IsStudyExpired(study, reference_date)) | 516 if (IsStudyExpired(study, reference_date)) |
517 trial->Disable(); | 517 trial->Disable(); |
518 } | 518 } |
519 | 519 |
520 } // namespace chrome_variations | 520 } // namespace chrome_variations |
OLD | NEW |