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

Side by Side Diff: chrome/browser/google_apis/fake_drive_service.cc

Issue 13927002: Add callback for upload progress in Drive service and operation layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/google_apis/fake_drive_service.h" 5 #include "chrome/browser/google_apis/fake_drive_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 924
925 void FakeDriveService::ResumeUpload( 925 void FakeDriveService::ResumeUpload(
926 UploadMode upload_mode, 926 UploadMode upload_mode,
927 const base::FilePath& drive_file_path, 927 const base::FilePath& drive_file_path,
928 const GURL& upload_url, 928 const GURL& upload_url,
929 int64 start_position, 929 int64 start_position,
930 int64 end_position, 930 int64 end_position,
931 int64 content_length, 931 int64 content_length,
932 const std::string& content_type, 932 const std::string& content_type,
933 const scoped_refptr<net::IOBuffer>& buf, 933 const scoped_refptr<net::IOBuffer>& buf,
934 const UploadRangeCallback& callback) { 934 const UploadRangeCallback& callback,
935 const ProgressCallback& progress_callback) {
935 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 936 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
936 DCHECK(!callback.is_null()); 937 DCHECK(!callback.is_null());
937 938
938 scoped_ptr<ResourceEntry> result_entry; 939 scoped_ptr<ResourceEntry> result_entry;
939 940
940 if (offline_) { 941 if (offline_) {
941 MessageLoop::current()->PostTask( 942 MessageLoop::current()->PostTask(
942 FROM_HERE, 943 FROM_HERE,
943 base::Bind(callback, 944 base::Bind(callback,
944 UploadRangeResponse(GDATA_NO_CONNECTION, 945 UploadRangeResponse(GDATA_NO_CONNECTION,
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 1241
1241 base::DictionaryValue* raw_new_entry = new_entry.release(); 1242 base::DictionaryValue* raw_new_entry = new_entry.release();
1242 base::ListValue* entries = NULL; 1243 base::ListValue* entries = NULL;
1243 if (resource_list_dict->GetList("entry", &entries)) 1244 if (resource_list_dict->GetList("entry", &entries))
1244 entries->Append(raw_new_entry); 1245 entries->Append(raw_new_entry);
1245 1246
1246 return raw_new_entry; 1247 return raw_new_entry;
1247 } 1248 }
1248 1249
1249 } // namespace google_apis 1250 } // namespace google_apis
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/fake_drive_service.h ('k') | chrome/browser/google_apis/fake_drive_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698