| 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_SERVER_CONNECTION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ |
| 6 #define CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ | 6 #define CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // Use this class to interact with the sync server. | 110 // Use this class to interact with the sync server. |
| 111 // The ServerConnectionManager currently supports POSTing protocol buffers. | 111 // The ServerConnectionManager currently supports POSTing protocol buffers. |
| 112 // | 112 // |
| 113 // *** This class is thread safe. In fact, you should consider creating only | 113 // *** This class is thread safe. In fact, you should consider creating only |
| 114 // one instance for every server that you need to talk to. | 114 // one instance for every server that you need to talk to. |
| 115 class ServerConnectionManager { | 115 class ServerConnectionManager { |
| 116 friend class Post; | 116 friend class Post; |
| 117 friend struct WatchServerStatus; | 117 friend struct WatchServerStatus; |
| 118 public: | 118 public: |
| 119 typedef EventChannel<ServerConnectionEvent, PThreadMutex> Channel; | 119 typedef EventChannel<ServerConnectionEvent, Lock> Channel; |
| 120 | 120 |
| 121 // The lifetime of the GaiaAuthenticator must be longer than the instance | 121 // The lifetime of the GaiaAuthenticator must be longer than the instance |
| 122 // of the ServerConnectionManager that you're creating. | 122 // of the ServerConnectionManager that you're creating. |
| 123 ServerConnectionManager(const std::string& server, int port, bool use_ssl, | 123 ServerConnectionManager(const std::string& server, int port, bool use_ssl, |
| 124 const std::string& user_agent, | 124 const std::string& user_agent, |
| 125 const std::string& client_id); | 125 const std::string& client_id); |
| 126 | 126 |
| 127 virtual ~ServerConnectionManager(); | 127 virtual ~ServerConnectionManager(); |
| 128 | 128 |
| 129 // buffer_in - will be POSTed | 129 // buffer_in - will be POSTed |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 bool FillMessageWithShareDetails(sync_pb::ClientToServerMessage* csm, | 336 bool FillMessageWithShareDetails(sync_pb::ClientToServerMessage* csm, |
| 337 syncable::DirectoryManager* manager, | 337 syncable::DirectoryManager* manager, |
| 338 const PathString &share); | 338 const PathString &share); |
| 339 | 339 |
| 340 } // namespace browser_sync | 340 } // namespace browser_sync |
| 341 | 341 |
| 342 std::ostream& operator<<(std::ostream& s, | 342 std::ostream& operator<<(std::ostream& s, |
| 343 const struct browser_sync::HttpResponse& hr); | 343 const struct browser_sync::HttpResponse& hr); |
| 344 | 344 |
| 345 #endif // CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ | 345 #endif // CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ |
| OLD | NEW |