OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <string> | 10 #include <string> |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 268 |
269 std::string GetServerHost() const; | 269 std::string GetServerHost() const; |
270 | 270 |
271 bool terminate_all_io() const { | 271 bool terminate_all_io() const { |
272 AutoLock lock(terminate_all_io_mutex_); | 272 AutoLock lock(terminate_all_io_mutex_); |
273 return terminate_all_io_; | 273 return terminate_all_io_; |
274 } | 274 } |
275 | 275 |
276 // Factory method to create a Post object we can use for communication with | 276 // Factory method to create a Post object we can use for communication with |
277 // the server. | 277 // the server. |
278 virtual Post* MakePost() { | 278 virtual Post* MakePost(); |
279 return NULL; // For testing. | |
280 }; | |
281 | 279 |
282 void set_client_id(const std::string& client_id) { | 280 void set_client_id(const std::string& client_id) { |
283 DCHECK(client_id_.empty()); | 281 DCHECK(client_id_.empty()); |
284 client_id_.assign(client_id); | 282 client_id_.assign(client_id); |
285 } | 283 } |
286 | 284 |
287 void set_auth_token(const std::string& auth_token) { | 285 void set_auth_token(const std::string& auth_token) { |
288 // TODO(chron): Consider adding a message loop check here. | 286 // TODO(chron): Consider adding a message loop check here. |
289 AutoLock lock(auth_token_mutex_); | 287 AutoLock lock(auth_token_mutex_); |
290 auth_token_.assign(auth_token); | 288 auth_token_.assign(auth_token); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // settings. | 372 // settings. |
375 bool FillMessageWithShareDetails(sync_pb::ClientToServerMessage* csm, | 373 bool FillMessageWithShareDetails(sync_pb::ClientToServerMessage* csm, |
376 syncable::DirectoryManager* manager, | 374 syncable::DirectoryManager* manager, |
377 const std::string& share); | 375 const std::string& share); |
378 | 376 |
379 std::ostream& operator<<(std::ostream& s, const struct HttpResponse& hr); | 377 std::ostream& operator<<(std::ostream& s, const struct HttpResponse& hr); |
380 | 378 |
381 } // namespace browser_sync | 379 } // namespace browser_sync |
382 | 380 |
383 #endif // CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ | 381 #endif // CHROME_BROWSER_SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ |
OLD | NEW |