OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_UTIL_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_UTIL_H_ |
6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_UTIL_H_ | 6 #define EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_UTIL_H_ |
7 | 7 |
8 #include "extensions/browser/api/cast_channel/logging.pb.h" | 8 #include "extensions/common/api/cast_channel.h" |
| 9 #include "extensions/common/api/cast_channel/logging.pb.h" |
9 | 10 |
10 namespace extensions { | 11 namespace extensions { |
11 namespace core_api { | 12 namespace core_api { |
12 namespace cast_channel { | 13 namespace cast_channel { |
| 14 // Converts an IDL "ChannelError" to a proto enum "ErrorState". |
| 15 proto::ErrorState ErrorStateToProto(ChannelError state); |
13 | 16 |
14 // TODO(mfoltz): Move the *ToProto functions from cast_socket.cc here. | 17 // Converts an IDL "ReadyState" to a proto enum "ReadyState". |
15 // CastSocket should not need to know details of the logging protocol message. | 18 proto::ReadyState ReadyStateToProto(ReadyState state); |
16 | 19 |
17 // Holds the most recent errors encountered by a CastSocket. | 20 // Holds the most recent errors encountered by a CastSocket. |
18 struct LastErrors { | 21 struct LastErrors { |
19 public: | 22 public: |
20 LastErrors(); | 23 LastErrors(); |
21 ~LastErrors(); | 24 ~LastErrors(); |
22 | 25 |
23 // The most recent event that occurred at the time of the error. | 26 // The most recent event that occurred at the time of the error. |
24 proto::EventType event_type; | 27 proto::EventType event_type; |
25 | 28 |
26 // The most recent ChallengeReplyErrorType logged for the socket. | 29 // The most recent ChallengeReplyErrorType logged for the socket. |
27 proto::ChallengeReplyErrorType challenge_reply_error_type; | 30 proto::ChallengeReplyErrorType challenge_reply_error_type; |
28 | 31 |
29 // The most recent net_return_value logged for the socket. | 32 // The most recent net_return_value logged for the socket. |
30 int net_return_value; | 33 int net_return_value; |
31 | 34 |
32 // The most recent NSS error logged for the socket. | 35 // The most recent NSS error logged for the socket. |
33 int nss_error_code; | 36 int nss_error_code; |
34 }; | 37 }; |
35 | 38 |
36 } // namespace cast_channel | 39 } // namespace cast_channel |
37 } // namespace api | 40 } // namespace api |
38 } // namespace extensions | 41 } // namespace extensions |
39 | 42 |
40 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_UTIL_H_ | 43 #endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_LOGGER_UTIL_H_ |
OLD | NEW |