OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "sync/engine/net/server_connection_manager.h" | 5 #include "sync/engine/net/server_connection_manager.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 | 8 |
9 #include <ostream> | 9 #include <ostream> |
10 #include <string> | 10 #include <string> |
(...skipping 28 matching lines...) Expand all Loading... |
39 const char* HttpResponse::GetServerConnectionCodeString( | 39 const char* HttpResponse::GetServerConnectionCodeString( |
40 ServerConnectionCode code) { | 40 ServerConnectionCode code) { |
41 switch (code) { | 41 switch (code) { |
42 ENUM_CASE(NONE); | 42 ENUM_CASE(NONE); |
43 ENUM_CASE(CONNECTION_UNAVAILABLE); | 43 ENUM_CASE(CONNECTION_UNAVAILABLE); |
44 ENUM_CASE(IO_ERROR); | 44 ENUM_CASE(IO_ERROR); |
45 ENUM_CASE(SYNC_SERVER_ERROR); | 45 ENUM_CASE(SYNC_SERVER_ERROR); |
46 ENUM_CASE(SYNC_AUTH_ERROR); | 46 ENUM_CASE(SYNC_AUTH_ERROR); |
47 ENUM_CASE(SERVER_CONNECTION_OK); | 47 ENUM_CASE(SERVER_CONNECTION_OK); |
48 ENUM_CASE(RETRY); | 48 ENUM_CASE(RETRY); |
| 49 ENUM_CASE(TOKEN_REFRESHED); |
49 } | 50 } |
50 NOTREACHED(); | 51 NOTREACHED(); |
51 return ""; | 52 return ""; |
52 } | 53 } |
53 | 54 |
54 #undef ENUM_CASE | 55 #undef ENUM_CASE |
55 | 56 |
56 // TODO(clamy): check if all errors are in the right category. | 57 // TODO(clamy): check if all errors are in the right category. |
57 HttpResponse::ServerConnectionCode | 58 HttpResponse::ServerConnectionCode |
58 HttpResponse::ServerConnectionCodeFromNetError(int error_code) { | 59 HttpResponse::ServerConnectionCodeFromNetError(int error_code) { |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 345 |
345 std::ostream& operator << (std::ostream& s, const struct HttpResponse& hr) { | 346 std::ostream& operator << (std::ostream& s, const struct HttpResponse& hr) { |
346 s << " Response Code (bogus on error): " << hr.response_code; | 347 s << " Response Code (bogus on error): " << hr.response_code; |
347 s << " Content-Length (bogus on error): " << hr.content_length; | 348 s << " Content-Length (bogus on error): " << hr.content_length; |
348 s << " Server Status: " | 349 s << " Server Status: " |
349 << HttpResponse::GetServerConnectionCodeString(hr.server_status); | 350 << HttpResponse::GetServerConnectionCodeString(hr.server_status); |
350 return s; | 351 return s; |
351 } | 352 } |
352 | 353 |
353 } // namespace syncer | 354 } // namespace syncer |
OLD | NEW |