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

Side by Side Diff: chrome/browser/sync/sessions/status_controller.cc

Issue 7477004: Simulate transient error and verify exponential backoff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/sessions/status_controller.h" 5 #include "chrome/browser/sync/sessions/status_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "chrome/browser/sync/syncable/model_type.h" 10 #include "chrome/browser/sync/syncable/model_type.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 if (shared_.syncer_status.value().invalid_store != invalid_store) 99 if (shared_.syncer_status.value().invalid_store != invalid_store)
100 shared_.syncer_status.mutate()->invalid_store = invalid_store; 100 shared_.syncer_status.mutate()->invalid_store = invalid_store;
101 } 101 }
102 102
103 void StatusController::set_syncer_stuck(bool syncer_stuck) { 103 void StatusController::set_syncer_stuck(bool syncer_stuck) {
104 if (shared_.syncer_status.value().syncer_stuck != syncer_stuck) 104 if (shared_.syncer_status.value().syncer_stuck != syncer_stuck)
105 shared_.syncer_status.mutate()->syncer_stuck = syncer_stuck; 105 shared_.syncer_status.mutate()->syncer_stuck = syncer_stuck;
106 } 106 }
107 107
108 void StatusController::set_syncing(bool syncing) { 108 void StatusController::set_syncing(bool syncing) {
109 if (shared_.syncer_status.value().syncing != syncing) 109 if (shared_.syncer_status.value().syncing != syncing) {
110 shared_.syncer_status.mutate()->syncing = syncing; 110 shared_.syncer_status.mutate()->syncing = syncing;
111 sync_start_time_ = base::Time::Now();
112 }
111 } 113 }
112 114
113 void StatusController::set_num_successful_bookmark_commits(int value) { 115 void StatusController::set_num_successful_bookmark_commits(int value) {
114 if (shared_.syncer_status.value().num_successful_bookmark_commits != value) 116 if (shared_.syncer_status.value().num_successful_bookmark_commits != value)
115 shared_.syncer_status.mutate()->num_successful_bookmark_commits = value; 117 shared_.syncer_status.mutate()->num_successful_bookmark_commits = value;
116 } 118 }
117 119
118 void StatusController::set_unsynced_handles( 120 void StatusController::set_unsynced_handles(
119 const std::vector<int64>& unsynced_handles) { 121 const std::vector<int64>& unsynced_handles) {
120 if (!operator==(unsynced_handles, shared_.unsynced_handles.value())) { 122 if (!operator==(unsynced_handles, shared_.unsynced_handles.value())) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 NOTREACHED(); // Server should always send changes remaining. 230 NOTREACHED(); // Server should always send changes remaining.
229 return false; // Avoid looping forever. 231 return false; // Avoid looping forever.
230 } 232 }
231 // Changes remaining is an estimate, but if it's estimated to be 233 // Changes remaining is an estimate, but if it's estimated to be
232 // zero, that's firm and we don't have to ask again. 234 // zero, that's firm and we don't have to ask again.
233 return updates_response().get_updates().changes_remaining() == 0; 235 return updates_response().get_updates().changes_remaining() == 0;
234 } 236 }
235 237
236 } // namespace sessions 238 } // namespace sessions
237 } // namespace browser_sync 239 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698