OLD | NEW |
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/google_apis/drive_uploader.h" | 5 #include "chrome/browser/google_apis/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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 } // namespace | 39 } // namespace |
40 | 40 |
41 namespace google_apis { | 41 namespace google_apis { |
42 | 42 |
43 // Structure containing current upload information of file, passed between | 43 // Structure containing current upload information of file, passed between |
44 // DriveServiceInterface methods and callbacks. | 44 // DriveServiceInterface methods and callbacks. |
45 struct DriveUploader::UploadFileInfo { | 45 struct DriveUploader::UploadFileInfo { |
46 UploadFileInfo(scoped_refptr<base::SequencedTaskRunner> task_runner, | 46 UploadFileInfo(scoped_refptr<base::SequencedTaskRunner> task_runner, |
47 UploadMode upload_mode, | 47 UploadMode upload_mode, |
48 const FilePath& drive_path, | 48 const base::FilePath& drive_path, |
49 const FilePath& local_path, | 49 const base::FilePath& local_path, |
50 const std::string& content_type, | 50 const std::string& content_type, |
51 const UploadCompletionCallback& callback) | 51 const UploadCompletionCallback& callback) |
52 : upload_mode(upload_mode), | 52 : upload_mode(upload_mode), |
53 drive_path(drive_path), | 53 drive_path(drive_path), |
54 file_path(local_path), | 54 file_path(local_path), |
55 content_type(content_type), | 55 content_type(content_type), |
56 completion_callback(callback), | 56 completion_callback(callback), |
57 content_length(0), | 57 content_length(0), |
58 next_send_position(0), | 58 next_send_position(0), |
59 file_stream(new net::FileStream(NULL)), | 59 file_stream(new net::FileStream(NULL)), |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 421 |
422 LOG(ERROR) << "Upload failed " << upload_file_info->DebugString(); | 422 LOG(ERROR) << "Upload failed " << upload_file_info->DebugString(); |
423 | 423 |
424 upload_file_info->completion_callback.Run(error, | 424 upload_file_info->completion_callback.Run(error, |
425 upload_file_info->drive_path, | 425 upload_file_info->drive_path, |
426 upload_file_info->file_path, | 426 upload_file_info->file_path, |
427 scoped_ptr<ResourceEntry>()); | 427 scoped_ptr<ResourceEntry>()); |
428 } | 428 } |
429 | 429 |
430 } // namespace google_apis | 430 } // namespace google_apis |
OLD | NEW |