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

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

Issue 336153003: Keep track of paths for fallback fonts in sandbox_ipc_linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on fciId->fontconfigInterfaceId rename Created 6 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
« no previous file with comments | « no previous file | content/common/child_process_sandbox_support_impl_linux.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/sandbox_ipc_linux.h" 5 #include "content/browser/renderer_host/sandbox_ipc_linux.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <fontconfig/fontconfig.h> 8 #include <fontconfig/fontconfig.h>
9 #include <sys/poll.h> 9 #include <sys/poll.h>
10 #include <sys/socket.h> 10 #include <sys/socket.h>
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 if (!pickle.ReadInt(&iter, &c)) 324 if (!pickle.ReadInt(&iter, &c))
325 return; 325 return;
326 326
327 std::string preferred_locale; 327 std::string preferred_locale;
328 if (!pickle.ReadString(&iter, &preferred_locale)) 328 if (!pickle.ReadString(&iter, &preferred_locale))
329 return; 329 return;
330 330
331 blink::WebFallbackFont fallbackFont; 331 blink::WebFallbackFont fallbackFont;
332 WebFontInfo::fallbackFontForChar(c, preferred_locale.c_str(), &fallbackFont); 332 WebFontInfo::fallbackFontForChar(c, preferred_locale.c_str(), &fallbackFont);
333 333
334 int pathIndex = FindOrAddPath(SkString(fallbackFont.filename.data()));
335 fallbackFont.fontconfigInterfaceId = pathIndex;
336
334 Pickle reply; 337 Pickle reply;
335 if (fallbackFont.name.data()) { 338 if (fallbackFont.name.data()) {
336 reply.WriteString(fallbackFont.name.data()); 339 reply.WriteString(fallbackFont.name.data());
337 } else { 340 } else {
338 reply.WriteString(std::string()); 341 reply.WriteString(std::string());
339 } 342 }
340 if (fallbackFont.filename.data()) { 343 if (fallbackFont.filename.data()) {
341 reply.WriteString(fallbackFont.filename.data()); 344 reply.WriteString(fallbackFont.filename.data());
342 } else { 345 } else {
343 reply.WriteString(std::string()); 346 reply.WriteString(std::string());
344 } 347 }
348 reply.WriteInt(fallbackFont.fontconfigInterfaceId);
345 reply.WriteInt(fallbackFont.ttcIndex); 349 reply.WriteInt(fallbackFont.ttcIndex);
346 reply.WriteBool(fallbackFont.isBold); 350 reply.WriteBool(fallbackFont.isBold);
347 reply.WriteBool(fallbackFont.isItalic); 351 reply.WriteBool(fallbackFont.isItalic);
348 SendRendererReply(fds, reply, -1); 352 SendRendererReply(fds, reply, -1);
349 } 353 }
350 354
351 void SandboxIPCHandler::HandleGetStyleForStrike( 355 void SandboxIPCHandler::HandleGetStyleForStrike(
352 int fd, 356 int fd,
353 const Pickle& pickle, 357 const Pickle& pickle,
354 PickleIterator iter, 358 PickleIterator iter,
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 } 645 }
642 646
643 void SandboxIPCHandler::EnsureWebKitInitialized() { 647 void SandboxIPCHandler::EnsureWebKitInitialized() {
644 if (webkit_platform_support_) 648 if (webkit_platform_support_)
645 return; 649 return;
646 webkit_platform_support_.reset(new BlinkPlatformImpl); 650 webkit_platform_support_.reset(new BlinkPlatformImpl);
647 blink::initializeWithoutV8(webkit_platform_support_.get()); 651 blink::initializeWithoutV8(webkit_platform_support_.get());
648 } 652 }
649 653
650 } // namespace content 654 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/child_process_sandbox_support_impl_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698