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

Unified Diff: components/sync/test/engine/mock_connection_manager.cc

Issue 2475043002: [Sync] Sync client should to exponential backoff when receive partial failure (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « components/sync/test/engine/mock_connection_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/test/engine/mock_connection_manager.cc
diff --git a/components/sync/test/engine/mock_connection_manager.cc b/components/sync/test/engine/mock_connection_manager.cc
index 8742e34f3315a2c5c0924d81091228d54771a46a..d50e2988591db730c36d22e616583ba0315361f9 100644
--- a/components/sync/test/engine/mock_connection_manager.cc
+++ b/components/sync/test/engine/mock_connection_manager.cc
@@ -45,7 +45,7 @@ MockConnectionManager::MockConnectionManager(syncable::Directory* directory,
directory_(directory),
mid_commit_observer_(nullptr),
throttling_(false),
- partialThrottling_(false),
+ partial_failure_(false),
fail_non_periodic_get_updates_(false),
next_position_in_parent_(2),
use_legacy_bookmarks_protocol_(false),
@@ -152,20 +152,27 @@ bool MockConnectionManager::PostBufferToPath(PostBufferParams* params,
{
base::AutoLock lock(response_code_override_lock_);
if (throttling_) {
- response.set_error_code(SyncEnums::THROTTLED);
+ sync_pb::ClientToServerResponse_Error* response_error =
+ response.mutable_error();
+ response_error->set_error_type(SyncEnums::THROTTLED);
+ for (ModelTypeSet::Iterator it = partial_failure_type_.First(); it.Good();
+ it.Inc()) {
+ response_error->add_error_data_type_ids(
+ GetSpecificsFieldNumberFromModelType(it.Get()));
+ }
throttling_ = false;
}
- if (partialThrottling_) {
+ if (partial_failure_) {
sync_pb::ClientToServerResponse_Error* response_error =
response.mutable_error();
response_error->set_error_type(SyncEnums::PARTIAL_FAILURE);
- for (ModelTypeSet::Iterator it = throttled_type_.First(); it.Good();
+ for (ModelTypeSet::Iterator it = partial_failure_type_.First(); it.Good();
it.Inc()) {
response_error->add_error_data_type_ids(
GetSpecificsFieldNumberFromModelType(it.Get()));
}
- partialThrottling_ = false;
+ partial_failure_ = false;
}
}
« no previous file with comments | « components/sync/test/engine/mock_connection_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698