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

Side by Side Diff: chrome/browser/chromeos/drive/sync_client.cc

Issue 98513003: drive: Support offline move/rename (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_client.h" 5 #include "chrome/browser/chromeos/drive/sync_client.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 scoped_ptr<ResourceMetadata::Iterator> it = metadata->GetIterator(); 57 scoped_ptr<ResourceMetadata::Iterator> it = metadata->GetIterator();
58 for (; !it->IsAtEnd(); it->Advance()) { 58 for (; !it->IsAtEnd(); it->Advance()) {
59 const std::string& local_id = it->GetID(); 59 const std::string& local_id = it->GetID();
60 const ResourceEntry& entry = it->GetValue(); 60 const ResourceEntry& entry = it->GetValue();
61 if (entry.parent_local_id() == util::kDriveTrashDirLocalId) { 61 if (entry.parent_local_id() == util::kDriveTrashDirLocalId) {
62 to_update->push_back(local_id); 62 to_update->push_back(local_id);
63 continue; 63 continue;
64 } 64 }
65 65
66 switch (entry.metadata_edit_state()) {
67 case ResourceEntry::CLEAN:
68 break;
69 case ResourceEntry::SYNCING:
70 case ResourceEntry::DIRTY:
71 to_update->push_back(local_id);
72 break;
73 }
74
66 FileCacheEntry cache_entry; 75 FileCacheEntry cache_entry;
67 if (it->GetCacheEntry(&cache_entry)) { 76 if (it->GetCacheEntry(&cache_entry)) {
68 if (cache_entry.is_pinned() && !cache_entry.is_present()) 77 if (cache_entry.is_pinned() && !cache_entry.is_present())
69 to_fetch->push_back(local_id); 78 to_fetch->push_back(local_id);
70 79
71 if (cache_entry.is_dirty()) 80 if (cache_entry.is_dirty())
72 to_upload->push_back(local_id); 81 to_upload->push_back(local_id);
73 } 82 }
74 } 83 }
75 DCHECK(!it->HasError()); 84 DCHECK(!it->HasError());
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 break; 435 break;
427 default: 436 default:
428 LOG(WARNING) << "Failed to update " << local_id << ": " 437 LOG(WARNING) << "Failed to update " << local_id << ": "
429 << FileErrorToString(error); 438 << FileErrorToString(error);
430 } 439 }
431 } 440 }
432 } 441 }
433 442
434 } // namespace internal 443 } // namespace internal
435 } // namespace drive 444 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/sync/entry_update_performer.cc ('k') | chrome/browser/chromeos/drive/sync_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698