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

Unified Diff: chrome/renderer/renderer_sandbox_support_linux.cc

Issue 669055: Add support for running the NaCl plugin in the Linux SUID sandbox (Closed)
Patch Set: Removed tab char; removed change to test (which assumed the NaCl-side change) Created 10 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/renderer_sandbox_support_linux.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/renderer_sandbox_support_linux.cc
diff --git a/chrome/renderer/renderer_sandbox_support_linux.cc b/chrome/renderer/renderer_sandbox_support_linux.cc
index 1c4a60dc65dc9ac4de32bf182f966326dc0c2e0e..f1d03e3ac4d5c8c4faba23ca464211eb4a30d605 100644
--- a/chrome/renderer/renderer_sandbox_support_linux.cc
+++ b/chrome/renderer/renderer_sandbox_support_linux.cc
@@ -12,6 +12,10 @@
#include "third_party/WebKit/WebKit/chromium/public/linux/WebFontRenderStyle.h"
+static int GetSandboxFD() {
+ return kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor;
+}
+
namespace renderer_sandbox_support {
std::string getFontFamilyForCharacters(const uint16_t* utf16, size_t num_utf16) {
@@ -22,9 +26,7 @@ std::string getFontFamilyForCharacters(const uint16_t* utf16, size_t num_utf16)
request.WriteUInt32(utf16[i]);
uint8_t buf[512];
- const int sandbox_fd =
- kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor;
- const ssize_t n = base::SendRecvMsg(sandbox_fd, buf, sizeof(buf), NULL,
+ const ssize_t n = base::SendRecvMsg(GetSandboxFD(), buf, sizeof(buf), NULL,
request);
std::string family_name;
@@ -45,9 +47,7 @@ void getRenderStyleForStrike(const char* family, int sizeAndStyle,
request.WriteInt(sizeAndStyle);
uint8_t buf[512];
- const int sandbox_fd =
- kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor;
- const ssize_t n = base::SendRecvMsg(sandbox_fd, buf, sizeof(buf), NULL,
+ const ssize_t n = base::SendRecvMsg(GetSandboxFD(), buf, sizeof(buf), NULL,
request);
out->setDefaults();
@@ -73,4 +73,18 @@ void getRenderStyleForStrike(const char* family, int sizeAndStyle,
}
}
+int MakeSharedMemorySegmentViaIPC(size_t length) {
+ Pickle request;
+ request.WriteInt(LinuxSandbox::METHOD_MAKE_SHARED_MEMORY_SEGMENT);
+ request.WriteUInt32(length);
+ uint8_t reply_buf[10];
+ int result_fd;
+ ssize_t result = base::SendRecvMsg(GetSandboxFD(),
+ reply_buf, sizeof(reply_buf),
+ &result_fd, request);
+ if (result == -1)
+ return -1;
+ return result_fd;
+}
+
} // namespace render_sandbox_support
« 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