OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/public/common/message_port_message.h" |
| 6 |
| 7 namespace content { |
| 8 |
| 9 MessagePortMessage::MessagePortMessage() { |
| 10 } |
| 11 |
| 12 MessagePortMessage::MessagePortMessage(const base::string16& message) |
| 13 : message_as_string(message) { |
| 14 } |
| 15 |
| 16 MessagePortMessage::MessagePortMessage(const base::Value* message) { |
| 17 message_as_value.Append(message->DeepCopy()); |
| 18 } |
| 19 |
| 20 MessagePortMessage::MessagePortMessage(const MessagePortMessage& other) { |
| 21 *this = other; |
| 22 } |
| 23 |
| 24 MessagePortMessage& MessagePortMessage::operator=( |
| 25 const MessagePortMessage& other) { |
| 26 message_as_string = other.message_as_string; |
| 27 message_as_value.Clear(); |
| 28 const base::Value* value; |
| 29 if (other.message_as_value.Get(0, &value)) |
| 30 message_as_value.Append(value->DeepCopy()); |
| 31 return *this; |
| 32 } |
| 33 |
| 34 MessagePortMessage::~MessagePortMessage() { |
| 35 } |
| 36 |
| 37 } // namespace content |
OLD | NEW |