Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: extensions/browser/api/cast_channel/cast_socket.h

Issue 807723004: Cast audio only policy enforcement support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed windows compiler warning Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_;
« no previous file with comments | « extensions/browser/api/cast_channel/cast_channel_api.cc ('k') | extensions/browser/api/cast_channel/cast_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698