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

Side by Side Diff: chromeos/timezone/timezone_request.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chromeos/geolocation/simple_geolocation_request.cc ('k') | components/autofill/content/browser/wallet/wallet_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698