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

Unified Diff: sync/engine/syncer_proto_util.cc

Issue 1505953002: [Sync] Remove ScopedServerStatusWatcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change format of deprecated names. Created 5 years 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 | « sync/engine/net/server_connection_manager.cc ('k') | sync/engine/syncer_proto_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/syncer_proto_util.cc
diff --git a/sync/engine/syncer_proto_util.cc b/sync/engine/syncer_proto_util.cc
index cd77e1e0dafe220d03dc8dc409ce833effe96b7a..306137b43b7f4e4c1fba356ded17c9ddbc7b51ce 100644
--- a/sync/engine/syncer_proto_util.cc
+++ b/sync/engine/syncer_proto_util.cc
@@ -4,6 +4,8 @@
#include "sync/engine/syncer_proto_util.h"
+#include <map>
+
#include "base/format_macros.h"
#include "base/strings/stringprintf.h"
#include "google_apis/google_api_keys.h"
@@ -130,10 +132,6 @@ SyncProtocolErrorType PBErrorTypeToSyncProtocolErrorType(
return CLIENT_DATA_OBSOLETE;
case sync_pb::SyncEnums::UNKNOWN:
return UNKNOWN_ERROR;
- case sync_pb::SyncEnums::USER_NOT_ACTIVATED:
- case sync_pb::SyncEnums::AUTH_INVALID:
- case sync_pb::SyncEnums::ACCESS_DENIED:
- return INVALID_CREDENTIAL;
default:
NOTREACHED();
return UNKNOWN_ERROR;
@@ -345,28 +343,13 @@ bool SyncerProtoUtil::PostAndProcessHeaders(ServerConnectionManager* scm,
ClientToServerMessage::default_instance().protocol_version());
msg.SerializeToString(&params.buffer_in);
- ScopedServerStatusWatcher server_status_watcher(scm, &params.response);
// Fills in params.buffer_out and params.response.
- if (!scm->PostBufferWithCachedAuth(&params, &server_status_watcher)) {
+ if (!scm->PostBufferWithCachedAuth(&params)) {
LOG(WARNING) << "Error posting from syncer:" << params.response;
return false;
}
- if (response->ParseFromString(params.buffer_out)) {
- // TODO(tim): This is an egregious layering violation (bug 35060).
- switch (response->error_code()) {
- case sync_pb::SyncEnums::ACCESS_DENIED:
- case sync_pb::SyncEnums::AUTH_INVALID:
- case sync_pb::SyncEnums::USER_NOT_ACTIVATED:
- // Fires on ScopedServerStatusWatcher
- params.response.server_status = HttpResponse::SYNC_AUTH_ERROR;
- return false;
- default:
- return true;
- }
- }
-
- return false;
+ return response->ParseFromString(params.buffer_out);
}
base::TimeDelta SyncerProtoUtil::GetThrottleDelay(
« no previous file with comments | « sync/engine/net/server_connection_manager.cc ('k') | sync/engine/syncer_proto_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698