OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 "mojo/edk/embedder/connection_param.h" |
| 6 |
| 7 #include <utility> |
| 8 |
| 9 namespace mojo { |
| 10 namespace edk { |
| 11 |
| 12 ConnectionParam::ConnectionParam(ScopedPlatformHandle channel) |
| 13 : channel_(std::move(channel)) {} |
| 14 |
| 15 #if defined(OS_ANDROID) |
| 16 ConnectionParam::ConnectionParam( |
| 17 ScopedPlatformHandle channel, |
| 18 base::android::ParcelableChannelClient parcelable_channel_client, |
| 19 base::android::ParcelableChannelServer parcelable_channel_server) |
| 20 : channel_(std::move(channel)), |
| 21 parcelable_channel_client_(std::move(parcelable_channel_client)), |
| 22 parcelable_channel_server_(std::move(parcelable_channel_server)) {} |
| 23 #endif |
| 24 |
| 25 ConnectionParam::ConnectionParam(ConnectionParam&& param) |
| 26 : channel_(std::move(param.channel_)) |
| 27 #if defined(OS_ANDROID) |
| 28 , |
| 29 parcelable_channel_client_(std::move(param.parcelable_channel_client_)), |
| 30 parcelable_channel_server_(std::move(param.parcelable_channel_server_)) |
| 31 #endif |
| 32 { |
| 33 } |
| 34 |
| 35 ConnectionParam& ConnectionParam::operator=(ConnectionParam&& param) { |
| 36 channel_ = std::move(param.channel_); |
| 37 #if defined(OS_ANDROID) |
| 38 parcelable_channel_client_ = std::move(param.parcelable_channel_client_); |
| 39 parcelable_channel_server_ = std::move(param.parcelable_channel_server_); |
| 40 #endif |
| 41 return *this; |
| 42 } |
| 43 |
| 44 ScopedPlatformHandle ConnectionParam::TakeChannelHandle() { |
| 45 return std::move(channel_); |
| 46 } |
| 47 |
| 48 #if defined(OS_ANDROID) |
| 49 base::android::ParcelableChannelClient |
| 50 ConnectionParam::TakeParcelableChannelClient() { |
| 51 return std::move(parcelable_channel_client_); |
| 52 } |
| 53 |
| 54 base::android::ParcelableChannelServer |
| 55 ConnectionParam::TakeParcelableChannelServer() { |
| 56 return std::move(parcelable_channel_server_); |
| 57 } |
| 58 |
| 59 #endif |
| 60 |
| 61 } // namespace edk |
| 62 } // namespace mojo |
OLD | NEW |