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

Unified Diff: chrome/browser/chromeos/drive/resource_metadata.cc

Issue 16107004: drive: Stop returning FilePath from GetResourceEntryById (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
Index: chrome/browser/chromeos/drive/resource_metadata.cc
diff --git a/chrome/browser/chromeos/drive/resource_metadata.cc b/chrome/browser/chromeos/drive/resource_metadata.cc
index 4220d22943df76c13db1fe670ea6e5ceaa35edae..f1754046f420692732d2da6197b0e1f13b21039f 100644
--- a/chrome/browser/chromeos/drive/resource_metadata.cc
+++ b/chrome/browser/chromeos/drive/resource_metadata.cc
@@ -390,11 +390,10 @@ FileError ResourceMetadata::RemoveEntry(const std::string& resource_id,
void ResourceMetadata::GetResourceEntryByIdOnUIThread(
const std::string& resource_id,
- const GetResourceEntryWithFilePathCallback& callback) {
+ const GetResourceEntryCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
- base::FilePath* file_path = new base::FilePath;
scoped_ptr<ResourceEntry> entry(new ResourceEntry);
ResourceEntry* entry_ptr = entry.get();
base::PostTaskAndReplyWithResult(
@@ -403,30 +402,24 @@ void ResourceMetadata::GetResourceEntryByIdOnUIThread(
base::Bind(&ResourceMetadata::GetResourceEntryById,
base::Unretained(this),
resource_id,
- file_path,
entry_ptr),
- base::Bind(&RunGetResourceEntryWithFilePathCallback,
+ base::Bind(&RunGetResourceEntryCallback,
callback,
- base::Owned(file_path),
base::Passed(&entry)));
}
FileError ResourceMetadata::GetResourceEntryById(
const std::string& resource_id,
- base::FilePath* out_file_path,
ResourceEntry* out_entry) {
DCHECK(blocking_task_runner_->RunsTasksOnCurrentThread());
DCHECK(!resource_id.empty());
+ DCHECK(out_entry);
scoped_ptr<ResourceEntry> entry = storage_->GetEntry(resource_id);
if (!entry)
return FILE_ERROR_NOT_FOUND;
- if (out_file_path)
- *out_file_path = GetFilePath(resource_id);
- if (out_entry)
- *out_entry = *entry;
-
+ out_entry->Swap(entry.get());
return FILE_ERROR_OK;
}
« no previous file with comments | « chrome/browser/chromeos/drive/resource_metadata.h ('k') | chrome/browser/chromeos/drive/resource_metadata_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698