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

Unified Diff: chrome/browser/sync/sessions/status_controller.h

Issue 1161006: Make it clear what last_sync_timestamp actually tracks. Update (Closed)
Patch Set: Undo accidental patch-juggling mistake. Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/sessions/session_state.h ('k') | chrome/browser/sync/sessions/status_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sessions/status_controller.h
diff --git a/chrome/browser/sync/sessions/status_controller.h b/chrome/browser/sync/sessions/status_controller.h
index 93287cf91d588d712cfe5fe17b094b8e9e149f1b..87d30df33d11e2de13d707b37e79c5623a843b0a 100644
--- a/chrome/browser/sync/sessions/status_controller.h
+++ b/chrome/browser/sync/sessions/status_controller.h
@@ -82,7 +82,7 @@ class StatusController {
ClientToServerResponse* mutable_commit_response() {
return &shared_.commit_response;
}
- const ClientToServerResponse& updates_response() {
+ const ClientToServerResponse& updates_response() const {
return shared_.updates_response;
}
ClientToServerResponse* mutable_updates_response() {
@@ -135,9 +135,6 @@ class StatusController {
bool conflicts_resolved() const {
return shared_.control_params.conflicts_resolved;
}
- bool got_new_timestamp() const {
- return shared_.control_params.got_new_timestamp;
- }
bool did_commit_items() const {
return shared_.control_params.items_committed;
}
@@ -159,7 +156,23 @@ class StatusController {
return shared_.commit_set.HasBookmarkCommitId();
}
- bool got_zero_updates() const { return CountUpdates() == 0; }
+ // Returns true if the last download_updates_command received a valid
+ // server response.
+ bool download_updates_succeeded() const {
+ return updates_response().has_get_updates();
+ }
+
+ // Returns true if the last updates response indicated that we were fully
+ // up to date. This is subtle: if it's false, it could either mean that
+ // the server said there WAS more to download, or it could mean that we
+ // were unable to reach the server.
+ bool server_says_nothing_more_to_download() const {
+ if (!download_updates_succeeded())
+ return false;
+ // The server indicates "you're up to date" by not sending a new
+ // timestamp.
+ return !updates_response().get_updates().has_new_timestamp();
+ }
ModelSafeGroup group_restriction() const {
return group_restriction_;
@@ -173,7 +186,6 @@ class StatusController {
void set_num_consecutive_errors(int value);
void increment_num_consecutive_errors();
void increment_num_consecutive_errors_by(int value);
- void set_got_new_timestamp();
void set_current_sync_timestamp(syncable::ModelType model,
int64 current_timestamp);
void set_num_server_changes_remaining(int64 changes_remaining);
« no previous file with comments | « chrome/browser/sync/sessions/session_state.h ('k') | chrome/browser/sync/sessions/status_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698