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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_file_system.cc

Issue 24030002: Adds callbacks to notify progress into Copy's API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/file_manager/private_api_file_syste m.h" 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_file_syste m.h"
6 6
7 #include <sys/stat.h> 7 #include <sys/stat.h>
8 #include <sys/statvfs.h> 8 #include <sys/statvfs.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <utime.h> 10 #include <utime.h>
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 const FileSystemURL& dest_url) { 222 const FileSystemURL& dest_url) {
223 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 223 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
224 224
225 // Note: |operation_id| is owned by the callback for 225 // Note: |operation_id| is owned by the callback for
226 // FileSystemOperationRunner::Copy(). It is always called in the next message 226 // FileSystemOperationRunner::Copy(). It is always called in the next message
227 // loop or later, so at least during this invocation it should alive. 227 // loop or later, so at least during this invocation it should alive.
228 fileapi::FileSystemOperationRunner::OperationID* operation_id = 228 fileapi::FileSystemOperationRunner::OperationID* operation_id =
229 new fileapi::FileSystemOperationRunner::OperationID; 229 new fileapi::FileSystemOperationRunner::OperationID;
230 *operation_id = file_system_context->operation_runner()->Copy( 230 *operation_id = file_system_context->operation_runner()->Copy(
231 source_url, dest_url, 231 source_url, dest_url,
232 fileapi::FileSystemOperationRunner::CopyProgressCallback(),
232 base::Bind(&OnCopyCompleted, 233 base::Bind(&OnCopyCompleted,
233 profile_id, base::Owned(operation_id), dest_url)); 234 profile_id, base::Owned(operation_id), dest_url));
234 return *operation_id; 235 return *operation_id;
235 } 236 }
236 237
237 void OnCopyCancelled(base::PlatformFileError error) { 238 void OnCopyCancelled(base::PlatformFileError error) {
238 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 239 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
239 240
240 // We just ignore the status if the copy is actually cancelled or not, 241 // We just ignore the status if the copy is actually cancelled or not,
241 // because failing cancellation means the operation is not running now. 242 // because failing cancellation means the operation is not running now.
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 // We don't much take care about the result of cancellation. 775 // We don't much take care about the result of cancellation.
775 BrowserThread::PostTask( 776 BrowserThread::PostTask(
776 BrowserThread::IO, 777 BrowserThread::IO,
777 FROM_HERE, 778 FROM_HERE,
778 base::Bind(&CancelCopyOnIOThread, file_system_context, params->copy_id)); 779 base::Bind(&CancelCopyOnIOThread, file_system_context, params->copy_id));
779 SendResponse(true); 780 SendResponse(true);
780 return true; 781 return true;
781 } 782 }
782 783
783 } // namespace extensions 784 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698