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

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

Issue 59433002: drive: Simplify TouchOperation 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/touch_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/touch_operation.cc
diff --git a/chrome/browser/chromeos/drive/file_system/touch_operation.cc b/chrome/browser/chromeos/drive/file_system/touch_operation.cc
index feaa5c0d29ed8ec2343fbf04ba0ec545360d56f6..068b38f3d8d13265063450075b583d3307a78db3 100644
--- a/chrome/browser/chromeos/drive/file_system/touch_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/touch_operation.cc
@@ -23,17 +23,6 @@ namespace file_system {
namespace {
-// Returns ResourceEntry and the local ID of the entry at the given path.
-FileError GetResourceEntryAndIdByPath(internal::ResourceMetadata* metadata,
- const base::FilePath& file_path,
- std::string* local_id,
- ResourceEntry* entry) {
- FileError error = metadata->GetIdByPath(file_path, local_id);
- if (error != FILE_ERROR_OK)
- return error;
- return metadata->GetResourceEntryById(*local_id, entry);
-}
-
// Refreshes the entry specified by |local_id| with the contents of
// |resource_entry|.
FileError RefreshEntry(internal::ResourceMetadata* metadata,
@@ -88,21 +77,18 @@ void TouchOperation::TouchFile(const base::FilePath& file_path,
DCHECK(!callback.is_null());
ResourceEntry* entry = new ResourceEntry;
- std::string* local_id = new std::string;
base::PostTaskAndReplyWithResult(
blocking_task_runner_.get(),
FROM_HERE,
- base::Bind(&GetResourceEntryAndIdByPath,
+ base::Bind(&internal::ResourceMetadata::GetResourceEntryByPath,
base::Unretained(metadata_),
file_path,
- local_id,
entry),
base::Bind(&TouchOperation::TouchFileAfterGetResourceEntry,
weak_ptr_factory_.GetWeakPtr(),
last_access_time,
last_modified_time,
callback,
- base::Owned(local_id),
base::Owned(entry)));
}
@@ -110,7 +96,6 @@ void TouchOperation::TouchFileAfterGetResourceEntry(
const base::Time& last_access_time,
const base::Time& last_modified_time,
const FileOperationCallback& callback,
- std::string* local_id,
ResourceEntry* entry,
FileError error) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -128,7 +113,7 @@ void TouchOperation::TouchFileAfterGetResourceEntry(
entry->resource_id(), last_modified_time, last_access_time,
base::Bind(&TouchOperation::TouchFileAfterServerTimeStampUpdated,
weak_ptr_factory_.GetWeakPtr(),
- *local_id, callback));
+ entry->local_id(), callback));
}
void TouchOperation::TouchFileAfterServerTimeStampUpdated(
« no previous file with comments | « chrome/browser/chromeos/drive/file_system/touch_operation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698