| OLD | NEW | 
|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromeos/timezone/timezone_request.h" | 5 #include "chromeos/timezone/timezone_request.h" | 
| 6 | 6 | 
| 7 #include <string> | 7 #include <string> | 
| 8 | 8 | 
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" | 
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" | 
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 325     RecordUmaResult(TIMEZONE_REQUEST_RESULT_CANCELLED, retries_); | 325     RecordUmaResult(TIMEZONE_REQUEST_RESULT_CANCELLED, retries_); | 
| 326   } | 326   } | 
| 327 } | 327 } | 
| 328 | 328 | 
| 329 void TimeZoneRequest::StartRequest() { | 329 void TimeZoneRequest::StartRequest() { | 
| 330   DCHECK(thread_checker_.CalledOnValidThread()); | 330   DCHECK(thread_checker_.CalledOnValidThread()); | 
| 331   RecordUmaEvent(TIMEZONE_REQUEST_EVENT_REQUEST_START); | 331   RecordUmaEvent(TIMEZONE_REQUEST_EVENT_REQUEST_START); | 
| 332   request_started_at_ = base::Time::Now(); | 332   request_started_at_ = base::Time::Now(); | 
| 333   ++retries_; | 333   ++retries_; | 
| 334 | 334 | 
| 335   url_fetcher_.reset( | 335   url_fetcher_ = | 
| 336       net::URLFetcher::Create(request_url_, net::URLFetcher::GET, this)); | 336       net::URLFetcher::Create(request_url_, net::URLFetcher::GET, this); | 
| 337   url_fetcher_->SetRequestContext(url_context_getter_.get()); | 337   url_fetcher_->SetRequestContext(url_context_getter_.get()); | 
| 338   url_fetcher_->SetLoadFlags(net::LOAD_BYPASS_CACHE | | 338   url_fetcher_->SetLoadFlags(net::LOAD_BYPASS_CACHE | | 
| 339                              net::LOAD_DISABLE_CACHE | | 339                              net::LOAD_DISABLE_CACHE | | 
| 340                              net::LOAD_DO_NOT_SAVE_COOKIES | | 340                              net::LOAD_DO_NOT_SAVE_COOKIES | | 
| 341                              net::LOAD_DO_NOT_SEND_COOKIES | | 341                              net::LOAD_DO_NOT_SEND_COOKIES | | 
| 342                              net::LOAD_DO_NOT_SEND_AUTH_DATA); | 342                              net::LOAD_DO_NOT_SEND_AUTH_DATA); | 
| 343   url_fetcher_->Start(); | 343   url_fetcher_->Start(); | 
| 344 } | 344 } | 
| 345 | 345 | 
| 346 void TimeZoneRequest::MakeRequest(TimeZoneResponseCallback callback) { | 346 void TimeZoneRequest::MakeRequest(TimeZoneResponseCallback callback) { | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 419       dstOffset, | 419       dstOffset, | 
| 420       rawOffset, | 420       rawOffset, | 
| 421       timeZoneId.c_str(), | 421       timeZoneId.c_str(), | 
| 422       timeZoneName.c_str(), | 422       timeZoneName.c_str(), | 
| 423       error_message.c_str(), | 423       error_message.c_str(), | 
| 424       (unsigned)status, | 424       (unsigned)status, | 
| 425       (status < arraysize(status2string) ? status2string[status] : "unknown")); | 425       (status < arraysize(status2string) ? status2string[status] : "unknown")); | 
| 426 } | 426 } | 
| 427 | 427 | 
| 428 }  // namespace chromeos | 428 }  // namespace chromeos | 
| OLD | NEW | 
|---|