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> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // The size of a download request's payload. | 84 // The size of a download request's payload. |
85 int64_t payload_length; | 85 int64_t payload_length; |
86 | 86 |
87 // Identifies the type of failure, if any. | 87 // Identifies the type of failure, if any. |
88 ServerConnectionCode server_status; | 88 ServerConnectionCode server_status; |
89 | 89 |
90 HttpResponse(); | 90 HttpResponse(); |
91 | 91 |
92 static const char* GetServerConnectionCodeString( | 92 static const char* GetServerConnectionCodeString( |
93 ServerConnectionCode code); | 93 ServerConnectionCode code); |
94 | |
95 static ServerConnectionCode ServerConnectionCodeFromNetError( | |
96 int error_code); | |
97 }; | 94 }; |
98 | 95 |
99 struct ServerConnectionEvent { | 96 struct ServerConnectionEvent { |
100 HttpResponse::ServerConnectionCode connection_code; | 97 HttpResponse::ServerConnectionCode connection_code; |
101 explicit ServerConnectionEvent(HttpResponse::ServerConnectionCode code) : | 98 explicit ServerConnectionEvent(HttpResponse::ServerConnectionCode code) : |
102 connection_code(code) {} | 99 connection_code(code) {} |
103 }; | 100 }; |
104 | 101 |
105 class SYNC_EXPORT ServerConnectionEventListener { | 102 class SYNC_EXPORT ServerConnectionEventListener { |
106 public: | 103 public: |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 bool signal_handler_registered_; | 313 bool signal_handler_registered_; |
317 | 314 |
318 DISALLOW_COPY_AND_ASSIGN(ServerConnectionManager); | 315 DISALLOW_COPY_AND_ASSIGN(ServerConnectionManager); |
319 }; | 316 }; |
320 | 317 |
321 std::ostream& operator<<(std::ostream& s, const struct HttpResponse& hr); | 318 std::ostream& operator<<(std::ostream& s, const struct HttpResponse& hr); |
322 | 319 |
323 } // namespace syncer | 320 } // namespace syncer |
324 | 321 |
325 #endif // SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ | 322 #endif // SYNC_ENGINE_NET_SERVER_CONNECTION_MANAGER_H_ |
OLD | NEW |