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

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

Issue 7477004: Simulate transient error and verify exponential backoff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Upload before commit. 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/session_state.h" 5 #include "chrome/browser/sync/sessions/session_state.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 29 matching lines...) Expand all
40 DictionaryValue* value = new DictionaryValue(); 40 DictionaryValue* value = new DictionaryValue();
41 value->SetString("updatesSource", 41 value->SetString("updatesSource",
42 GetUpdatesSourceString(updates_source)); 42 GetUpdatesSourceString(updates_source));
43 value->Set("types", syncable::ModelTypePayloadMapToValue(types)); 43 value->Set("types", syncable::ModelTypePayloadMapToValue(types));
44 return value; 44 return value;
45 } 45 }
46 46
47 SyncerStatus::SyncerStatus() 47 SyncerStatus::SyncerStatus()
48 : invalid_store(false), 48 : invalid_store(false),
49 syncer_stuck(false), 49 syncer_stuck(false),
50 syncing(false), 50 sync_in_progress(false),
51 num_successful_commits(0), 51 num_successful_commits(0),
52 num_successful_bookmark_commits(0), 52 num_successful_bookmark_commits(0),
53 num_updates_downloaded_total(0), 53 num_updates_downloaded_total(0),
54 num_tombstone_updates_downloaded_total(0), 54 num_tombstone_updates_downloaded_total(0),
55 num_local_overwrites(0), 55 num_local_overwrites(0),
56 num_server_overwrites(0) { 56 num_server_overwrites(0) {
57 } 57 }
58 58
59 SyncerStatus::~SyncerStatus() { 59 SyncerStatus::~SyncerStatus() {
60 } 60 }
61 61
62 DictionaryValue* SyncerStatus::ToValue() const { 62 DictionaryValue* SyncerStatus::ToValue() const {
63 DictionaryValue* value = new DictionaryValue(); 63 DictionaryValue* value = new DictionaryValue();
64 value->SetBoolean("invalidStore", invalid_store); 64 value->SetBoolean("invalidStore", invalid_store);
65 value->SetBoolean("syncerStuck", syncer_stuck); 65 value->SetBoolean("syncerStuck", syncer_stuck);
66 value->SetBoolean("syncing", syncing); 66 value->SetBoolean("syncInProgress", sync_in_progress);
67 value->SetInteger("numSuccessfulCommits", num_successful_commits); 67 value->SetInteger("numSuccessfulCommits", num_successful_commits);
68 value->SetInteger("numSuccessfulBookmarkCommits", 68 value->SetInteger("numSuccessfulBookmarkCommits",
69 num_successful_bookmark_commits); 69 num_successful_bookmark_commits);
70 value->SetInteger("numUpdatesDownloadedTotal", 70 value->SetInteger("numUpdatesDownloadedTotal",
71 num_updates_downloaded_total); 71 num_updates_downloaded_total);
72 value->SetInteger("numTombstoneUpdatesDownloadedTotal", 72 value->SetInteger("numTombstoneUpdatesDownloadedTotal",
73 num_tombstone_updates_downloaded_total); 73 num_tombstone_updates_downloaded_total);
74 value->SetInteger("numLocalOverwrites", num_local_overwrites); 74 value->SetInteger("numLocalOverwrites", num_local_overwrites);
75 value->SetInteger("numServerOverwrites", num_server_overwrites); 75 value->SetInteger("numServerOverwrites", num_server_overwrites);
76 return value; 76 return value;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 const syncable::ModelTypeBitSet& initial_sync_ended, 117 const syncable::ModelTypeBitSet& initial_sync_ended,
118 const std::string 118 const std::string
119 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT], 119 (&download_progress_markers)[syncable::MODEL_TYPE_COUNT],
120 bool more_to_sync, 120 bool more_to_sync,
121 bool is_silenced, 121 bool is_silenced,
122 int64 unsynced_count, 122 int64 unsynced_count,
123 int num_blocking_conflicting_updates, 123 int num_blocking_conflicting_updates,
124 int num_conflicting_updates, 124 int num_conflicting_updates,
125 bool did_commit_items, 125 bool did_commit_items,
126 const SyncSourceInfo& source, 126 const SyncSourceInfo& source,
127 size_t num_entries) 127 size_t num_entries,
128 base::Time sync_start_time)
128 : syncer_status(syncer_status), 129 : syncer_status(syncer_status),
129 errors(errors), 130 errors(errors),
130 num_server_changes_remaining(num_server_changes_remaining), 131 num_server_changes_remaining(num_server_changes_remaining),
131 is_share_usable(is_share_usable), 132 is_share_usable(is_share_usable),
132 initial_sync_ended(initial_sync_ended), 133 initial_sync_ended(initial_sync_ended),
133 download_progress_markers(), 134 download_progress_markers(),
134 has_more_to_sync(more_to_sync), 135 has_more_to_sync(more_to_sync),
135 is_silenced(is_silenced), 136 is_silenced(is_silenced),
136 unsynced_count(unsynced_count), 137 unsynced_count(unsynced_count),
137 num_blocking_conflicting_updates(num_blocking_conflicting_updates), 138 num_blocking_conflicting_updates(num_blocking_conflicting_updates),
138 num_conflicting_updates(num_conflicting_updates), 139 num_conflicting_updates(num_conflicting_updates),
139 did_commit_items(did_commit_items), 140 did_commit_items(did_commit_items),
140 source(source), 141 source(source),
141 num_entries(num_entries){ 142 num_entries(num_entries),
143 sync_start_time(sync_start_time) {
142 for (int i = syncable::FIRST_REAL_MODEL_TYPE; 144 for (int i = syncable::FIRST_REAL_MODEL_TYPE;
143 i < syncable::MODEL_TYPE_COUNT; ++i) { 145 i < syncable::MODEL_TYPE_COUNT; ++i) {
144 const_cast<std::string&>(this->download_progress_markers[i]).assign( 146 const_cast<std::string&>(this->download_progress_markers[i]).assign(
145 download_progress_markers[i]); 147 download_progress_markers[i]);
146 } 148 }
147 } 149 }
148 150
149 SyncSessionSnapshot::~SyncSessionSnapshot() {} 151 SyncSessionSnapshot::~SyncSessionSnapshot() {}
150 152
151 DictionaryValue* SyncSessionSnapshot::ToValue() const { 153 DictionaryValue* SyncSessionSnapshot::ToValue() const {
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 391
390 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) 392 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag)
391 : conflict_progress(dirty_flag) { 393 : conflict_progress(dirty_flag) {
392 } 394 }
393 395
394 PerModelSafeGroupState::~PerModelSafeGroupState() { 396 PerModelSafeGroupState::~PerModelSafeGroupState() {
395 } 397 }
396 398
397 } // namespace sessions 399 } // namespace sessions
398 } // namespace browser_sync 400 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/sessions/session_state.h ('k') | chrome/browser/sync/sessions/session_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698