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

Unified Diff: chrome/browser/chromeos/drive/file_system/remove_operation.h

Issue 16094003: drive: Respect is_recursive parameter in RemoveOperation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DriveFileSystemExtensionApiTest Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/file_system/remove_operation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/file_system/remove_operation.h
diff --git a/chrome/browser/chromeos/drive/file_system/remove_operation.h b/chrome/browser/chromeos/drive/file_system/remove_operation.h
index d8c29ee9fda07604d07c27d79066c169382b0d7f..679becd735483d9530cea756887de2ea18c5a3e7 100644
--- a/chrome/browser/chromeos/drive/file_system/remove_operation.h
+++ b/chrome/browser/chromeos/drive/file_system/remove_operation.h
@@ -9,6 +9,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/drive/file_errors.h"
+#include "chrome/browser/chromeos/drive/file_system_interface.h"
#include "chrome/browser/google_apis/gdata_errorcode.h"
namespace base {
@@ -40,27 +41,38 @@ class RemoveOperation {
internal::FileCache* cache);
~RemoveOperation();
- // Perform the remove operation on the file at drive path |file_path|.
- // Invokes |callback| when finished with the result of the operation.
+ // Removes the resource at |path|. If |path| is a directory and |is_recursive|
+ // is set, it recursively removes all the descendants. If |is_recursive| is
+ // not set, it succeeds only when the directory is empty.
+ //
// |callback| must not be null.
- void Remove(const base::FilePath& file_path,
+ void Remove(const base::FilePath& path,
bool is_recursive,
const FileOperationCallback& callback);
private:
// Part of Remove(). Called after GetResourceEntryByPath() is complete.
- void RemoveAfterGetResourceEntry(const FileOperationCallback& callback,
+ void RemoveAfterGetResourceEntry(const base::FilePath& path,
+ bool is_recursive,
+ const FileOperationCallback& callback,
FileError error,
scoped_ptr<ResourceEntry> entry);
- // Callback for DriveServiceInterface::DeleteResource. Removes the entry with
- // |resource_id| from the local snapshot of the filesystem and the cache.
+ // Part of Remove(). Called when is_recursive = false and trying to remove
+ // a directory. In this case the emptiness of directory must be checked.
+ void RemoveAfterReadDirectory(const std::string& resource_id,
+ const FileOperationCallback& callback,
+ FileError error,
+ scoped_ptr<ResourceEntryVector> entries);
+
+ // Part of Remove(). Called after server-side removal is done. Removes the
+ // entry with |resource_id| from the resource metadata and the cache.
void RemoveResourceLocally(const FileOperationCallback& callback,
const std::string& resource_id,
google_apis::GDataErrorCode status);
- // Sends notification for directory changes. Notifies of directory changes,
- // and runs |callback| with |error|.
+ // Part of Remove(). Sends notification for directory changes, and runs
+ // |callback| with |error|.
void NotifyDirectoryChanged(const FileOperationCallback& callback,
FileError error,
const base::FilePath& directory_path);
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/file_system/remove_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698