| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ | 5 #ifndef SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ |
| 6 #define SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ | 6 #define SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <iosfwd> | 10 #include <iosfwd> |
| 11 #include <memory> |
| 11 #include <string> | 12 #include <string> |
| 12 | 13 |
| 13 #include "base/atomicops.h" | 14 #include "base/atomicops.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" | |
| 16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
| 17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 19 #include "base/threading/non_thread_safe.h" | 19 #include "base/threading/non_thread_safe.h" |
| 20 #include "base/threading/thread_checker.h" | 20 #include "base/threading/thread_checker.h" |
| 21 #include "sync/base/sync_export.h" | 21 #include "sync/base/sync_export.h" |
| 22 #include "sync/internal_api/public/base/cancelation_observer.h" | 22 #include "sync/internal_api/public/base/cancelation_observer.h" |
| 23 #include "sync/syncable/syncable_id.h" | 23 #include "sync/syncable/syncable_id.h" |
| 24 | 24 |
| 25 namespace sync_pb { | 25 namespace sync_pb { |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 // ownership of is destroyed. | 296 // ownership of is destroyed. |
| 297 class ScopedConnectionHelper { | 297 class ScopedConnectionHelper { |
| 298 public: | 298 public: |
| 299 // |manager| must outlive this. Takes ownership of |connection|. | 299 // |manager| must outlive this. Takes ownership of |connection|. |
| 300 ScopedConnectionHelper(ServerConnectionManager* manager, | 300 ScopedConnectionHelper(ServerConnectionManager* manager, |
| 301 Connection* connection); | 301 Connection* connection); |
| 302 ~ScopedConnectionHelper(); | 302 ~ScopedConnectionHelper(); |
| 303 Connection* get(); | 303 Connection* get(); |
| 304 private: | 304 private: |
| 305 ServerConnectionManager* manager_; | 305 ServerConnectionManager* manager_; |
| 306 scoped_ptr<Connection> connection_; | 306 std::unique_ptr<Connection> connection_; |
| 307 DISALLOW_COPY_AND_ASSIGN(ScopedConnectionHelper); | 307 DISALLOW_COPY_AND_ASSIGN(ScopedConnectionHelper); |
| 308 }; | 308 }; |
| 309 | 309 |
| 310 void NotifyStatusChanged(); | 310 void NotifyStatusChanged(); |
| 311 | 311 |
| 312 CancelationSignal* const cancelation_signal_; | 312 CancelationSignal* const cancelation_signal_; |
| 313 bool signal_handler_registered_; | 313 bool signal_handler_registered_; |
| 314 | 314 |
| 315 DISALLOW_COPY_AND_ASSIGN(ServerConnectionManager); | 315 DISALLOW_COPY_AND_ASSIGN(ServerConnectionManager); |
| 316 }; | 316 }; |
| 317 | 317 |
| 318 std::ostream& operator<<(std::ostream& s, const struct HttpResponse& hr); | 318 std::ostream& operator<<(std::ostream& s, const struct HttpResponse& hr); |
| 319 | 319 |
| 320 } // namespace syncer | 320 } // namespace syncer |
| 321 | 321 |
| 322 #endif // SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ | 322 #endif // SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ |
| OLD | NEW |