OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/protocol/errors.h" | 5 #include "remoting/protocol/errors.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "remoting/protocol/name_value_map.h" | 8 #include "remoting/base/name_value_map.h" |
9 | 9 |
10 namespace remoting { | 10 namespace remoting { |
11 namespace protocol { | 11 namespace protocol { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 const NameMapElement<ErrorCode> kErrorCodeNames[] = { | 15 const NameMapElement<ErrorCode> kErrorCodeNames[] = { |
16 { OK, "OK" }, | 16 { OK, "OK" }, |
17 { PEER_IS_OFFLINE, "PEER_IS_OFFLINE" }, | 17 { PEER_IS_OFFLINE, "PEER_IS_OFFLINE" }, |
18 { SESSION_REJECTED, "SESSION_REJECTED" }, | 18 { SESSION_REJECTED, "SESSION_REJECTED" }, |
(...skipping 14 matching lines...) Expand all Loading... |
33 const char* ErrorCodeToString(ErrorCode error) { | 33 const char* ErrorCodeToString(ErrorCode error) { |
34 return ValueToName(kErrorCodeNames, error); | 34 return ValueToName(kErrorCodeNames, error); |
35 } | 35 } |
36 | 36 |
37 bool ParseErrorCode(const std::string& name, ErrorCode* result) { | 37 bool ParseErrorCode(const std::string& name, ErrorCode* result) { |
38 return NameToValue(kErrorCodeNames, name, result); | 38 return NameToValue(kErrorCodeNames, name, result); |
39 } | 39 } |
40 | 40 |
41 } // namespace protocol | 41 } // namespace protocol |
42 } // namespace remoting | 42 } // namespace remoting |
OLD | NEW |