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

Side by Side Diff: chrome/renderer/renderer_sandbox_support_linux.cc

Issue 4810002: NaCl: Remove second variant of MakeSharedMemorySegmentViaIPC() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 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
« no previous file with comments | « chrome/renderer/renderer_sandbox_support_linux.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "chrome/renderer/renderer_sandbox_support_linux.h" 5 #include "chrome/renderer/renderer_sandbox_support_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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 reply.ReadInt(&pickle_iter, &useSubpixel)) { 71 reply.ReadInt(&pickle_iter, &useSubpixel)) {
72 out->useBitmaps = useBitmaps; 72 out->useBitmaps = useBitmaps;
73 out->useAutoHint = useAutoHint; 73 out->useAutoHint = useAutoHint;
74 out->useHinting = useHinting; 74 out->useHinting = useHinting;
75 out->hintStyle = hintStyle; 75 out->hintStyle = hintStyle;
76 out->useAntiAlias = useAntiAlias; 76 out->useAntiAlias = useAntiAlias;
77 out->useSubpixel = useSubpixel; 77 out->useSubpixel = useSubpixel;
78 } 78 }
79 } 79 }
80 80
81 int MakeSharedMemorySegmentViaIPC(size_t length) { 81 int MakeSharedMemorySegmentViaIPC(size_t length, bool executable) {
82 Pickle request; 82 Pickle request;
83 request.WriteInt(LinuxSandbox::METHOD_MAKE_SHARED_MEMORY_SEGMENT); 83 request.WriteInt(LinuxSandbox::METHOD_MAKE_SHARED_MEMORY_SEGMENT);
84 request.WriteUInt32(length); 84 request.WriteUInt32(length);
85 uint8_t reply_buf[10]; 85 uint8_t reply_buf[10];
86 int result_fd; 86 int result_fd;
87 ssize_t result = base::SendRecvMsg(GetSandboxFD(), 87 ssize_t result = base::SendRecvMsg(GetSandboxFD(),
88 reply_buf, sizeof(reply_buf), 88 reply_buf, sizeof(reply_buf),
89 &result_fd, request); 89 &result_fd, request);
90 if (result == -1) 90 if (result == -1)
91 return -1; 91 return -1;
92 return result_fd; 92 return result_fd;
93 } 93 }
94 94
95 int MakeSharedMemorySegmentViaIPCExecutable(size_t length, bool executable) {
96 return MakeSharedMemorySegmentViaIPC(length);
97 }
98
99 int MatchFontWithFallback(const std::string& face, bool bold, 95 int MatchFontWithFallback(const std::string& face, bool bold,
100 bool italic, int charset) { 96 bool italic, int charset) {
101 Pickle request; 97 Pickle request;
102 request.WriteInt(LinuxSandbox::METHOD_MATCH_WITH_FALLBACK); 98 request.WriteInt(LinuxSandbox::METHOD_MATCH_WITH_FALLBACK);
103 request.WriteString(face); 99 request.WriteString(face);
104 request.WriteBool(bold); 100 request.WriteBool(bold);
105 request.WriteBool(italic); 101 request.WriteBool(italic);
106 request.WriteUInt32(charset); 102 request.WriteUInt32(charset);
107 uint8_t reply_buf[64]; 103 uint8_t reply_buf[64];
108 int fd = -1; 104 int fd = -1;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 178
183 *output_length = length; 179 *output_length = length;
184 n = HANDLE_EINTR(pread(fd, output, length, offset)); 180 n = HANDLE_EINTR(pread(fd, output, length, offset));
185 if (n != static_cast<ssize_t>(length)) 181 if (n != static_cast<ssize_t>(length))
186 return false; 182 return false;
187 183
188 return true; 184 return true;
189 } 185 }
190 186
191 } // namespace render_sandbox_support 187 } // namespace render_sandbox_support
OLDNEW
« no previous file with comments | « chrome/renderer/renderer_sandbox_support_linux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698