Index: extensions/browser/api/cast_channel/cast_socket.h |
diff --git a/extensions/browser/api/cast_channel/cast_socket.h b/extensions/browser/api/cast_channel/cast_socket.h |
index 2cb56a6ea538d35accf0e6dfdb705d0fa2f69bec..3d89c2dadfd7c8755cbf70f1a942c4b3a4e02ba1 100644 |
--- a/extensions/browser/api/cast_channel/cast_socket.h |
+++ b/extensions/browser/api/cast_channel/cast_socket.h |
@@ -42,6 +42,16 @@ class Logger; |
struct LastErrors; |
class MessageFramer; |
+// Cast device capabilities. |
+enum CastDeviceCapability { |
+ NONE = 0, |
+ VIDEO_OUT = 1 << 0, |
+ VIDEO_IN = 1 << 1, |
+ AUDIO_OUT = 1 << 2, |
+ AUDIO_IN = 1 << 3, |
+ DEV_MODE = 1 << 4 |
+}; |
+ |
// Public interface of the CastSocket class. |
class CastSocket : public ApiResource { |
public: |
@@ -125,7 +135,8 @@ class CastSocketImpl : public CastSocket { |
ChannelAuthType channel_auth, |
net::NetLog* net_log, |
const base::TimeDelta& connect_timeout, |
- const scoped_refptr<Logger>& logger); |
+ const scoped_refptr<Logger>& logger, |
+ long device_capabilities); |
// Ensures that the socket is closed. |
~CastSocketImpl() override; |
@@ -165,6 +176,11 @@ class CastSocketImpl : public CastSocket { |
// by the caller (e.g. a mock). |
void SetTransportForTesting(scoped_ptr<CastTransport> transport); |
+ // Verifies whether the socket complies with cast channel policy. |
+ // Audio only channel policy mandates that a device declaring a video out |
+ // capability must not have a certificate with audio only policy. |
+ bool VerifyChannelPolicy(const AuthResult& result); |
+ |
// Delegate for receiving handshake messages/errors. |
AuthTransportDelegate auth_delegate_; |
@@ -294,6 +310,9 @@ class CastSocketImpl : public CastSocket { |
// canceled. |
bool is_canceled_; |
+ // Capabilities declared by the cast device. |
+ long device_capabilities_; |
+ |
// Connection flow state machine state. |
proto::ConnectionState connect_state_; |