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

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

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more cleanup Created 5 years, 2 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
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 "third_party/mojo/src/mojo/edk/embedder/platform_channel_utils_posix.h" 5 #include "mojo/edk/embedder/platform_channel_utils_posix.h"
6 6
7 #include <sys/socket.h> 7 #include <sys/socket.h>
8 #include <sys/uio.h> 8 #include <sys/uio.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/posix/eintr_wrapper.h" 12 #include "base/posix/eintr_wrapper.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 14
15 namespace mojo { 15 namespace mojo {
16 namespace embedder { 16 namespace edk {
17 17
18 // On Linux, |SIGPIPE| is suppressed by passing |MSG_NOSIGNAL| to 18 // On Linux, |SIGPIPE| is suppressed by passing |MSG_NOSIGNAL| to
19 // |send()|/|sendmsg()|. (There is no way of suppressing |SIGPIPE| on 19 // |send()|/|sendmsg()|. (There is no way of suppressing |SIGPIPE| on
20 // |write()|/|writev().) On Mac, |SIGPIPE| is suppressed by setting the 20 // |write()|/|writev().) On Mac, |SIGPIPE| is suppressed by setting the
21 // |SO_NOSIGPIPE| option on the socket. 21 // |SO_NOSIGPIPE| option on the socket.
22 // 22 //
23 // Performance notes: 23 // Performance notes:
24 // - On Linux, we have to use |send()|/|sendmsg()| rather than 24 // - On Linux, we have to use |send()|/|sendmsg()| rather than
25 // |write()|/|writev()| in order to suppress |SIGPIPE|. This is okay, since 25 // |write()|/|writev()| in order to suppress |SIGPIPE|. This is okay, since
26 // |send()| is (slightly) faster than |write()| (!), while |sendmsg()| is 26 // |send()| is (slightly) faster than |write()| (!), while |sendmsg()| is
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 for (size_t i = 0; i < num_fds; i++) { 175 for (size_t i = 0; i < num_fds; i++) {
176 platform_handles->push_back(PlatformHandle(fds[i])); 176 platform_handles->push_back(PlatformHandle(fds[i]));
177 DCHECK(platform_handles->back().is_valid()); 177 DCHECK(platform_handles->back().is_valid());
178 } 178 }
179 } 179 }
180 } 180 }
181 181
182 return result; 182 return result;
183 } 183 }
184 184
185 } // namespace embedder 185 } // namespace edk
186 } // namespace mojo 186 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698