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

Unified Diff: chrome/browser/chromeos/drive/sync/entry_update_performer.cc

Issue 321753002: drive: Stop returning ResourceEntry from JobScheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/sync/entry_update_performer.cc
diff --git a/chrome/browser/chromeos/drive/sync/entry_update_performer.cc b/chrome/browser/chromeos/drive/sync/entry_update_performer.cc
index 9b3aa56aa08e705968aa858faa3307a9c8fb56f6..9ca9139c18b30d8161f10b4c8db54fc2ce9c7d49 100644
--- a/chrome/browser/chromeos/drive/sync/entry_update_performer.cc
+++ b/chrome/browser/chromeos/drive/sync/entry_update_performer.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/chromeos/drive/sync/entry_revert_performer.h"
#include "chrome/browser/chromeos/drive/sync/remove_performer.h"
#include "content/public/browser/browser_thread.h"
+#include "google_apis/drive/drive_api_parser.h"
#include "google_apis/drive/gdata_wapi_parser.h"
using content::BrowserThread;
@@ -117,13 +118,13 @@ FileError PrepareUpdate(ResourceMetadata* metadata,
FileError FinishUpdate(ResourceMetadata* metadata,
FileCache* cache,
const std::string& local_id,
- scoped_ptr<google_apis::ResourceEntry> resource_entry,
+ scoped_ptr<google_apis::FileResource> file_resource,
base::FilePath* changed_directory) {
// When creating new entries, update check may add a new entry with the same
// resource ID before us. If such an entry exists, remove it.
std::string existing_local_id;
FileError error = metadata->GetIdByResourceId(
- resource_entry->resource_id(), &existing_local_id);
+ file_resource->file_id(), &existing_local_id);
switch (error) {
case FILE_ERROR_OK:
if (existing_local_id != local_id) {
@@ -159,8 +160,8 @@ FileError FinishUpdate(ResourceMetadata* metadata,
break;
}
if (!entry.file_info().is_directory())
- entry.mutable_file_specific_info()->set_md5(resource_entry->file_md5());
- entry.set_resource_id(resource_entry->resource_id());
+ entry.mutable_file_specific_info()->set_md5(file_resource->md5_checksum());
+ entry.set_resource_id(file_resource->file_id());
error = metadata->RefreshEntry(entry);
if (error != FILE_ERROR_OK)
return error;
@@ -352,7 +353,7 @@ void EntryUpdatePerformer::UpdateEntryAfterUpdateResource(
const std::string& local_id,
scoped_ptr<base::ScopedClosureRunner> loader_lock,
google_apis::GDataErrorCode status,
- scoped_ptr<google_apis::ResourceEntry> resource_entry) {
+ scoped_ptr<google_apis::FileResource> entry) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!callback.is_null());
@@ -373,7 +374,7 @@ void EntryUpdatePerformer::UpdateEntryAfterUpdateResource(
blocking_task_runner_.get(),
FROM_HERE,
base::Bind(&FinishUpdate,
- metadata_, cache_, local_id, base::Passed(&resource_entry),
+ metadata_, cache_, local_id, base::Passed(&entry),
changed_directory),
base::Bind(&EntryUpdatePerformer::UpdateEntryAfterFinish,
weak_ptr_factory_.GetWeakPtr(), callback,
« no previous file with comments | « chrome/browser/chromeos/drive/sync/entry_update_performer.h ('k') | chrome/browser/chromeos/drive/sync/remove_performer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698