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

Side by Side 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, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/common/presentation_connection_message.h" 5 #include "content/public/common/presentation_connection_message.h"
6 6
7 #include <utility>
8
7 namespace content { 9 namespace content {
8 10
11 // TODO(crbug.com/524128): This restriction comes from Cast. Raise this limit
12 // for non-Cast presentations.
13 const size_t kMaxPresentationConnectionMessageSize = 64 * 1024; // 64 KB.
14
15 PresentationConnectionMessage::PresentationConnectionMessage() = default;
16
9 PresentationConnectionMessage::PresentationConnectionMessage( 17 PresentationConnectionMessage::PresentationConnectionMessage(
10 PresentationMessageType type) 18 std::string message)
11 : type(type) {} 19 : message(std::move(message)) {}
20
21 PresentationConnectionMessage::PresentationConnectionMessage(
22 std::vector<uint8_t> data)
23 : data(std::move(data)) {}
24
25 PresentationConnectionMessage::PresentationConnectionMessage(
26 PresentationConnectionMessage&& other) = default;
12 27
13 PresentationConnectionMessage::~PresentationConnectionMessage() {} 28 PresentationConnectionMessage::~PresentationConnectionMessage() {}
14 29
30 bool PresentationConnectionMessage::operator==(
31 const PresentationConnectionMessage& other) const {
32 return this->data == other.data && this->message == other.message;
33 }
34
35 PresentationConnectionMessage& PresentationConnectionMessage::operator=(
36 PresentationConnectionMessage&& other) = default;
37
15 bool PresentationConnectionMessage::is_binary() const { 38 bool PresentationConnectionMessage::is_binary() const {
16 return data != nullptr; 39 return data.has_value();
17 } 40 }
18 41
19 } // namespace content 42 } // namespace content
OLDNEW
« 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