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

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

Issue 2071143003: Various changes to make Mojo work under NaCl non-sfi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GYP build. Created 4 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
« no previous file with comments | « mojo/edk/embedder/platform_channel_pair_posix.cc ('k') | mojo/edk/system/node_channel.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/edk/embedder/platform_channel_utils_posix.h" 5 #include "mojo/edk/embedder/platform_channel_utils_posix.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <sys/socket.h> 8 #include <sys/socket.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 const int kSendFlags = MSG_NOSIGNAL; 52 const int kSendFlags = MSG_NOSIGNAL;
53 #endif 53 #endif
54 54
55 ssize_t PlatformChannelWrite(PlatformHandle h, 55 ssize_t PlatformChannelWrite(PlatformHandle h,
56 const void* bytes, 56 const void* bytes,
57 size_t num_bytes) { 57 size_t num_bytes) {
58 DCHECK(h.is_valid()); 58 DCHECK(h.is_valid());
59 DCHECK(bytes); 59 DCHECK(bytes);
60 DCHECK_GT(num_bytes, 0u); 60 DCHECK_GT(num_bytes, 0u);
61 61
62 #if defined(OS_MACOSX) 62 #if defined(OS_MACOSX) || defined(OS_NACL_NONSFI)
63 // send() doesn't appear to work under NaCl-nonsfi.
Mark Seaborn 2016/06/20 21:12:15 You can be more definite: "doesn't appear to work"
Anand Mistry (off Chromium) 2016/06/21 00:32:27 Done.
63 return HANDLE_EINTR(write(h.handle, bytes, num_bytes)); 64 return HANDLE_EINTR(write(h.handle, bytes, num_bytes));
64 #else 65 #else
65 return send(h.handle, bytes, num_bytes, kSendFlags); 66 return send(h.handle, bytes, num_bytes, kSendFlags);
66 #endif 67 #endif
67 } 68 }
68 69
69 ssize_t PlatformChannelWritev(PlatformHandle h, 70 ssize_t PlatformChannelWritev(PlatformHandle h,
70 struct iovec* iov, 71 struct iovec* iov,
71 size_t num_iov) { 72 size_t num_iov) {
72 DCHECK(h.is_valid()); 73 DCHECK(h.is_valid());
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 DCHECK(platform_handles->back().is_valid()); 188 DCHECK(platform_handles->back().is_valid());
188 } 189 }
189 } 190 }
190 } 191 }
191 192
192 return result; 193 return result;
193 } 194 }
194 195
195 } // namespace edk 196 } // namespace edk
196 } // namespace mojo 197 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/embedder/platform_channel_pair_posix.cc ('k') | mojo/edk/system/node_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698