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

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

Issue 413003002: Add FontRenderParamsQuery. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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 <sys/poll.h> 8 #include <sys/poll.h>
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/files/scoped_file.h" 13 #include "base/files/scoped_file.h"
14 #include "base/linux_util.h" 14 #include "base/linux_util.h"
15 #include "base/macros.h"
15 #include "base/memory/scoped_vector.h" 16 #include "base/memory/scoped_vector.h"
16 #include "base/memory/shared_memory.h" 17 #include "base/memory/shared_memory.h"
17 #include "base/posix/eintr_wrapper.h" 18 #include "base/posix/eintr_wrapper.h"
18 #include "base/posix/unix_domain_socket_linux.h" 19 #include "base/posix/unix_domain_socket_linux.h"
19 #include "base/process/launch.h" 20 #include "base/process/launch.h"
20 #include "base/strings/string_number_conversions.h" 21 #include "base/strings/string_number_conversions.h"
21 #include "content/browser/renderer_host/font_utils_linux.h" 22 #include "content/browser/renderer_host/font_utils_linux.h"
22 #include "content/common/font_config_ipc_linux.h" 23 #include "content/common/font_config_ipc_linux.h"
23 #include "content/common/sandbox_linux/sandbox_linux.h" 24 #include "content/common/sandbox_linux/sandbox_linux.h"
24 #include "content/common/set_process_title.h" 25 #include "content/common/set_process_title.h"
25 #include "content/public/common/content_switches.h" 26 #include "content/public/common/content_switches.h"
26 #include "ppapi/c/trusted/ppb_browser_font_trusted.h" 27 #include "ppapi/c/trusted/ppb_browser_font_trusted.h"
27 #include "third_party/WebKit/public/platform/linux/WebFontInfo.h" 28 #include "third_party/WebKit/public/platform/linux/WebFontInfo.h"
28 #include "third_party/WebKit/public/web/WebKit.h" 29 #include "third_party/WebKit/public/web/WebKit.h"
29 #include "third_party/npapi/bindings/npapi_extensions.h" 30 #include "third_party/npapi/bindings/npapi_extensions.h"
30 #include "third_party/skia/include/ports/SkFontConfigInterface.h" 31 #include "third_party/skia/include/ports/SkFontConfigInterface.h"
31 #include "ui/gfx/font_render_params.h" 32 #include "ui/gfx/font_render_params.h"
32 33
33 using blink::WebCString; 34 using blink::WebCString;
34 using blink::WebFontInfo; 35 using blink::WebFontInfo;
35 using blink::WebUChar; 36 using blink::WebUChar;
36 using blink::WebUChar32; 37 using blink::WebUChar32;
37 38
38 namespace content { 39 namespace content {
39 40
40 SandboxIPCHandler::SandboxIPCHandler(int lifeline_fd, int browser_socket) 41 SandboxIPCHandler::SandboxIPCHandler(int lifeline_fd, int browser_socket)
41 : lifeline_fd_(lifeline_fd), browser_socket_(browser_socket) { 42 : lifeline_fd_(lifeline_fd), browser_socket_(browser_socket) {
42 // FontConfig doesn't provide a standard property to control subpixel 43 // FontConfig doesn't provide a standard property to control subpixel
43 // positioning, so we pass the current setting through to WebKit. 44 // positioning, so we pass the current setting through to WebKit.
44 WebFontInfo::setSubpixelPositioning( 45 CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params,
45 gfx::GetDefaultWebKitFontRenderParams().subpixel_positioning); 46 (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(true), NULL)));
47 WebFontInfo::setSubpixelPositioning(params.subpixel_positioning);
46 } 48 }
47 49
48 void SandboxIPCHandler::Run() { 50 void SandboxIPCHandler::Run() {
49 struct pollfd pfds[2]; 51 struct pollfd pfds[2];
50 pfds[0].fd = lifeline_fd_; 52 pfds[0].fd = lifeline_fd_;
51 pfds[0].events = POLLIN; 53 pfds[0].events = POLLIN;
52 pfds[1].fd = browser_socket_; 54 pfds[1].fd = browser_socket_;
53 pfds[1].events = POLLIN; 55 pfds[1].events = POLLIN;
54 56
55 int failed_polls = 0; 57 int failed_polls = 0;
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 412 }
411 413
412 void SandboxIPCHandler::EnsureWebKitInitialized() { 414 void SandboxIPCHandler::EnsureWebKitInitialized() {
413 if (webkit_platform_support_) 415 if (webkit_platform_support_)
414 return; 416 return;
415 webkit_platform_support_.reset(new BlinkPlatformImpl); 417 webkit_platform_support_.reset(new BlinkPlatformImpl);
416 blink::initializeWithoutV8(webkit_platform_support_.get()); 418 blink::initializeWithoutV8(webkit_platform_support_.get());
417 } 419 }
418 420
419 } // namespace content 421 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698