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

Unified Diff: mojo/edk/embedder/platform_channel_pair.cc

Issue 1659213002: Move PlatformChannelPair to //mojo/edk/platform and rename it PlatformPipe. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/embedder/platform_channel_pair.h ('k') | mojo/edk/embedder/platform_channel_pair_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/embedder/platform_channel_pair.cc
diff --git a/mojo/edk/embedder/platform_channel_pair.cc b/mojo/edk/embedder/platform_channel_pair.cc
deleted file mode 100644
index 43b6e281c4e57c88e8f049091d236a0b2e0e0b0a..0000000000000000000000000000000000000000
--- a/mojo/edk/embedder/platform_channel_pair.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/edk/embedder/platform_channel_pair.h"
-
-#include <fcntl.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "base/logging.h"
-#include "build/build_config.h"
-#include "mojo/edk/platform/platform_handle.h"
-
-using mojo::platform::PlatformHandle;
-
-namespace mojo {
-namespace embedder {
-
-PlatformChannelPair::PlatformChannelPair() {
- // Create the Unix domain socket and set the ends to nonblocking.
- int fds[2];
- // TODO(vtl): Maybe fail gracefully if |socketpair()| fails.
- PCHECK(socketpair(AF_UNIX, SOCK_STREAM, 0, fds) == 0);
- PCHECK(fcntl(fds[0], F_SETFL, O_NONBLOCK) == 0);
- PCHECK(fcntl(fds[1], F_SETFL, O_NONBLOCK) == 0);
-
-#if defined(OS_MACOSX)
- // This turns off |SIGPIPE| when writing to a closed socket (causing it to
- // fail with |EPIPE| instead). On Linux, we have to use |send...()| with
- // |MSG_NOSIGNAL| -- which is not supported on Mac -- instead.
- int no_sigpipe = 1;
- PCHECK(setsockopt(fds[0], SOL_SOCKET, SO_NOSIGPIPE, &no_sigpipe,
- sizeof(no_sigpipe)) == 0);
- PCHECK(setsockopt(fds[1], SOL_SOCKET, SO_NOSIGPIPE, &no_sigpipe,
- sizeof(no_sigpipe)) == 0);
-#endif // defined(OS_MACOSX)
-
- handle0.reset(PlatformHandle(fds[0]));
- DCHECK(handle0.is_valid());
- handle1.reset(PlatformHandle(fds[1]));
- DCHECK(handle1.is_valid());
-}
-
-PlatformChannelPair::~PlatformChannelPair() {}
-
-} // namespace embedder
-} // namespace mojo
« no previous file with comments | « mojo/edk/embedder/platform_channel_pair.h ('k') | mojo/edk/embedder/platform_channel_pair_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698