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

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

Issue 59423002: drive: Simplify RemoveOperation with ResourceEntry::local_id (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « chrome/browser/chromeos/drive/file_system/remove_operation.h ('k') | no next file » | 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.cc
diff --git a/chrome/browser/chromeos/drive/file_system/remove_operation.cc b/chrome/browser/chromeos/drive/file_system/remove_operation.cc
index f8073f2b977a6dc759265b0297e681d7be560f5e..8990bc61ba1a693ffd8cb50ccc1d1d31a16d88b2 100644
--- a/chrome/browser/chromeos/drive/file_system/remove_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/remove_operation.cc
@@ -22,19 +22,18 @@ namespace {
// Checks local metadata state before requesting remote delete.
// |parent_resource_id| is set to the resource ID of the parent directory of
// |path|. If it is a special folder like drive/other, empty string is set.
-// |local_id| is set to the local ID of the entry located at |path|.
// |entry| is the resource entry for the |path|.
FileError CheckLocalState(internal::ResourceMetadata* metadata,
const base::FilePath& path,
bool is_recursive,
std::string* parent_resource_id,
- std::string* local_id,
ResourceEntry* entry) {
- FileError error = metadata->GetIdByPath(path, local_id);
+ std::string local_id;
+ FileError error = metadata->GetIdByPath(path, &local_id);
if (error != FILE_ERROR_OK)
return error;
- error = metadata->GetResourceEntryById(*local_id, entry);
+ error = metadata->GetResourceEntryById(local_id, entry);
if (error != FILE_ERROR_OK)
return error;
@@ -123,7 +122,6 @@ void RemoveOperation::Remove(const base::FilePath& path,
DCHECK(!callback.is_null());
std::string* parent_resource_id = new std::string;
- std::string* local_id = new std::string;
ResourceEntry* entry = new ResourceEntry;
base::PostTaskAndReplyWithResult(
blocking_task_runner_.get(),
@@ -133,20 +131,17 @@ void RemoveOperation::Remove(const base::FilePath& path,
path,
is_recursive,
parent_resource_id,
- local_id,
entry),
base::Bind(&RemoveOperation::RemoveAfterCheckLocalState,
weak_ptr_factory_.GetWeakPtr(),
callback,
base::Owned(parent_resource_id),
- base::Owned(local_id),
base::Owned(entry)));
}
void RemoveOperation::RemoveAfterCheckLocalState(
const FileOperationCallback& callback,
const std::string* parent_resource_id,
- const std::string* local_id,
const ResourceEntry* entry,
FileError error) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -173,7 +168,7 @@ void RemoveOperation::RemoveAfterCheckLocalState(
callback,
base::Bind(&UpdateLocalStateAfterUnparent,
metadata_,
- *local_id)));
+ entry->local_id())));
} else {
// Otherwise try sending the entry to trash.
scheduler_->DeleteResource(
@@ -184,7 +179,7 @@ void RemoveOperation::RemoveAfterCheckLocalState(
base::Bind(&UpdateLocalStateAfterDelete,
metadata_,
cache_,
- *local_id)));
+ entry->local_id())));
}
}
« no previous file with comments | « chrome/browser/chromeos/drive/file_system/remove_operation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698