OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/public/bindings/lib/message.h" | 5 #include "mojo/public/bindings/lib/message.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
| 9 #include <algorithm> |
| 10 |
9 namespace mojo { | 11 namespace mojo { |
10 | 12 |
11 Message::Message() | 13 Message::Message() |
12 : data(NULL) { | 14 : data(NULL) { |
13 } | 15 } |
14 | 16 |
15 Message::~Message() { | 17 Message::~Message() { |
16 free(data); | 18 free(data); |
17 } | 19 } |
18 | 20 |
| 21 void Message::Swap(Message* other) { |
| 22 std::swap(data, other->data); |
| 23 std::swap(handles, other->handles); |
| 24 } |
| 25 |
19 } // namespace mojo | 26 } // namespace mojo |
OLD | NEW |