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

Unified Diff: extensions/browser/api/cast_channel/cast_channel_api.cc

Issue 807723004: Cast audio only policy enforcement support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check audio only policy against client auth certificate part of the response 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_channel_api.cc
diff --git a/extensions/browser/api/cast_channel/cast_channel_api.cc b/extensions/browser/api/cast_channel/cast_channel_api.cc
index 08e05d42746ccba4fd355d754855ad717e5c3471..73d1b149d057fade7c495d35faf3f2b1dfe50d07 100644
--- a/extensions/browser/api/cast_channel/cast_channel_api.cc
+++ b/extensions/browser/api/cast_channel/cast_channel_api.cc
@@ -30,6 +30,15 @@
// Used if not otherwise specified at ConnectInfo::timeout.
const int kDefaultConnectTimeoutMillis = 5000; // 5 seconds.
+// Cast device capabilities.
+enum CastDeviceCapability {
+ VIDEO_OUT = (1 << 0),
mark a. foltz 2015/01/12 22:01:57 I don't think the parenthesis are necessary.
vadimgo 2015/01/13 00:08:27 Removed parenthesis.
+ VIDEO_IN = (1 << 1),
+ AUDIO_OUT = (1 << 2),
+ AUDIO_IN = (1 << 3),
+ DEV_MODE = (1 << 4)
+};
+
namespace extensions {
namespace Close = cast_channel::Close;
@@ -348,6 +357,16 @@ void CastChannelOpenFunction::AsyncWorkStart() {
? *connect_info_->timeout
: kDefaultConnectTimeoutMillis),
api_->GetLogger());
+
+ // If device capabilities are available in the connect information, pass the
mark a. foltz 2015/01/12 22:01:56 Slightly prefer to pass the capabilities in the Ca
vadimgo 2015/01/13 00:08:27 Changed to pass device capabilities to the socket
+ // claimed video out capability to the socket for audio only policy
+ // enforcement.
+ if (connect_info_->capabilities.get()) {
+ bool has_video_out =
+ (*connect_info_->capabilities & CastDeviceCapability::VIDEO_OUT) ==
+ CastDeviceCapability::VIDEO_OUT;
+ socket->set_has_video_out(has_video_out);
mark a. foltz 2015/01/12 22:01:56 ISTM we should have an API like socket->HasCapabi
vadimgo 2015/01/13 00:08:27 This code is removed with the new api design.
+ }
}
new_channel_id_ = AddSocket(socket);
scoped_ptr<CastMessageHandler> delegate(new CastMessageHandler(api_, socket));

Powered by Google App Engine
This is Rietveld 408576698