| 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 #ifndef SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
| 6 #define SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // A ServerConnectionManager subclass used by the syncapi layer. We use a | 48 // A ServerConnectionManager subclass used by the syncapi layer. We use a |
| 49 // subclass so that we can override MakePost() to generate a POST object using | 49 // subclass so that we can override MakePost() to generate a POST object using |
| 50 // an instance of the HttpPostProviderFactory class. | 50 // an instance of the HttpPostProviderFactory class. |
| 51 class SyncAPIServerConnectionManager | 51 class SyncAPIServerConnectionManager |
| 52 : public csync::ServerConnectionManager { | 52 : public csync::ServerConnectionManager { |
| 53 public: | 53 public: |
| 54 // Takes ownership of factory. | 54 // Takes ownership of factory. |
| 55 SyncAPIServerConnectionManager(const std::string& server, | 55 SyncAPIServerConnectionManager(const std::string& server, |
| 56 int port, | 56 int port, |
| 57 bool use_ssl, | 57 bool use_ssl, |
| 58 const std::string& client_version, | |
| 59 HttpPostProviderFactory* factory); | 58 HttpPostProviderFactory* factory); |
| 60 virtual ~SyncAPIServerConnectionManager(); | 59 virtual ~SyncAPIServerConnectionManager(); |
| 61 | 60 |
| 62 // ServerConnectionManager overrides. | 61 // ServerConnectionManager overrides. |
| 63 virtual Connection* MakeConnection() OVERRIDE; | 62 virtual Connection* MakeConnection() OVERRIDE; |
| 64 | 63 |
| 65 private: | 64 private: |
| 66 FRIEND_TEST_ALL_PREFIXES(SyncAPIServerConnectionManagerTest, EarlyAbortPost); | 65 FRIEND_TEST_ALL_PREFIXES(SyncAPIServerConnectionManagerTest, EarlyAbortPost); |
| 67 FRIEND_TEST_ALL_PREFIXES(SyncAPIServerConnectionManagerTest, AbortPost); | 66 FRIEND_TEST_ALL_PREFIXES(SyncAPIServerConnectionManagerTest, AbortPost); |
| 68 | 67 |
| 69 // A factory creating concrete HttpPostProviders for use whenever we need to | 68 // A factory creating concrete HttpPostProviders for use whenever we need to |
| 70 // issue a POST to sync servers. | 69 // issue a POST to sync servers. |
| 71 scoped_ptr<HttpPostProviderFactory> post_provider_factory_; | 70 scoped_ptr<HttpPostProviderFactory> post_provider_factory_; |
| 72 | 71 |
| 73 DISALLOW_COPY_AND_ASSIGN(SyncAPIServerConnectionManager); | 72 DISALLOW_COPY_AND_ASSIGN(SyncAPIServerConnectionManager); |
| 74 }; | 73 }; |
| 75 | 74 |
| 76 } // namespace csync | 75 } // namespace csync |
| 77 | 76 |
| 78 #endif // SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 77 #endif // SYNC_INTERNAL_API_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
| OLD | NEW |