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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_file_system.cc

Issue 10836005: gdata: Periodic refresh should be active for file lists loaded from cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + Typo fix. Created 8 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698