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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOAD_FILE_INFO_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_UPLOAD_FILE_INFO_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOAD_FILE_INFO_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_UPLOAD_FILE_INFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" | 15 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 UploadMode upload_mode; | 56 UploadMode upload_mode; |
57 | 57 |
58 // Location URL used to get |upload_location| with InitiateUpload. | 58 // Location URL used to get |upload_location| with InitiateUpload. |
59 GURL initial_upload_location; | 59 GURL initial_upload_location; |
60 | 60 |
61 // Location URL where file is to be uploaded to, returned from | 61 // Location URL where file is to be uploaded to, returned from |
62 // InitiateUpload. Used for the subsequent ResumeUpload requests. | 62 // InitiateUpload. Used for the subsequent ResumeUpload requests. |
63 GURL upload_location; | 63 GURL upload_location; |
64 | 64 |
65 // Final path in gdata. Looks like /special/drive/MyFolder/MyFile. | 65 // Final path in drive. Looks like /special/drive/MyFolder/MyFile. |
66 FilePath gdata_path; | 66 FilePath drive_path; |
67 | 67 |
68 // TODO(achuith): Use generic stream object after FileStream is refactored to | 68 // TODO(achuith): Use generic stream object after FileStream is refactored to |
69 // extend a generic stream. | 69 // extend a generic stream. |
70 net::FileStream* file_stream; // For opening and reading from physical file. | 70 net::FileStream* file_stream; // For opening and reading from physical file. |
71 scoped_refptr<net::IOBuffer> buf; // Holds current content to be uploaded. | 71 scoped_refptr<net::IOBuffer> buf; // Holds current content to be uploaded. |
72 // Size of |buf|, max is 512KB; Google Docs requires size of each upload chunk | 72 // Size of |buf|, max is 512KB; Google Docs requires size of each upload chunk |
73 // to be a multiple of 512KB. | 73 // to be a multiple of 512KB. |
74 int64 buf_len; | 74 int64 buf_len; |
75 | 75 |
76 // Data to be updated by caller before sending each ResumeUpload request. | 76 // Data to be updated by caller before sending each ResumeUpload request. |
(...skipping 11 matching lines...) Expand all Loading... |
88 scoped_ptr<DocumentEntry> entry; | 88 scoped_ptr<DocumentEntry> entry; |
89 | 89 |
90 // Callback to be invoked once the upload has completed. | 90 // Callback to be invoked once the upload has completed. |
91 typedef base::Callback<void(DriveFileError error, | 91 typedef base::Callback<void(DriveFileError error, |
92 scoped_ptr<UploadFileInfo> upload_file_info)> UploadCompletionCallback; | 92 scoped_ptr<UploadFileInfo> upload_file_info)> UploadCompletionCallback; |
93 UploadCompletionCallback completion_callback; | 93 UploadCompletionCallback completion_callback; |
94 }; | 94 }; |
95 | 95 |
96 } // namespace gdata | 96 } // namespace gdata |
97 | 97 |
98 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOAD_FILE_INFO_H_ | 98 #endif // CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_UPLOAD_FILE_INFO_H_ |
OLD | NEW |