| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |