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

Side by Side Diff: content/browser/renderer_host/render_sandbox_host_linux.cc

Issue 8590028: Use new getFontFamilyForCharacters() API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « no previous file | content/common/child_process_sandbox_support_impl_linux.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_sandbox_host_linux.h" 5 #include "content/browser/renderer_host/render_sandbox_host_linux.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <fontconfig/fontconfig.h> 8 #include <fontconfig/fontconfig.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 return; 260 return;
261 } 261 }
262 262
263 chars[i] = c; 263 chars[i] = c;
264 } 264 }
265 265
266 std::string preferred_locale; 266 std::string preferred_locale;
267 if (!pickle.ReadString(&iter, &preferred_locale)) 267 if (!pickle.ReadString(&iter, &preferred_locale))
268 return; 268 return;
269 269
270 WebCString family = WebFontInfo::familyForChars(chars.get(), 270 WebKit::WebFontFamily family;
271 num_chars, 271 WebFontInfo::familyForChars(chars.get(),
272 preferred_locale.c_str()); 272 num_chars,
273 preferred_locale.c_str(),
274 &family);
273 275
274 Pickle reply; 276 Pickle reply;
275 if (family.data()) { 277 if (family.name.data()) {
276 reply.WriteString(family.data()); 278 reply.WriteString(family.name.data());
277 } else { 279 } else {
278 reply.WriteString(""); 280 reply.WriteString("");
279 } 281 }
282 reply.WriteBool(family.isBold);
283 reply.WriteBool(family.isItalic);
280 SendRendererReply(fds, reply, -1); 284 SendRendererReply(fds, reply, -1);
281 } 285 }
282 286
283 void HandleGetStyleForStrike(int fd, const Pickle& pickle, void* iter, 287 void HandleGetStyleForStrike(int fd, const Pickle& pickle, void* iter,
284 std::vector<int>& fds) { 288 std::vector<int>& fds) {
285 std::string family; 289 std::string family;
286 int sizeAndStyle; 290 int sizeAndStyle;
287 291
288 if (!pickle.ReadString(&iter, &family) || 292 if (!pickle.ReadString(&iter, &family) ||
289 !pickle.ReadInt(&iter, &sizeAndStyle)) { 293 !pickle.ReadInt(&iter, &sizeAndStyle)) {
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 } 716 }
713 717
714 RenderSandboxHostLinux::~RenderSandboxHostLinux() { 718 RenderSandboxHostLinux::~RenderSandboxHostLinux() {
715 if (initialized_) { 719 if (initialized_) {
716 if (HANDLE_EINTR(close(renderer_socket_)) < 0) 720 if (HANDLE_EINTR(close(renderer_socket_)) < 0)
717 PLOG(ERROR) << "close"; 721 PLOG(ERROR) << "close";
718 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0) 722 if (HANDLE_EINTR(close(childs_lifeline_fd_)) < 0)
719 PLOG(ERROR) << "close"; 723 PLOG(ERROR) << "close";
720 } 724 }
721 } 725 }
OLDNEW
« no previous file with comments | « no previous file | content/common/child_process_sandbox_support_impl_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698