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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_uploader.h

Issue 10877006: Rename GDataErrorCode to DriveErrorCode, GDataFileError to DriveFileError (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase. Created 8 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 | 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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/platform_file.h" 14 #include "base/platform_file.h"
15 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" 15 #include "chrome/browser/chromeos/gdata/drive_errorcode.h"
16 #include "chrome/browser/chromeos/gdata/gdata_operations.h" 16 #include "chrome/browser/chromeos/gdata/gdata_operations.h"
17 #include "chrome/browser/chromeos/gdata/gdata_upload_file_info.h" 17 #include "chrome/browser/chromeos/gdata/gdata_upload_file_info.h"
18 #include "googleurl/src/gurl.h" 18 #include "googleurl/src/gurl.h"
19 19
20 namespace content { 20 namespace content {
21 class DownloadItem; 21 class DownloadItem;
22 } 22 }
23 23
24 namespace gdata { 24 namespace gdata {
25 25
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 // Open the file. 91 // Open the file.
92 void OpenFile(UploadFileInfo* upload_file_info); 92 void OpenFile(UploadFileInfo* upload_file_info);
93 93
94 // net::FileStream::Open completion callback. The result of the file 94 // net::FileStream::Open completion callback. The result of the file
95 // open operation is passed as |result|. 95 // open operation is passed as |result|.
96 void OpenCompletionCallback(int upload_id, int result); 96 void OpenCompletionCallback(int upload_id, int result);
97 97
98 // DriveService callback for InitiateUpload. 98 // DriveService callback for InitiateUpload.
99 void OnUploadLocationReceived(int upload_id, 99 void OnUploadLocationReceived(int upload_id,
100 GDataErrorCode code, 100 DriveErrorCode code,
101 const GURL& upload_location); 101 const GURL& upload_location);
102 102
103 // Uploads the next chunk of data from the file. 103 // Uploads the next chunk of data from the file.
104 void UploadNextChunk(UploadFileInfo* upload_file_info); 104 void UploadNextChunk(UploadFileInfo* upload_file_info);
105 105
106 // net::FileStream::Read completion callback. 106 // net::FileStream::Read completion callback.
107 void ReadCompletionCallback(int upload_id, 107 void ReadCompletionCallback(int upload_id,
108 int bytes_to_read, 108 int bytes_to_read,
109 int bytes_read); 109 int bytes_read);
110 110
111 // Calls DriveService's ResumeUpload with the current upload info. 111 // Calls DriveService's ResumeUpload with the current upload info.
112 void ResumeUpload(int upload_id); 112 void ResumeUpload(int upload_id);
113 113
114 // DriveService callback for ResumeUpload. 114 // DriveService callback for ResumeUpload.
115 void OnResumeUploadResponseReceived(int upload_id, 115 void OnResumeUploadResponseReceived(int upload_id,
116 const ResumeUploadResponse& response, 116 const ResumeUploadResponse& response,
117 scoped_ptr<DocumentEntry> entry); 117 scoped_ptr<DocumentEntry> entry);
118 118
119 // Initiate the upload. 119 // Initiate the upload.
120 void InitiateUpload(UploadFileInfo* uploader_file_info); 120 void InitiateUpload(UploadFileInfo* uploader_file_info);
121 121
122 // Handle failed uploads. 122 // Handle failed uploads.
123 void UploadFailed(scoped_ptr<UploadFileInfo> upload_file_info, 123 void UploadFailed(scoped_ptr<UploadFileInfo> upload_file_info,
124 GDataFileError error); 124 DriveFileError error);
125 125
126 // Removes |upload_id| from UploadFileInfoMap |pending_uploads_|. 126 // Removes |upload_id| from UploadFileInfoMap |pending_uploads_|.
127 // Note that this does not delete the UploadFileInfo object itself, 127 // Note that this does not delete the UploadFileInfo object itself,
128 // because it may still be in use by an asynchronous function. 128 // because it may still be in use by an asynchronous function.
129 void RemoveUpload(int upload_id); 129 void RemoveUpload(int upload_id);
130 130
131 // Starts uploading a file with |upload_file_info|. Returns a new upload 131 // Starts uploading a file with |upload_file_info|. Returns a new upload
132 // ID assigned to |upload_file_info|. 132 // ID assigned to |upload_file_info|.
133 int StartUploadFile(scoped_ptr<UploadFileInfo> upload_file_info); 133 int StartUploadFile(scoped_ptr<UploadFileInfo> upload_file_info);
134 134
(...skipping 10 matching lines...) Expand all
145 // Note: This should remain the last member so it'll be destroyed and 145 // Note: This should remain the last member so it'll be destroyed and
146 // invalidate its weak pointers before any other members are destroyed. 146 // invalidate its weak pointers before any other members are destroyed.
147 base::WeakPtrFactory<GDataUploader> weak_ptr_factory_; 147 base::WeakPtrFactory<GDataUploader> weak_ptr_factory_;
148 148
149 DISALLOW_COPY_AND_ASSIGN(GDataUploader); 149 DISALLOW_COPY_AND_ASSIGN(GDataUploader);
150 }; 150 };
151 151
152 } // namespace gdata 152 } // namespace gdata
153 153
154 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ 154 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698