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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // LICENSE file.
4
5 #include "chrome/renderer/renderer_sandbox_support_linux.h"
6
7 #include "base/pickle.h"
8 #include "base/unix_domain_socket_posix.h"
9 #include "chrome/common/sandbox_methods_linux.h"
10
11 namespace renderer_sandbox_support {
12
13 std::string getFontFamilyForCharacters(const uint16_t* utf16, size_t num_utf16) {
14 Pickle request;
15 request.WriteInt(LinuxSandbox::METHOD_GET_FONT_FAMILY_FOR_CHARS);
16 request.WriteInt(num_utf16);
17 for (size_t i = 0; i < num_utf16; ++i)
18 request.WriteUInt32(utf16[i]);
19
20 uint8_t buf[512];
21 static const int kMagicSandboxFD = 4;
22 const ssize_t n = base::SendRecvMsg(kMagicSandboxFD, buf, sizeof(buf), NULL,
23 request);
24
25 std::string family_name;
26 if (n != -1) {
27 Pickle reply(reinterpret_cast<char*>(buf), n);
28 void* pickle_iter = NULL;
29 reply.ReadString(&pickle_iter, &family_name);
30 }
31
32 return family_name;
33 }
34
35 } // namespace render_sandbox_support
OLDNEW
« 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