| 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/build_time.h" | 9 #include "base/build_time.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 } | 439 } |
| 440 #endif | 440 #endif |
| 441 result.reset(new VariationsService( | 441 result.reset(new VariationsService( |
| 442 new web_resource::ResourceRequestAllowedNotifier( | 442 new web_resource::ResourceRequestAllowedNotifier( |
| 443 local_state, switches::kDisableBackgroundNetworking), | 443 local_state, switches::kDisableBackgroundNetworking), |
| 444 local_state, state_manager)); | 444 local_state, state_manager)); |
| 445 return result.Pass(); | 445 return result.Pass(); |
| 446 } | 446 } |
| 447 | 447 |
| 448 void VariationsService::DoActualFetch() { | 448 void VariationsService::DoActualFetch() { |
| 449 pending_seed_request_.reset(net::URLFetcher::Create( | 449 pending_seed_request_ = net::URLFetcher::Create(0, variations_server_url_, |
| 450 0, variations_server_url_, net::URLFetcher::GET, this)); | 450 net::URLFetcher::GET, this); |
| 451 pending_seed_request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | | 451 pending_seed_request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | |
| 452 net::LOAD_DO_NOT_SAVE_COOKIES); | 452 net::LOAD_DO_NOT_SAVE_COOKIES); |
| 453 pending_seed_request_->SetRequestContext( | 453 pending_seed_request_->SetRequestContext( |
| 454 g_browser_process->system_request_context()); | 454 g_browser_process->system_request_context()); |
| 455 pending_seed_request_->SetMaxRetriesOn5xx(kMaxRetrySeedFetch); | 455 pending_seed_request_->SetMaxRetriesOn5xx(kMaxRetrySeedFetch); |
| 456 if (!seed_store_.variations_serial_number().empty()) { | 456 if (!seed_store_.variations_serial_number().empty()) { |
| 457 pending_seed_request_->AddExtraRequestHeader( | 457 pending_seed_request_->AddExtraRequestHeader( |
| 458 "If-Match:" + seed_store_.variations_serial_number()); | 458 "If-Match:" + seed_store_.variations_serial_number()); |
| 459 } | 459 } |
| 460 pending_seed_request_->Start(); | 460 pending_seed_request_->Start(); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 local_state_->SetInt64(prefs::kVariationsLastFetchTime, | 640 local_state_->SetInt64(prefs::kVariationsLastFetchTime, |
| 641 base::Time::Now().ToInternalValue()); | 641 base::Time::Now().ToInternalValue()); |
| 642 } | 642 } |
| 643 } | 643 } |
| 644 | 644 |
| 645 std::string VariationsService::GetInvalidVariationsSeedSignature() const { | 645 std::string VariationsService::GetInvalidVariationsSeedSignature() const { |
| 646 return seed_store_.GetInvalidSignature(); | 646 return seed_store_.GetInvalidSignature(); |
| 647 } | 647 } |
| 648 | 648 |
| 649 } // namespace chrome_variations | 649 } // namespace chrome_variations |
| OLD | NEW |