OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_SYNC_ENGINE_NET_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_NET_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
6 #define CHROME_BROWSER_SYNC_ENGINE_NET_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 6 #define CHROME_BROWSER_SYNC_ENGINE_NET_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // subclass so that we can override MakePost() to generate a POST object using | 44 // subclass so that we can override MakePost() to generate a POST object using |
45 // an instance of the HttpPostProviderFactory class. | 45 // an instance of the HttpPostProviderFactory class. |
46 class SyncAPIServerConnectionManager | 46 class SyncAPIServerConnectionManager |
47 : public browser_sync::ServerConnectionManager { | 47 : public browser_sync::ServerConnectionManager { |
48 public: | 48 public: |
49 // Takes ownership of factory. | 49 // Takes ownership of factory. |
50 SyncAPIServerConnectionManager(const std::string& server, | 50 SyncAPIServerConnectionManager(const std::string& server, |
51 int port, | 51 int port, |
52 bool use_ssl, | 52 bool use_ssl, |
53 const std::string& client_version, | 53 const std::string& client_version, |
54 const std::string& client_id, | |
55 HttpPostProviderFactory* factory) | 54 HttpPostProviderFactory* factory) |
56 : ServerConnectionManager(server, port, use_ssl, client_version, | 55 : ServerConnectionManager(server, port, use_ssl, client_version), |
57 client_id), | |
58 post_provider_factory_(factory) { | 56 post_provider_factory_(factory) { |
59 DCHECK(post_provider_factory_.get()); | 57 DCHECK(post_provider_factory_.get()); |
60 } | 58 } |
61 | 59 |
62 virtual ~SyncAPIServerConnectionManager(); | 60 virtual ~SyncAPIServerConnectionManager(); |
63 protected: | 61 protected: |
64 virtual Post* MakePost() { | 62 virtual Post* MakePost() { |
65 return new SyncAPIBridgedPost(this, post_provider_factory_.get()); | 63 return new SyncAPIBridgedPost(this, post_provider_factory_.get()); |
66 } | 64 } |
67 private: | 65 private: |
68 // A factory creating concrete HttpPostProviders for use whenever we need to | 66 // A factory creating concrete HttpPostProviders for use whenever we need to |
69 // issue a POST to sync servers. | 67 // issue a POST to sync servers. |
70 scoped_ptr<HttpPostProviderFactory> post_provider_factory_; | 68 scoped_ptr<HttpPostProviderFactory> post_provider_factory_; |
71 | 69 |
72 DISALLOW_COPY_AND_ASSIGN(SyncAPIServerConnectionManager); | 70 DISALLOW_COPY_AND_ASSIGN(SyncAPIServerConnectionManager); |
73 }; | 71 }; |
74 | 72 |
75 } // namespace sync_api | 73 } // namespace sync_api |
76 | 74 |
77 #endif // CHROME_BROWSER_SYNC_ENGINE_NET_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ | 75 #endif // CHROME_BROWSER_SYNC_ENGINE_NET_SYNCAPI_SERVER_CONNECTION_MANAGER_H_ |
OLD | NEW |