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

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

Issue 977493002: Fix crash when syncing files on Drive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e107c8f1f6a58879332b1e951ceff0353cdac2c9..f2c5084e588f4129ff9cfc3a2dcdb8e2bfd97194 100644
--- a/chrome/browser/chromeos/drive/sync/entry_update_performer.cc
+++ b/chrome/browser/chromeos/drive/sync/entry_update_performer.cc
@@ -254,7 +254,7 @@ void EntryUpdatePerformer::UpdateEntry(const std::string& local_id,
DCHECK(!callback.is_null());
scoped_ptr<LocalState> local_state(new LocalState);
- LocalState* local_state_ptr = local_state.get();
+ LocalState* const local_state_ptr = local_state.get();
base::PostTaskAndReplyWithResult(
blocking_task_runner_.get(),
FROM_HERE,
@@ -327,11 +327,13 @@ void EntryUpdatePerformer::UpdateEntryAfterPrepare(
options.modified_date = last_modified;
options.last_viewed_by_me_date = last_accessed;
options.properties = properties;
+ LocalState* const local_state_ptr = local_state.get();
scheduler_->UploadNewFile(
- local_state->parent_entry.resource_id(), local_state->drive_file_path,
- local_state->cache_file_path, local_state->entry.title(),
- local_state->entry.file_specific_info().content_mime_type(), options,
- context,
+ local_state_ptr->parent_entry.resource_id(),
+ local_state_ptr->drive_file_path, local_state_ptr->cache_file_path,
+ local_state_ptr->entry.title(),
+ local_state_ptr->entry.file_specific_info().content_mime_type(),
+ options, context,
base::Bind(&EntryUpdatePerformer::UpdateEntryAfterUpdateResource,
weak_ptr_factory_.GetWeakPtr(), context, callback,
base::Passed(&local_state),
@@ -343,11 +345,12 @@ void EntryUpdatePerformer::UpdateEntryAfterPrepare(
options.modified_date = last_modified;
options.last_viewed_by_me_date = last_accessed;
options.properties = properties;
+ LocalState* const local_state_ptr = local_state.get();
scheduler_->UploadExistingFile(
- local_state->entry.resource_id(), local_state->drive_file_path,
- local_state->cache_file_path,
- local_state->entry.file_specific_info().content_mime_type(), options,
- context,
+ local_state_ptr->entry.resource_id(),
+ local_state_ptr->drive_file_path, local_state_ptr->cache_file_path,
+ local_state_ptr->entry.file_specific_info().content_mime_type(),
+ options, context,
base::Bind(&EntryUpdatePerformer::UpdateEntryAfterUpdateResource,
weak_ptr_factory_.GetWeakPtr(), context, callback,
base::Passed(&local_state),
@@ -367,9 +370,10 @@ void EntryUpdatePerformer::UpdateEntryAfterPrepare(
options.modified_date = last_modified;
options.last_viewed_by_me_date = last_accessed;
options.properties = properties;
+ LocalState* const local_state_ptr = local_state.get();
scheduler_->AddNewDirectory(
- local_state->parent_entry.resource_id(), local_state->entry.title(),
- options, context,
+ local_state_ptr->parent_entry.resource_id(),
+ local_state_ptr->entry.title(), options, context,
base::Bind(&EntryUpdatePerformer::UpdateEntryAfterUpdateResource,
weak_ptr_factory_.GetWeakPtr(), context, callback,
base::Passed(&local_state), base::Passed(&loader_lock)));
@@ -384,9 +388,11 @@ void EntryUpdatePerformer::UpdateEntryAfterPrepare(
}
// Perform metadata update.
+ LocalState* const local_state_ptr = local_state.get();
scheduler_->UpdateResource(
- local_state->entry.resource_id(), local_state->parent_entry.resource_id(),
- local_state->entry.title(), last_modified, last_accessed, properties,
+ local_state_ptr->entry.resource_id(),
+ local_state_ptr->parent_entry.resource_id(),
+ local_state_ptr->entry.title(), last_modified, last_accessed, properties,
context,
base::Bind(&EntryUpdatePerformer::UpdateEntryAfterUpdateResource,
weak_ptr_factory_.GetWeakPtr(), context, callback,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698