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

Side by Side Diff: chrome/browser/chromeos/drive/drive_uploader.cc

Issue 11143014: Add request header on gdata operation for testing ETag match. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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 | Annotate | Revision Log
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 "chrome/browser/chromeos/drive/drive_uploader.h" 5 #include "chrome/browser/chromeos/drive/drive_uploader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 if (upload_file_info->initial_upload_location.is_empty()) { 297 if (upload_file_info->initial_upload_location.is_empty()) {
298 UploadFailed(upload_file_info, DRIVE_FILE_ERROR_ABORT); 298 UploadFailed(upload_file_info, DRIVE_FILE_ERROR_ABORT);
299 return; 299 return;
300 } 300 }
301 drive_service_->InitiateUpload( 301 drive_service_->InitiateUpload(
302 gdata::InitiateUploadParams(upload_file_info->upload_mode, 302 gdata::InitiateUploadParams(upload_file_info->upload_mode,
303 upload_file_info->title, 303 upload_file_info->title,
304 upload_file_info->content_type, 304 upload_file_info->content_type,
305 upload_file_info->content_length, 305 upload_file_info->content_length,
306 upload_file_info->initial_upload_location, 306 upload_file_info->initial_upload_location,
307 upload_file_info->drive_path), 307 upload_file_info->drive_path,
308 upload_file_info->etag),
308 base::Bind(&DriveUploader::OnUploadLocationReceived, 309 base::Bind(&DriveUploader::OnUploadLocationReceived,
309 weak_ptr_factory_.GetWeakPtr(), 310 weak_ptr_factory_.GetWeakPtr(),
310 upload_file_info->upload_id)); 311 upload_file_info->upload_id));
311 } 312 }
312 // The uploader gets ready after we complete opening the file, called 313 // The uploader gets ready after we complete opening the file, called
313 // from the StartUploadFile method. We use PostTask on purpose, because 314 // from the StartUploadFile method. We use PostTask on purpose, because
314 // this callback is called by FileStream, and we may access FileStream 315 // this callback is called by FileStream, and we may access FileStream
315 // again from the |ready_callback| implementation. FileStream is not 316 // again from the |ready_callback| implementation. FileStream is not
316 // reentrant. 317 // reentrant.
317 // 318 //
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 return "title=[" + title + 565 return "title=[" + title +
565 "], file_path=[" + file_path.AsUTF8Unsafe() + 566 "], file_path=[" + file_path.AsUTF8Unsafe() +
566 "], content_type=[" + content_type + 567 "], content_type=[" + content_type +
567 "], content_length=[" + base::UintToString(content_length) + 568 "], content_length=[" + base::UintToString(content_length) +
568 "], file_size=[" + base::UintToString(file_size) + 569 "], file_size=[" + base::UintToString(file_size) +
569 "], drive_path=[" + drive_path.AsUTF8Unsafe() + 570 "], drive_path=[" + drive_path.AsUTF8Unsafe() +
570 "]"; 571 "]";
571 } 572 }
572 573
573 } // namespace drive 574 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698