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

Side by Side Diff: mojo/edk/embedder/connection_param.cc

Issue 2735113003: Changing SpawnChild to return a struct.
Patch Set: 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
« no previous file with comments | « mojo/edk/embedder/connection_param.h ('k') | mojo/edk/embedder/embedder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « mojo/edk/embedder/connection_param.h ('k') | mojo/edk/embedder/embedder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698