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

Side by Side Diff: webkit/fileapi/file_system_operation.cc

Issue 3567012: Support removeRecursively and new copy/move behaviors for FileSystem API (Closed)
Patch Set: '' Created 10 years, 2 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/fileapi/file_system_operation.h" 5 #include "webkit/fileapi/file_system_operation.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "webkit/fileapi/file_system_callback_dispatcher.h" 9 #include "webkit/fileapi/file_system_callback_dispatcher.h"
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 #ifndef NDEBUG 110 #ifndef NDEBUG
111 DCHECK(!operation_pending_); 111 DCHECK(!operation_pending_);
112 operation_pending_ = true; 112 operation_pending_ = true;
113 #endif 113 #endif
114 114
115 base::FileUtilProxy::ReadDirectory(proxy_, path, 115 base::FileUtilProxy::ReadDirectory(proxy_, path,
116 callback_factory_.NewCallback( 116 callback_factory_.NewCallback(
117 &FileSystemOperation::DidReadDirectory)); 117 &FileSystemOperation::DidReadDirectory));
118 } 118 }
119 119
120 void FileSystemOperation::Remove(const FilePath& path) { 120 void FileSystemOperation::Remove(const FilePath& path, bool recursive) {
121 #ifndef NDEBUG 121 #ifndef NDEBUG
122 DCHECK(!operation_pending_); 122 DCHECK(!operation_pending_);
123 operation_pending_ = true; 123 operation_pending_ = true;
124 #endif 124 #endif
125 125
126 base::FileUtilProxy::Delete(proxy_, path, callback_factory_.NewCallback( 126 base::FileUtilProxy::Delete(proxy_, path, recursive,
127 &FileSystemOperation::DidFinishFileOperation)); 127 callback_factory_.NewCallback(
128 &FileSystemOperation::DidFinishFileOperation));
128 } 129 }
129 130
130 void FileSystemOperation::Write( 131 void FileSystemOperation::Write(
131 const FilePath&, 132 const FilePath&,
132 const GURL&, 133 const GURL&,
133 int64) { 134 int64) {
134 #ifndef NDEBUG 135 #ifndef NDEBUG
135 DCHECK(!operation_pending_); 136 DCHECK(!operation_pending_);
136 operation_pending_ = true; 137 operation_pending_ = true;
137 #endif 138 #endif
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 } 257 }
257 258
258 void FileSystemOperation::DidTouchFile(base::PlatformFileError rv) { 259 void FileSystemOperation::DidTouchFile(base::PlatformFileError rv) {
259 if (rv == base::PLATFORM_FILE_OK) 260 if (rv == base::PLATFORM_FILE_OK)
260 dispatcher_->DidSucceed(); 261 dispatcher_->DidSucceed();
261 else 262 else
262 dispatcher_->DidFail(rv); 263 dispatcher_->DidFail(rv);
263 } 264 }
264 265
265 } // namespace fileapi 266 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_operation.h ('k') | webkit/fileapi/file_system_operation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698