| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/internal_api/syncapi_server_connection_manager.h" | 5 #include "sync/internal_api/syncapi_server_connection_manager.h" |
| 6 | 6 |
| 7 #include "net/base/net_errors.h" | 7 #include "net/base/net_errors.h" |
| 8 #include "net/http/http_status_code.h" | 8 #include "net/http/http_status_code.h" |
| 9 #include "sync/internal_api/public/http_post_provider_factory.h" | 9 #include "sync/internal_api/public/http_post_provider_factory.h" |
| 10 #include "sync/internal_api/public/http_post_provider_interface.h" | 10 #include "sync/internal_api/public/http_post_provider_interface.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 void SyncAPIBridgedConnection::Abort() { | 85 void SyncAPIBridgedConnection::Abort() { |
| 86 DCHECK(post_provider_); | 86 DCHECK(post_provider_); |
| 87 post_provider_->Abort(); | 87 post_provider_->Abort(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 SyncAPIServerConnectionManager::SyncAPIServerConnectionManager( | 90 SyncAPIServerConnectionManager::SyncAPIServerConnectionManager( |
| 91 const std::string& server, | 91 const std::string& server, |
| 92 int port, | 92 int port, |
| 93 bool use_ssl, | 93 bool use_ssl, |
| 94 bool use_oauth2_token, | 94 bool use_oauth2_token, |
| 95 HttpPostProviderFactory* factory) | 95 HttpPostProviderFactory* factory, |
| 96 : ServerConnectionManager(server, port, use_ssl, use_oauth2_token), | 96 CancelationSignal* cancelation_signal) |
| 97 : ServerConnectionManager(server, |
| 98 port, |
| 99 use_ssl, |
| 100 use_oauth2_token, |
| 101 cancelation_signal), |
| 97 post_provider_factory_(factory) { | 102 post_provider_factory_(factory) { |
| 98 DCHECK(post_provider_factory_.get()); | 103 DCHECK(post_provider_factory_.get()); |
| 99 } | 104 } |
| 100 | 105 |
| 101 SyncAPIServerConnectionManager::~SyncAPIServerConnectionManager() {} | 106 SyncAPIServerConnectionManager::~SyncAPIServerConnectionManager() {} |
| 102 | 107 |
| 103 ServerConnectionManager::Connection* | 108 ServerConnectionManager::Connection* |
| 104 SyncAPIServerConnectionManager::MakeConnection() { | 109 SyncAPIServerConnectionManager::MakeConnection() { |
| 105 return new SyncAPIBridgedConnection(this, post_provider_factory_.get()); | 110 return new SyncAPIBridgedConnection(this, post_provider_factory_.get()); |
| 106 } | 111 } |
| 107 | 112 |
| 108 void SyncAPIServerConnectionManager::TerminateAllIO() { | |
| 109 ServerConnectionManager::TerminateAllIO(); | |
| 110 post_provider_factory_->Shutdown(); | |
| 111 } | |
| 112 | |
| 113 } // namespace syncer | 113 } // namespace syncer |
| OLD | NEW |