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

Unified Diff: content/public/common/presentation_connection_message.cc

Issue 2706463002: [Presentation API] Mojo typemap for content::PresentationConnectionMessage (Closed)
Patch Set: Fix compile error after rebase Created 3 years, 10 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: content/public/common/presentation_connection_message.cc
diff --git a/content/public/common/presentation_connection_message.cc b/content/public/common/presentation_connection_message.cc
index 1e960c18e827e8ddedf1d31f501dda49e9d3c120..222e2141ac37ace61f429447d9bac1ebe52d5003 100644
--- a/content/public/common/presentation_connection_message.cc
+++ b/content/public/common/presentation_connection_message.cc
@@ -4,16 +4,39 @@
#include "content/public/common/presentation_connection_message.h"
+#include <utility>
+
namespace content {
+// TODO(crbug.com/524128): This restriction comes from Cast. Raise this limit
+// for non-Cast presentations.
+const size_t kMaxPresentationConnectionMessageSize = 64 * 1024; // 64 KB.
+
+PresentationConnectionMessage::PresentationConnectionMessage() = default;
+
+PresentationConnectionMessage::PresentationConnectionMessage(
+ std::string message)
+ : message(std::move(message)) {}
+
PresentationConnectionMessage::PresentationConnectionMessage(
- PresentationMessageType type)
- : type(type) {}
+ std::vector<uint8_t> data)
+ : data(std::move(data)) {}
+
+PresentationConnectionMessage::PresentationConnectionMessage(
+ PresentationConnectionMessage&& other) = default;
PresentationConnectionMessage::~PresentationConnectionMessage() {}
+bool PresentationConnectionMessage::operator==(
+ const PresentationConnectionMessage& other) const {
+ return this->data == other.data && this->message == other.message;
+}
+
+PresentationConnectionMessage& PresentationConnectionMessage::operator=(
+ PresentationConnectionMessage&& other) = default;
+
bool PresentationConnectionMessage::is_binary() const {
- return data != nullptr;
+ return data.has_value();
}
} // namespace content
« no previous file with comments | « content/public/common/presentation_connection_message.h ('k') | content/public/common/presentation_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698