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 "chrome/browser/chromeos/timezone/timezone_request.h" | 5 #include "chrome/browser/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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 330 } |
331 | 331 |
332 void TimeZoneRequest::StartRequest() { | 332 void TimeZoneRequest::StartRequest() { |
333 DCHECK(thread_checker_.CalledOnValidThread()); | 333 DCHECK(thread_checker_.CalledOnValidThread()); |
334 RecordUmaEvent(TIMEZONE_REQUEST_EVENT_REQUEST_START); | 334 RecordUmaEvent(TIMEZONE_REQUEST_EVENT_REQUEST_START); |
335 request_started_at_ = base::Time::Now(); | 335 request_started_at_ = base::Time::Now(); |
336 ++retries_; | 336 ++retries_; |
337 | 337 |
338 url_fetcher_.reset( | 338 url_fetcher_.reset( |
339 net::URLFetcher::Create(request_url_, net::URLFetcher::GET, this)); | 339 net::URLFetcher::Create(request_url_, net::URLFetcher::GET, this)); |
340 url_fetcher_->SetRequestContext(url_context_getter_); | 340 url_fetcher_->SetRequestContext(url_context_getter_.get()); |
341 url_fetcher_->SetLoadFlags(net::LOAD_BYPASS_CACHE | | 341 url_fetcher_->SetLoadFlags(net::LOAD_BYPASS_CACHE | |
342 net::LOAD_DISABLE_CACHE | | 342 net::LOAD_DISABLE_CACHE | |
343 net::LOAD_DO_NOT_SAVE_COOKIES | | 343 net::LOAD_DO_NOT_SAVE_COOKIES | |
344 net::LOAD_DO_NOT_SEND_COOKIES | | 344 net::LOAD_DO_NOT_SEND_COOKIES | |
345 net::LOAD_DO_NOT_SEND_AUTH_DATA); | 345 net::LOAD_DO_NOT_SEND_AUTH_DATA); |
346 url_fetcher_->Start(); | 346 url_fetcher_->Start(); |
347 } | 347 } |
348 | 348 |
349 void TimeZoneRequest::MakeRequest(TimeZoneResponseCallback callback) { | 349 void TimeZoneRequest::MakeRequest(TimeZoneResponseCallback callback) { |
350 callback_ = callback; | 350 callback_ = callback; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 dstOffset, | 422 dstOffset, |
423 rawOffset, | 423 rawOffset, |
424 timeZoneId.c_str(), | 424 timeZoneId.c_str(), |
425 timeZoneName.c_str(), | 425 timeZoneName.c_str(), |
426 error_message.c_str(), | 426 error_message.c_str(), |
427 (unsigned)status, | 427 (unsigned)status, |
428 (status < arraysize(status2string) ? status2string[status] : "unknown")); | 428 (status < arraysize(status2string) ? status2string[status] : "unknown")); |
429 } | 429 } |
430 | 430 |
431 } // namespace chromeos | 431 } // namespace chromeos |
OLD | NEW |