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

Side by Side Diff: remoting/host/setup/pipe.cc

Issue 14979008: unittests for Chromoting native messaging host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows compile warning Created 7 years, 6 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
OLDNEW
(Empty)
1 // Copyright (c) 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 "remoting/host/setup/pipe.h"
6
7 #if defined(OS_WIN)
8 #include <windows.h>
9 #elif defined(OS_POSIX)
10 #include <unistd.h>
11 #endif
12
13 namespace remoting {
14
15 bool MakePipe(base::PlatformFile* read_handle,
16 base::PlatformFile* write_handle) {
17 #if defined(OS_WIN)
18 return CreatePipe(read_handle, write_handle, NULL, 0) != FALSE;
Sergey Ulanov 2013/05/29 19:54:43 FYI: Anonymous pipes on windows may have different
Lambros 2013/05/29 23:50:22 ok thanks for the info, I'll keep as-is.
19 #elif defined(OS_POSIX)
20 int fds[2];
21 if (pipe(fds) == 0) {
22 *read_handle = fds[0];
23 *write_handle = fds[1];
24 return true;
25 }
26 return false;
27 #else
28 #error Not implemented
29 #endif
30 }
31
32 } // namepsace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698