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

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

Issue 10640006: gdata: Stop getting GDataUploader via GDataSystemService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add OVERRIDE Created 8 years, 6 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
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_uploader.h ('k') | no next file » | 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 "chrome/browser/chromeos/gdata/gdata_uploader.h" 5 #include "chrome/browser/chromeos/gdata/gdata_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 13 matching lines...) Expand all
24 // Google Documents List API requires uploading in chunks of 512kB. 24 // Google Documents List API requires uploading in chunks of 512kB.
25 const int64 kUploadChunkSize = 512 * 1024; 25 const int64 kUploadChunkSize = 512 * 1024;
26 26
27 // Maximum number of times we try to open a file before giving up. 27 // Maximum number of times we try to open a file before giving up.
28 const int kMaxFileOpenTries = 5; 28 const int kMaxFileOpenTries = 5;
29 29
30 } // namespace 30 } // namespace
31 31
32 namespace gdata { 32 namespace gdata {
33 33
34 GDataUploader::GDataUploader(GDataFileSystem* file_system, 34 GDataUploader::GDataUploader(DocumentsServiceInterface* documents_service)
35 DocumentsServiceInterface* documents_service) 35 : file_system_(NULL),
36 : file_system_(file_system),
37 documents_service_(documents_service), 36 documents_service_(documents_service),
38 next_upload_id_(0), 37 next_upload_id_(0),
39 ALLOW_THIS_IN_INITIALIZER_LIST(uploader_factory_(this)) { 38 ALLOW_THIS_IN_INITIALIZER_LIST(uploader_factory_(this)) {
40 } 39 }
41 40
42 GDataUploader::~GDataUploader() { 41 GDataUploader::~GDataUploader() {
43 } 42 }
44 43
45 int GDataUploader::UploadFile(scoped_ptr<UploadFileInfo> upload_file_info) { 44 int GDataUploader::UploadFile(scoped_ptr<UploadFileInfo> upload_file_info) {
46 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 45 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 if (!callback.is_null()) 392 if (!callback.is_null())
394 callback.Run(error, upload_file_info.Pass()); 393 callback.Run(error, upload_file_info.Pass());
395 } 394 }
396 395
397 void GDataUploader::RemoveUpload(int upload_id) { 396 void GDataUploader::RemoveUpload(int upload_id) {
398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 397 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
399 pending_uploads_.erase(upload_id); 398 pending_uploads_.erase(upload_id);
400 } 399 }
401 400
402 } // namespace gdata 401 } // namespace gdata
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_uploader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698