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

Side by Side Diff: google_apis/drive/base_requests.cc

Issue 2256183002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | google_apis/gcm/engine/connection_factory_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 return file_writer_->Initialize(callback); 286 return file_writer_->Initialize(callback);
287 287
288 data_.clear(); 288 data_.clear();
289 return net::OK; 289 return net::OK;
290 } 290 }
291 291
292 int ResponseWriter::Write(net::IOBuffer* buffer, 292 int ResponseWriter::Write(net::IOBuffer* buffer,
293 int num_bytes, 293 int num_bytes,
294 const net::CompletionCallback& callback) { 294 const net::CompletionCallback& callback) {
295 if (!get_content_callback_.is_null()) { 295 if (!get_content_callback_.is_null()) {
296 get_content_callback_.Run(HTTP_SUCCESS, base::WrapUnique(new std::string( 296 get_content_callback_.Run(
297 buffer->data(), num_bytes))); 297 HTTP_SUCCESS, base::MakeUnique<std::string>(buffer->data(), num_bytes));
298 } 298 }
299 299
300 if (file_writer_) { 300 if (file_writer_) {
301 const int result = file_writer_->Write( 301 const int result = file_writer_->Write(
302 buffer, num_bytes, 302 buffer, num_bytes,
303 base::Bind(&ResponseWriter::DidWrite, 303 base::Bind(&ResponseWriter::DidWrite,
304 weak_ptr_factory_.GetWeakPtr(), 304 weak_ptr_factory_.GetWeakPtr(),
305 make_scoped_refptr(buffer), callback)); 305 make_scoped_refptr(buffer), callback));
306 if (result != net::ERR_IO_PENDING) 306 if (result != net::ERR_IO_PENDING)
307 DidWrite(buffer, net::CompletionCallback(), result); 307 DidWrite(buffer, net::CompletionCallback(), result);
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 download_action_callback_.Run(code, temp_file); 1002 download_action_callback_.Run(code, temp_file);
1003 OnProcessURLFetchResultsComplete(); 1003 OnProcessURLFetchResultsComplete();
1004 } 1004 }
1005 1005
1006 void DownloadFileRequestBase::RunCallbackOnPrematureFailure( 1006 void DownloadFileRequestBase::RunCallbackOnPrematureFailure(
1007 DriveApiErrorCode code) { 1007 DriveApiErrorCode code) {
1008 download_action_callback_.Run(code, base::FilePath()); 1008 download_action_callback_.Run(code, base::FilePath());
1009 } 1009 }
1010 1010
1011 } // namespace google_apis 1011 } // namespace google_apis
OLDNEW
« no previous file with comments | « no previous file | google_apis/gcm/engine/connection_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698