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

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

Issue 555283002: Create new class "CastTransport", which encapsulates the message read and write event loops. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added unit tests to CL Created 6 years, 3 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_message_util.cc
diff --git a/extensions/browser/api/cast_channel/cast_message_util.cc b/extensions/browser/api/cast_channel/cast_message_util.cc
index 3cc5ebb2f61e6785e00ade92ea7f0fbd4db3e9e9..fe5b0e850187b7e33297091dbbb1e4f42f4e9113 100644
--- a/extensions/browser/api/cast_channel/cast_message_util.cc
+++ b/extensions/browser/api/cast_channel/cast_message_util.cc
@@ -62,6 +62,13 @@ bool MessageInfoToCastMessage(const MessageInfo& message,
return message_proto->IsInitialized();
}
+bool ValidateCastMessage(const CastMessage& message_proto) {
mark a. foltz 2014/09/11 06:47:45 I think there are also restrictions on namespace (
Kevin M 2014/09/11 18:07:58 Yes. Done.
+ return (message_proto.payload_type() == CastMessage_PayloadType_STRING &&
+ message_proto.has_payload_utf8()) ||
+ (message_proto.payload_type() == CastMessage_PayloadType_BINARY &&
+ message_proto.has_payload_binary());
+}
+
bool CastMessageToMessageInfo(const CastMessage& message_proto,
MessageInfo* message) {
DCHECK(message);

Powered by Google App Engine
This is Rietveld 408576698