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

Side by Side Diff: chrome/browser/chromeos/drive/sync/entry_update_performer.cc

Issue 391343002: Keep sync tasks alive as long as it's not finished (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/drive/sync/entry_update_performer.h" 5 #include "chrome/browser/chromeos/drive/sync/entry_update_performer.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "chrome/browser/chromeos/drive/change_list_loader.h" 9 #include "chrome/browser/chromeos/drive/change_list_loader.h"
10 #include "chrome/browser/chromeos/drive/drive.pb.h" 10 #include "chrome/browser/chromeos/drive/drive.pb.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // Trashed entry should be removed. 247 // Trashed entry should be removed.
248 if (local_state->entry.parent_local_id() == util::kDriveTrashDirLocalId) { 248 if (local_state->entry.parent_local_id() == util::kDriveTrashDirLocalId) {
249 remove_performer_->Remove(local_state->entry.local_id(), context, callback); 249 remove_performer_->Remove(local_state->entry.local_id(), context, callback);
250 return; 250 return;
251 } 251 }
252 252
253 // Parent was locally created and needs update. Just return for now. 253 // Parent was locally created and needs update. Just return for now.
254 // This entry should be updated again after the parent update completes. 254 // This entry should be updated again after the parent update completes.
255 if (local_state->parent_entry.resource_id().empty() && 255 if (local_state->parent_entry.resource_id().empty() &&
256 local_state->parent_entry.metadata_edit_state() != ResourceEntry::CLEAN) { 256 local_state->parent_entry.metadata_edit_state() != ResourceEntry::CLEAN) {
257 callback.Run(FILE_ERROR_OK); 257 callback.Run(FILE_ERROR_PARENT_NEEDS_TO_BE_SYNCED);
258 return; 258 return;
259 } 259 }
260 260
261 base::Time last_modified = base::Time::FromInternalValue( 261 base::Time last_modified = base::Time::FromInternalValue(
262 local_state->entry.file_info().last_modified()); 262 local_state->entry.file_info().last_modified());
263 base::Time last_accessed = base::Time::FromInternalValue( 263 base::Time last_accessed = base::Time::FromInternalValue(
264 local_state->entry.file_info().last_accessed()); 264 local_state->entry.file_info().last_accessed());
265 265
266 // Perform content update. 266 // Perform content update.
267 if (local_state->should_content_update) { 267 if (local_state->should_content_update) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 FileError error) { 397 FileError error) {
398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
399 DCHECK(!callback.is_null()); 399 DCHECK(!callback.is_null());
400 400
401 observer_->OnFileChangedByOperation(*changed_files); 401 observer_->OnFileChangedByOperation(*changed_files);
402 callback.Run(error); 402 callback.Run(error);
403 } 403 }
404 404
405 } // namespace internal 405 } // namespace internal
406 } // namespace drive 406 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698