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

Side by Side Diff: storage/browser/fileapi/file_system_operation_runner.cc

Issue 565073002: [Blink-FileAPI] Add the notification of update observer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 "storage/browser/fileapi/file_system_operation_runner.h" 5 #include "storage/browser/fileapi/file_system_operation_runner.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/url_request/url_request_context.h" 10 #include "net/url_request/url_request_context.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 const StatusCallback& callback) { 395 const StatusCallback& callback) {
396 base::File::Error error = base::File::FILE_OK; 396 base::File::Error error = base::File::FILE_OK;
397 FileSystemOperation* operation = 397 FileSystemOperation* operation =
398 file_system_context_->CreateFileSystemOperation(dest_url, &error); 398 file_system_context_->CreateFileSystemOperation(dest_url, &error);
399 BeginOperationScoper scope; 399 BeginOperationScoper scope;
400 OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr()); 400 OperationHandle handle = BeginOperation(operation, scope.AsWeakPtr());
401 if (!operation) { 401 if (!operation) {
402 DidFinish(handle, callback, error); 402 DidFinish(handle, callback, error);
403 return handle.id; 403 return handle.id;
404 } 404 }
405 PrepareForWrite(handle.id, dest_url);
405 operation->CopyInForeignFile( 406 operation->CopyInForeignFile(
406 src_local_disk_path, dest_url, 407 src_local_disk_path, dest_url,
407 base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(), 408 base::Bind(&FileSystemOperationRunner::DidFinish, AsWeakPtr(),
408 handle, callback)); 409 handle, callback));
409 return handle.id; 410 return handle.id;
410 } 411 }
411 412
412 OperationID FileSystemOperationRunner::RemoveFile( 413 OperationID FileSystemOperationRunner::RemoveFile(
413 const FileSystemURL& url, 414 const FileSystemURL& url,
414 const StatusCallback& callback) { 415 const StatusCallback& callback) {
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 stray_cancel_callbacks_.find(id); 679 stray_cancel_callbacks_.find(id);
679 if (found_cancel != stray_cancel_callbacks_.end()) { 680 if (found_cancel != stray_cancel_callbacks_.end()) {
680 // This cancel has been requested after the operation has finished, 681 // This cancel has been requested after the operation has finished,
681 // so report that we failed to stop it. 682 // so report that we failed to stop it.
682 found_cancel->second.Run(base::File::FILE_ERROR_INVALID_OPERATION); 683 found_cancel->second.Run(base::File::FILE_ERROR_INVALID_OPERATION);
683 stray_cancel_callbacks_.erase(found_cancel); 684 stray_cancel_callbacks_.erase(found_cancel);
684 } 685 }
685 } 686 }
686 687
687 } // namespace storage 688 } // namespace storage
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698