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

Unified Diff: sync/engine/net/server_connection_manager.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.h ('k') | sync/engine/syncer_proto_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/net/server_connection_manager.cc
diff --git a/sync/engine/net/server_connection_manager.cc b/sync/engine/net/server_connection_manager.cc
index 3101109a4fe86458a3008c3fe2f4c2db26592e9b..2531c97bb972f345d06ed25649fd0660803a7f2c 100644
--- a/sync/engine/net/server_connection_manager.cc
+++ b/sync/engine/net/server_connection_manager.cc
@@ -163,17 +163,6 @@ int ServerConnectionManager::Connection::ReadResponse(string* out_buffer,
return bytes_read;
}
-ScopedServerStatusWatcher::ScopedServerStatusWatcher(
- ServerConnectionManager* conn_mgr, HttpResponse* response)
- : conn_mgr_(conn_mgr),
- response_(response) {
- response->server_status = conn_mgr->server_status_;
-}
-
-ScopedServerStatusWatcher::~ScopedServerStatusWatcher() {
- conn_mgr_->SetServerStatus(response_->server_status);
-}
-
ServerConnectionManager::ServerConnectionManager(
const string& server,
int port,
@@ -273,18 +262,19 @@ void ServerConnectionManager::NotifyStatusChanged() {
}
bool ServerConnectionManager::PostBufferWithCachedAuth(
- PostBufferParams* params, ScopedServerStatusWatcher* watcher) {
+ PostBufferParams* params) {
DCHECK(thread_checker_.CalledOnValidThread());
string path =
MakeSyncServerPath(proto_sync_path(), MakeSyncQueryString(client_id_));
- return PostBufferToPath(params, path, auth_token(), watcher);
+ bool result = PostBufferToPath(params, path, auth_token());
+ SetServerStatus(params->response.server_status);
+ return result;
}
bool ServerConnectionManager::PostBufferToPath(PostBufferParams* params,
- const string& path, const string& auth_token,
- ScopedServerStatusWatcher* watcher) {
+ const string& path,
+ const string& auth_token) {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(watcher != NULL);
// TODO(pavely): crbug.com/273096. Check for "credentials_lost" is added as
// workaround for M29 blocker to avoid sending RPC to sync with known invalid
@@ -364,8 +354,7 @@ void ServerConnectionManager::RemoveListener(
listeners_.RemoveObserver(listener);
}
-ServerConnectionManager::Connection* ServerConnectionManager::MakeConnection()
-{
+ServerConnectionManager::Connection* ServerConnectionManager::MakeConnection() {
return NULL; // For testing.
}
« no previous file with comments | « sync/engine/net/server_connection_manager.h ('k') | sync/engine/syncer_proto_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698