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

Unified Diff: content/common/child_process_sandbox_support_impl_linux.cc

Issue 8914026: Revert 114539 - Move content::MakeSharedMemorySegmentViaIPC into its own file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: content/common/child_process_sandbox_support_impl_linux.cc
===================================================================
--- content/common/child_process_sandbox_support_impl_linux.cc (revision 114541)
+++ content/common/child_process_sandbox_support_impl_linux.cc (working copy)
@@ -7,14 +7,19 @@
#include <sys/stat.h>
#include "base/eintr_wrapper.h"
+#include "base/global_descriptors_posix.h"
#include "base/memory/scoped_ptr.h"
#include "base/pickle.h"
-#include "content/common/child_process_sandbox_support_impl_linux.h"
+#include "content/common/chrome_descriptors.h"
#include "content/common/sandbox_methods_linux.h"
#include "content/common/unix_domain_socket_posix.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/linux/WebFontFamily.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/linux/WebFontRenderStyle.h"
+static int GetSandboxFD() {
+ return kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor;
+}
+
namespace content {
void GetFontFamilyForCharacters(const uint16_t* utf16,
@@ -82,6 +87,21 @@
}
}
+int MakeSharedMemorySegmentViaIPC(size_t length, bool executable) {
+ Pickle request;
+ request.WriteInt(LinuxSandbox::METHOD_MAKE_SHARED_MEMORY_SEGMENT);
+ request.WriteUInt32(length);
+ request.WriteBool(executable);
+ uint8_t reply_buf[10];
+ int result_fd;
+ ssize_t result = UnixDomainSocket::SendRecvMsg(GetSandboxFD(),
+ reply_buf, sizeof(reply_buf),
+ &result_fd, request);
+ if (result == -1)
+ return -1;
+ return result_fd;
+}
+
int MatchFontWithFallback(const std::string& face, bool bold,
bool italic, int charset) {
Pickle request;

Powered by Google App Engine
This is Rietveld 408576698