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

Side by Side Diff: google_apis/drive/base_requests.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 (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 "google_apis/drive/base_requests.h" 5 #include "google_apis/drive/base_requests.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 base::ThreadTaskRunnerHandle::Get()->PostTask( 347 base::ThreadTaskRunnerHandle::Get()->PostTask(
348 FROM_HERE, base::Bind(&UrlFetchRequestBase::CompleteRequestWithError, 348 FROM_HERE, base::Bind(&UrlFetchRequestBase::CompleteRequestWithError,
349 weak_ptr_factory_.GetWeakPtr(), error_code)); 349 weak_ptr_factory_.GetWeakPtr(), error_code));
350 return; 350 return;
351 } 351 }
352 352
353 re_authenticate_callback_ = callback; 353 re_authenticate_callback_ = callback;
354 DVLOG(1) << "URL: " << url.spec(); 354 DVLOG(1) << "URL: " << url.spec();
355 355
356 URLFetcher::RequestType request_type = GetRequestType(); 356 URLFetcher::RequestType request_type = GetRequestType();
357 url_fetcher_.reset(URLFetcher::Create(url, request_type, this)); 357 url_fetcher_ = URLFetcher::Create(url, request_type, this);
358 url_fetcher_->SetRequestContext(sender_->url_request_context_getter()); 358 url_fetcher_->SetRequestContext(sender_->url_request_context_getter());
359 // Always set flags to neither send nor save cookies. 359 // Always set flags to neither send nor save cookies.
360 url_fetcher_->SetLoadFlags( 360 url_fetcher_->SetLoadFlags(
361 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES | 361 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES |
362 net::LOAD_DISABLE_CACHE); 362 net::LOAD_DISABLE_CACHE);
363 363
364 base::FilePath output_file_path; 364 base::FilePath output_file_path;
365 GetContentCallback get_content_callback; 365 GetContentCallback get_content_callback;
366 GetOutputFilePath(&output_file_path, &get_content_callback); 366 GetOutputFilePath(&output_file_path, &get_content_callback);
367 if (!get_content_callback.is_null()) 367 if (!get_content_callback.is_null())
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 download_action_callback_.Run(code, temp_file); 1010 download_action_callback_.Run(code, temp_file);
1011 OnProcessURLFetchResultsComplete(); 1011 OnProcessURLFetchResultsComplete();
1012 } 1012 }
1013 1013
1014 void DownloadFileRequestBase::RunCallbackOnPrematureFailure( 1014 void DownloadFileRequestBase::RunCallbackOnPrematureFailure(
1015 DriveApiErrorCode code) { 1015 DriveApiErrorCode code) {
1016 download_action_callback_.Run(code, base::FilePath()); 1016 download_action_callback_.Run(code, base::FilePath());
1017 } 1017 }
1018 1018
1019 } // namespace google_apis 1019 } // namespace google_apis
OLDNEW
« no previous file with comments | « extensions/browser/updater/update_service_browsertest.cc ('k') | google_apis/gaia/gaia_auth_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698