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/gdata/gdata_file_system.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1045 webapps_registry_->UpdateFromFeed(account_metadata.get()); | 1045 webapps_registry_->UpdateFromFeed(account_metadata.get()); |
1046 | 1046 |
1047 bool changes_detected = true; | 1047 bool changes_detected = true; |
1048 if (local_changestamp >= account_metadata->largest_changestamp()) { | 1048 if (local_changestamp >= account_metadata->largest_changestamp()) { |
1049 if (local_changestamp > account_metadata->largest_changestamp()) { | 1049 if (local_changestamp > account_metadata->largest_changestamp()) { |
1050 LOG(WARNING) << "Cached client feed is fresher than server, client = " | 1050 LOG(WARNING) << "Cached client feed is fresher than server, client = " |
1051 << local_changestamp | 1051 << local_changestamp |
1052 << ", server = " | 1052 << ", server = " |
1053 << account_metadata->largest_changestamp(); | 1053 << account_metadata->largest_changestamp(); |
1054 } | 1054 } |
1055 directory_service_->set_origin(initial_origin); | 1055 // If our cache holds the latest state from the server, change the |
| 1056 // state to FROM_SERVER. |
| 1057 directory_service_->set_origin( |
| 1058 initial_origin == FROM_CACHE ? FROM_SERVER : initial_origin); |
1056 changes_detected = false; | 1059 changes_detected = false; |
1057 } | 1060 } |
1058 | 1061 |
1059 // No changes detected, continue with search as planned. | 1062 // No changes detected, continue with search as planned. |
1060 if (!changes_detected) { | 1063 if (!changes_detected) { |
1061 if (!callback.is_null()) | 1064 if (!callback.is_null()) |
1062 FindEntryByPathSyncOnUIThread(search_file_path, callback); | 1065 FindEntryByPathSyncOnUIThread(search_file_path, callback); |
1063 return; | 1066 return; |
1064 } | 1067 } |
1065 | 1068 |
(...skipping 3201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4267 } | 4270 } |
4268 | 4271 |
4269 PlatformFileInfoProto entry_file_info; | 4272 PlatformFileInfoProto entry_file_info; |
4270 GDataEntry::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); | 4273 GDataEntry::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); |
4271 *entry_proto->mutable_file_info() = entry_file_info; | 4274 *entry_proto->mutable_file_info() = entry_file_info; |
4272 if (!callback.is_null()) | 4275 if (!callback.is_null()) |
4273 callback.Run(GDATA_FILE_OK, entry_proto.Pass()); | 4276 callback.Run(GDATA_FILE_OK, entry_proto.Pass()); |
4274 } | 4277 } |
4275 | 4278 |
4276 } // namespace gdata | 4279 } // namespace gdata |
OLD | NEW |