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

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

Issue 103113002: Mojo: (POSIX) Pass channel handle to child. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years 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_handle.h ('k') | mojo/system/platform_channel_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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "mojo/system/platform_channel_handle.h"
6
7 #include "build/build_config.h"
8 #if defined(OS_POSIX)
9 #include <unistd.h>
10 #elif defined(OS_WIN)
11 #include <windows.h>
12 #else
13 #error "Platform not yet supported."
14 #endif
15
16 #include "base/logging.h"
17
18 namespace mojo {
19 namespace system {
20
21 void PlatformChannelHandle::CloseIfNecessary() {
22 if (!is_valid())
23 return;
24
25 #if defined(OS_POSIX)
26 DPCHECK(close(fd) == 0);
27 fd = -1;
28 #elif defined(OS_WIN)
29 DPCHECK(CloseHandle(handle));
30 handle = INVALID_HANDLE_VALUE;
31 #else
32 #error "Platform not yet supported."
33 #endif
34 }
35
36 } // namespace system
37 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/platform_channel_handle.h ('k') | mojo/system/platform_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698