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

Side by Side Diff: mojo/system/platform_channel_pair.cc

Issue 137273003: Mojo: Rename PlatformChannelHandle to PlatformHandle, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « mojo/system/platform_channel_pair.h ('k') | mojo/system/platform_channel_pair_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/system/platform_channel_pair.h" 5 #include "mojo/system/platform_channel_pair.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/system/platform_channel.h"
9 8
10 namespace mojo { 9 namespace mojo {
11 namespace system { 10 namespace system {
12 11
13 PlatformChannelPair::~PlatformChannelPair() { 12 PlatformChannelPair::~PlatformChannelPair() {
14 server_handle_.CloseIfNecessary();
15 client_handle_.CloseIfNecessary();
16 } 13 }
17 14
18 scoped_ptr<PlatformChannel> PlatformChannelPair::CreateServerChannel() { 15 ScopedPlatformHandle PlatformChannelPair::PassServerHandle() {
19 if (!server_handle_.is_valid()) { 16 return server_handle_.Pass();
20 LOG(WARNING) << "Server handle invalid";
21 return scoped_ptr<PlatformChannel>();
22 }
23
24 scoped_ptr<PlatformChannel> rv =
25 PlatformChannel::CreateFromHandle(server_handle_);
26 server_handle_ = PlatformChannelHandle();
27 return rv.Pass();
28 } 17 }
29 18
30 scoped_ptr<PlatformChannel> PlatformChannelPair::CreateClientChannel() { 19 ScopedPlatformHandle PlatformChannelPair::PassClientHandle() {
31 if (!client_handle_.is_valid()) { 20 return client_handle_.Pass();
32 LOG(WARNING) << "Client handle invalid";
33 return scoped_ptr<PlatformChannel>();
34 }
35
36 scoped_ptr<PlatformChannel> rv =
37 PlatformChannel::CreateFromHandle(client_handle_);
38 client_handle_ = PlatformChannelHandle();
39 return rv.Pass();
40 } 21 }
41 22
42 } // namespace system 23 } // namespace system
43 } // namespace mojo 24 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/platform_channel_pair.h ('k') | mojo/system/platform_channel_pair_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698