| 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 "components/sync/engine_impl/net/sync_server_connection_manager.h" | 5 #include "components/sync/engine_impl/net/sync_server_connection_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "components/sync/engine/net/http_post_provider_factory.h" | 9 #include "components/sync/engine/net/http_post_provider_factory.h" |
| 10 #include "components/sync/engine/net/http_post_provider_interface.h" | 10 #include "components/sync/engine/net/http_post_provider_interface.h" |
| 11 #include "net/base/net_errors.h" | 11 #include "net/base/net_errors.h" |
| 12 #include "net/http/http_status_code.h" | 12 #include "net/http/http_status_code.h" |
| 13 | 13 |
| 14 namespace syncer { | 14 namespace syncer { |
| 15 | 15 |
| 16 SyncBridgedConnection::SyncBridgedConnection(ServerConnectionManager* scm, | 16 SyncBridgedConnection::SyncBridgedConnection(ServerConnectionManager* scm, |
| 17 HttpPostProviderFactory* factory) | 17 HttpPostProviderFactory* factory) |
| 18 : Connection(scm), factory_(factory) { | 18 : Connection(scm), factory_(factory) { |
| 19 post_provider_ = factory_->Create(); | 19 post_provider_ = factory_->Create(); |
| 20 } | 20 } |
| 21 | 21 |
| 22 SyncBridgedConnection::~SyncBridgedConnection() { | 22 SyncBridgedConnection::~SyncBridgedConnection() { |
| 23 DCHECK(post_provider_); | 23 DCHECK(post_provider_); |
| 24 factory_->Destroy(post_provider_); | 24 factory_->Destroy(post_provider_); |
| 25 post_provider_ = NULL; | 25 post_provider_ = nullptr; |
| 26 } | 26 } |
| 27 | 27 |
| 28 bool SyncBridgedConnection::Init(const char* path, | 28 bool SyncBridgedConnection::Init(const char* path, |
| 29 const std::string& auth_token, | 29 const std::string& auth_token, |
| 30 const std::string& payload, | 30 const std::string& payload, |
| 31 HttpResponse* response) { | 31 HttpResponse* response) { |
| 32 std::string sync_server; | 32 std::string sync_server; |
| 33 int sync_server_port = 0; | 33 int sync_server_port = 0; |
| 34 bool use_ssl = false; | 34 bool use_ssl = false; |
| 35 GetServerParams(&sync_server, &sync_server_port, &use_ssl); | 35 GetServerParams(&sync_server, &sync_server_port, &use_ssl); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 | 94 |
| 95 SyncServerConnectionManager::~SyncServerConnectionManager() {} | 95 SyncServerConnectionManager::~SyncServerConnectionManager() {} |
| 96 | 96 |
| 97 ServerConnectionManager::Connection* | 97 ServerConnectionManager::Connection* |
| 98 SyncServerConnectionManager::MakeConnection() { | 98 SyncServerConnectionManager::MakeConnection() { |
| 99 return new SyncBridgedConnection(this, post_provider_factory_.get()); | 99 return new SyncBridgedConnection(this, post_provider_factory_.get()); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace syncer | 102 } // namespace syncer |
| OLD | NEW |