Index: chrome/browser/sync/engine/net/server_connection_manager.cc |
diff --git a/chrome/browser/sync/engine/net/server_connection_manager.cc b/chrome/browser/sync/engine/net/server_connection_manager.cc |
index 04be930751da2202322ba4b7c315974dc161937c..b0d70f8ae52a0ac097aefa2f3381cbf363e368d6 100644 |
--- a/chrome/browser/sync/engine/net/server_connection_manager.cc |
+++ b/chrome/browser/sync/engine/net/server_connection_manager.cc |
@@ -266,80 +266,6 @@ bool ServerConnectionManager::PostBufferToPath(PostBufferParams* params, |
return false; |
} |
-bool ServerConnectionManager::CheckTime(int32* out_time) { |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- |
- // Verify that the server really is reachable by checking the time. We need |
- // to do this because of wifi interstitials that intercept messages from the |
- // client and return HTTP OK instead of a redirect. |
- HttpResponse response; |
- ScopedServerStatusWatcher watcher(this, &response); |
- string post_body = "command=get_time"; |
- |
- for (int i = 0 ; i < 3; i++) { |
- ScopedConnectionHelper post(this, MakeActiveConnection()); |
- if (!post.get()) |
- break; |
- |
- // Note that the server's get_time path doesn't require authentication. |
- string get_time_path = |
- MakeSyncServerPath(kSyncServerGetTimePath, post_body); |
- DVLOG(1) << "Requesting get_time from:" << get_time_path; |
- |
- string blank_post_body; |
- bool ok = post.get()->Init(get_time_path.c_str(), blank_post_body, |
- blank_post_body, &response); |
- if (!ok) { |
- DVLOG(1) << "Unable to check the time"; |
- continue; |
- } |
- string time_response; |
- time_response.resize( |
- static_cast<string::size_type>(response.content_length)); |
- ok = post.get()->ReadDownloadResponse(&response, &time_response); |
- if (!ok || string::npos != |
- time_response.find_first_not_of("0123456789")) { |
- LOG(ERROR) << "unable to read a non-numeric response from get_time:" |
- << time_response; |
- continue; |
- } |
- *out_time = atoi(time_response.c_str()); |
- DVLOG(1) << "Server was reachable."; |
- return true; |
- } |
- return false; |
-} |
- |
-bool ServerConnectionManager::IsServerReachable() { |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- int32 time; |
- return CheckTime(&time); |
-} |
- |
-bool ServerConnectionManager::IsUserAuthenticated() { |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- return IsGoodReplyFromServer(server_status_); |
-} |
- |
-bool ServerConnectionManager::CheckServerReachable() { |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- const bool server_is_reachable = IsServerReachable(); |
- if (server_reachable_ != server_is_reachable) { |
- server_reachable_ = server_is_reachable; |
- NotifyStatusChanged(); |
- } |
- return server_is_reachable; |
-} |
- |
-void ServerConnectionManager::SetServerParameters(const string& server_url, |
- int port, |
- bool use_ssl) { |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- sync_server_ = server_url; |
- sync_server_port_ = port; |
- use_ssl_ = use_ssl; |
-} |
- |
// Returns the current server parameters in server_url and port. |
void ServerConnectionManager::GetServerParameters(string* server_url, |
int* port, |