Index: components/cast_channel/cast_channel_type.h |
diff --git a/components/cast_channel/cast_channel_type.h b/components/cast_channel/cast_channel_type.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1a5828d49a86e1bda00edc021071c41b98c898a8 |
--- /dev/null |
+++ b/components/cast_channel/cast_channel_type.h |
@@ -0,0 +1,48 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_CAST_CHANNEL_CAST_CHANNEL_TYPE_H_ |
mark a. foltz
2017/05/24 22:46:36
Maybe cast_channel_enum.h?
zhaobin
2017/05/25 00:49:23
Done.
|
+#define COMPONENTS_CAST_CHANNEL_CAST_CHANNEL_TYPE_H_ |
+ |
+#include <string> |
+ |
+namespace cast_channel { |
+ |
+// Map to enum ReadyState in cast_channel.idl |
imcheng
2017/05/24 22:11:23
s/Map/Maps, here and below.
zhaobin
2017/05/25 00:49:23
Done.
|
+enum class ReadyState { |
+ NONE, |
+ CONNECTING, |
+ OPEN, |
+ CLOSING, |
+ CLOSED, |
+}; |
+ |
+// Map to enum ChannelError in cast_channel.idl |
+enum class ChannelError { |
+ NONE, |
+ CHANNEL_NOT_OPEN, |
+ AUTHENTICATION_ERROR, |
+ CONNECT_ERROR, |
+ SOCKET_ERROR, |
+ TRANSPORT_ERROR, |
+ INVALID_MESSAGE, |
+ INVALID_CHANNEL_ID, |
+ CONNECT_TIMEOUT, |
+ PING_TIMEOUT, |
+ UNKNOWN, |
+}; |
+ |
+// Map to enum ChannelAuth in cast_channel.idl |
+enum class ChannelAuthType { |
+ NONE, |
+ SSL_VERIFIED, |
+}; |
+ |
+std::string ToString(ReadyState ready_state); |
imcheng
2017/05/24 22:11:23
Prefer ReadyStateToString, ChannelErrorToString, C
zhaobin
2017/05/25 00:49:23
Done.
|
+std::string ToString(ChannelError channel_error); |
+std::string ToString(ChannelAuthType channel_auth); |
+ |
+} // namespace cast_channel |
+ |
+#endif // COMPONENTS_CAST_CHANNEL_CAST_CHANNEL_TYPE_H_ |