| 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" |
| 11 | 11 |
| 12 using syncer::HttpResponse; | |
| 13 | |
| 14 namespace syncer { | 12 namespace syncer { |
| 15 | 13 |
| 16 SyncAPIBridgedConnection::SyncAPIBridgedConnection( | 14 SyncAPIBridgedConnection::SyncAPIBridgedConnection( |
| 17 syncer::ServerConnectionManager* scm, | 15 ServerConnectionManager* scm, |
| 18 HttpPostProviderFactory* factory) | 16 HttpPostProviderFactory* factory) |
| 19 : Connection(scm), factory_(factory) { | 17 : Connection(scm), factory_(factory) { |
| 20 post_provider_ = factory_->Create(); | 18 post_provider_ = factory_->Create(); |
| 21 } | 19 } |
| 22 | 20 |
| 23 SyncAPIBridgedConnection::~SyncAPIBridgedConnection() { | 21 SyncAPIBridgedConnection::~SyncAPIBridgedConnection() { |
| 24 DCHECK(post_provider_); | 22 DCHECK(post_provider_); |
| 25 factory_->Destroy(post_provider_); | 23 factory_->Destroy(post_provider_); |
| 26 post_provider_ = NULL; | 24 post_provider_ = NULL; |
| 27 } | 25 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 int port, | 88 int port, |
| 91 bool use_ssl, | 89 bool use_ssl, |
| 92 HttpPostProviderFactory* factory) | 90 HttpPostProviderFactory* factory) |
| 93 : ServerConnectionManager(server, port, use_ssl), | 91 : ServerConnectionManager(server, port, use_ssl), |
| 94 post_provider_factory_(factory) { | 92 post_provider_factory_(factory) { |
| 95 DCHECK(post_provider_factory_.get()); | 93 DCHECK(post_provider_factory_.get()); |
| 96 } | 94 } |
| 97 | 95 |
| 98 SyncAPIServerConnectionManager::~SyncAPIServerConnectionManager() {} | 96 SyncAPIServerConnectionManager::~SyncAPIServerConnectionManager() {} |
| 99 | 97 |
| 100 syncer::ServerConnectionManager::Connection* | 98 ServerConnectionManager::Connection* |
| 101 SyncAPIServerConnectionManager::MakeConnection() { | 99 SyncAPIServerConnectionManager::MakeConnection() { |
| 102 return new SyncAPIBridgedConnection(this, post_provider_factory_.get()); | 100 return new SyncAPIBridgedConnection(this, post_provider_factory_.get()); |
| 103 } | 101 } |
| 104 | 102 |
| 105 } // namespace syncer | 103 } // namespace syncer |
| OLD | NEW |