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

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

Issue 8893009: Move content::MakeSharedMemorySegmentViaIPC into its own file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minimal dependencies Created 9 years 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
« no previous file with comments | « content/common/child_process_sandbox_support_impl_linux.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
jam 2011/12/14 01:14:28 child_process_sandbox_support_impl_shm_linux.cc is
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 "base/global_descriptors_posix.h"
6 #include "base/pickle.h"
7 #include "content/common/child_process_sandbox_support_impl_linux.h"
8 #include "content/common/chrome_descriptors.h"
9 #include "content/common/sandbox_methods_linux.h"
10 #include "content/common/unix_domain_socket_posix.h"
11
12 static int GetSandboxFD() {
13 return kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor;
jam 2011/12/14 01:14:28 we shouldn't duplicate this, can we share it someh
14 }
15
16 namespace content {
17
18 int MakeSharedMemorySegmentViaIPC(size_t length, bool executable) {
19 Pickle request;
20 request.WriteInt(LinuxSandbox::METHOD_MAKE_SHARED_MEMORY_SEGMENT);
21 request.WriteUInt32(length);
22 request.WriteBool(executable);
23 uint8_t reply_buf[10];
24 int result_fd;
25 ssize_t result = UnixDomainSocket::SendRecvMsg(GetSandboxFD(),
26 reply_buf, sizeof(reply_buf),
27 &result_fd, request);
28 if (result == -1)
29 return -1;
30 return result_fd;
31 }
32
33 } // namespace content
OLDNEW
« no previous file with comments | « content/common/child_process_sandbox_support_impl_linux.cc ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698