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

Side by Side Diff: content/common/child_process_sandbox_support_impl_linux.cc

Issue 8585002: Give base::SharedMemory::CreateAnonymous an executable flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/common/child_process_sandbox_support_impl_linux.h" 5 #include "content/common/child_process_sandbox_support_impl_linux.h"
6 6
7 #include <sys/stat.h> 7 #include <sys/stat.h>
8 8
9 #include "base/eintr_wrapper.h" 9 #include "base/eintr_wrapper.h"
10 #include "base/global_descriptors_posix.h" 10 #include "base/global_descriptors_posix.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 out->hintStyle = hintStyle; 76 out->hintStyle = hintStyle;
77 out->useAntiAlias = useAntiAlias; 77 out->useAntiAlias = useAntiAlias;
78 out->useSubpixel = useSubpixel; 78 out->useSubpixel = useSubpixel;
79 } 79 }
80 } 80 }
81 81
82 int MakeSharedMemorySegmentViaIPC(size_t length, bool executable) { 82 int MakeSharedMemorySegmentViaIPC(size_t length, bool executable) {
83 Pickle request; 83 Pickle request;
84 request.WriteInt(LinuxSandbox::METHOD_MAKE_SHARED_MEMORY_SEGMENT); 84 request.WriteInt(LinuxSandbox::METHOD_MAKE_SHARED_MEMORY_SEGMENT);
85 request.WriteUInt32(length); 85 request.WriteUInt32(length);
86 request.WriteBool(executable);
86 uint8_t reply_buf[10]; 87 uint8_t reply_buf[10];
87 int result_fd; 88 int result_fd;
88 ssize_t result = UnixDomainSocket::SendRecvMsg(GetSandboxFD(), 89 ssize_t result = UnixDomainSocket::SendRecvMsg(GetSandboxFD(),
89 reply_buf, sizeof(reply_buf), 90 reply_buf, sizeof(reply_buf),
90 &result_fd, request); 91 &result_fd, request);
91 if (result == -1) 92 if (result == -1)
92 return -1; 93 return -1;
93 return result_fd; 94 return result_fd;
94 } 95 }
95 96
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 180
180 *output_length = length; 181 *output_length = length;
181 n = HANDLE_EINTR(pread(fd, output, length, offset)); 182 n = HANDLE_EINTR(pread(fd, output, length, offset));
182 if (n != static_cast<ssize_t>(length)) 183 if (n != static_cast<ssize_t>(length))
183 return false; 184 return false;
184 185
185 return true; 186 return true;
186 } 187 }
187 188
188 } // namespace content 189 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698