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/sync_file_system/drive_file_sync_service.h" | 5 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
763 typedef ScopedVector<google_apis::ResourceEntry>::const_iterator iterator; | 763 typedef ScopedVector<google_apis::ResourceEntry>::const_iterator iterator; |
764 for (iterator itr = feed->entries().begin(); | 764 for (iterator itr = feed->entries().begin(); |
765 itr != feed->entries().end(); ++itr) { | 765 itr != feed->entries().end(); ++itr) { |
766 const google_apis::ResourceEntry& entry = **itr; | 766 const google_apis::ResourceEntry& entry = **itr; |
767 AppendRemoteChange(origin, entry, largest_changestamp, | 767 AppendRemoteChange(origin, entry, largest_changestamp, |
768 RemoteChangeHandler::REMOTE_SYNC_TYPE_BATCH); | 768 RemoteChangeHandler::REMOTE_SYNC_TYPE_BATCH); |
769 | 769 |
770 // Save to be fetched file to DB for restore in case of crash. | 770 // Save to be fetched file to DB for restore in case of crash. |
771 DriveMetadata metadata; | 771 DriveMetadata metadata; |
772 metadata.set_resource_id(entry.resource_id()); | 772 metadata.set_resource_id(entry.resource_id()); |
773 metadata.set_md5_checksum(entry.file_md5()); | 773 metadata.set_md5_checksum(std::string()); |
calvinlo
2013/05/29 06:39:00
While this change works, I think it's honestly qui
tzik
2013/05/29 07:08:11
This does not need .cc impl, but needs the documen
calvinlo
2013/05/29 07:50:09
I'm not sure that I agree. Right now the function
| |
774 metadata.set_conflicted(false); | 774 metadata.set_conflicted(false); |
775 metadata.set_to_be_fetched(true); | 775 metadata.set_to_be_fetched(true); |
kinuko
2013/05/29 06:34:28
Question... if to_be_fetched==true should md5_chec
tzik
2013/05/29 06:41:53
Yes, we should check it.
I think the best places a
calvinlo
2013/05/29 07:50:09
If you go this route, I think it'd also be a good
| |
776 | 776 |
777 base::FilePath path = TitleToPath(entry.title()); | 777 base::FilePath path = TitleToPath(entry.title()); |
778 fileapi::FileSystemURL url(CreateSyncableFileSystemURL( | 778 fileapi::FileSystemURL url(CreateSyncableFileSystemURL( |
779 origin, kServiceName, path)); | 779 origin, kServiceName, path)); |
780 // TODO(calvinlo): Write metadata and origin data as single batch command | 780 // TODO(calvinlo): Write metadata and origin data as single batch command |
781 // so it's not possible for the DB to contain a DriveMetadata with an | 781 // so it's not possible for the DB to contain a DriveMetadata with an |
782 // unknown origin. | 782 // unknown origin. |
783 metadata_store_->UpdateEntry(url, metadata, | 783 metadata_store_->UpdateEntry(url, metadata, |
784 base::Bind(&EmptyStatusCallback)); | 784 base::Bind(&EmptyStatusCallback)); |
785 } | 785 } |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1734 metadata_store_->SetOriginRootDirectory(origin, resource_id); | 1734 metadata_store_->SetOriginRootDirectory(origin, resource_id); |
1735 } | 1735 } |
1736 callback.Run(status, resource_id); | 1736 callback.Run(status, resource_id); |
1737 } | 1737 } |
1738 | 1738 |
1739 std::string DriveFileSyncService::sync_root_resource_id() { | 1739 std::string DriveFileSyncService::sync_root_resource_id() { |
1740 return metadata_store_->sync_root_directory(); | 1740 return metadata_store_->sync_root_directory(); |
1741 } | 1741 } |
1742 | 1742 |
1743 } // namespace sync_file_system | 1743 } // namespace sync_file_system |
OLD | NEW |