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

Unified Diff: chrome/renderer/renderer_sandbox_support_linux.cc

Issue 132007: Linux: plumb fontconfig call out to the sandbox host. (Closed)
Patch Set: ... Created 11 years, 6 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') | chrome/renderer/renderer_webkitclient_impl.h » ('j') | 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
new file mode 100644
index 0000000000000000000000000000000000000000..29fe183bb23f55e4eded9ed296a0283ddbff7d48
--- /dev/null
+++ b/chrome/renderer/renderer_sandbox_support_linux.cc
@@ -0,0 +1,35 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+
+#include "chrome/renderer/renderer_sandbox_support_linux.h"
+
+#include "base/pickle.h"
+#include "base/unix_domain_socket_posix.h"
+#include "chrome/common/sandbox_methods_linux.h"
+
+namespace renderer_sandbox_support {
+
+std::string getFontFamilyForCharacters(const uint16_t* utf16, size_t num_utf16) {
+ Pickle request;
+ request.WriteInt(LinuxSandbox::METHOD_GET_FONT_FAMILY_FOR_CHARS);
+ request.WriteInt(num_utf16);
+ for (size_t i = 0; i < num_utf16; ++i)
+ request.WriteUInt32(utf16[i]);
+
+ uint8_t buf[512];
+ static const int kMagicSandboxFD = 4;
+ const ssize_t n = base::SendRecvMsg(kMagicSandboxFD, buf, sizeof(buf), NULL,
+ request);
+
+ std::string family_name;
+ if (n != -1) {
+ Pickle reply(reinterpret_cast<char*>(buf), n);
+ void* pickle_iter = NULL;
+ reply.ReadString(&pickle_iter, &family_name);
+ }
+
+ return family_name;
+}
+
+} // namespace render_sandbox_support
« no previous file with comments | « chrome/renderer/renderer_sandbox_support_linux.h ('k') | chrome/renderer/renderer_webkitclient_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698