| OLD | NEW |
| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 if (!iter.ReadString(&family) || | 277 if (!iter.ReadString(&family) || |
| 278 !iter.ReadBool(&bold) || | 278 !iter.ReadBool(&bold) || |
| 279 !iter.ReadBool(&italic) || | 279 !iter.ReadBool(&italic) || |
| 280 !iter.ReadUInt16(&pixel_size)) { | 280 !iter.ReadUInt16(&pixel_size)) { |
| 281 return; | 281 return; |
| 282 } | 282 } |
| 283 | 283 |
| 284 gfx::FontRenderParamsQuery query; | 284 gfx::FontRenderParamsQuery query; |
| 285 query.families.push_back(family); | 285 query.families.push_back(family); |
| 286 query.pixel_size = pixel_size; | 286 query.pixel_size = pixel_size; |
| 287 query.style = gfx::Font::NORMAL | | 287 query.style = italic ? gfx::Font::ITALIC : 0; |
| 288 (bold ? gfx::Font::BOLD : 0) | (italic ? gfx::Font::ITALIC : 0); | 288 query.weight = bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL; |
| 289 const gfx::FontRenderParams params = gfx::GetFontRenderParams(query, NULL); | 289 const gfx::FontRenderParams params = gfx::GetFontRenderParams(query, NULL); |
| 290 | 290 |
| 291 // These are passed as ints since they're interpreted as tri-state chars in | 291 // These are passed as ints since they're interpreted as tri-state chars in |
| 292 // Blink. | 292 // Blink. |
| 293 base::Pickle reply; | 293 base::Pickle reply; |
| 294 reply.WriteInt(params.use_bitmaps); | 294 reply.WriteInt(params.use_bitmaps); |
| 295 reply.WriteInt(params.autohinter); | 295 reply.WriteInt(params.autohinter); |
| 296 reply.WriteInt(params.hinting != gfx::FontRenderParams::HINTING_NONE); | 296 reply.WriteInt(params.hinting != gfx::FontRenderParams::HINTING_NONE); |
| 297 reply.WriteInt(ConvertHinting(params.hinting)); | 297 reply.WriteInt(ConvertHinting(params.hinting)); |
| 298 reply.WriteInt(params.antialiasing); | 298 reply.WriteInt(params.antialiasing); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 416 } |
| 417 | 417 |
| 418 SandboxIPCHandler::~SandboxIPCHandler() { | 418 SandboxIPCHandler::~SandboxIPCHandler() { |
| 419 if (IGNORE_EINTR(close(lifeline_fd_)) < 0) | 419 if (IGNORE_EINTR(close(lifeline_fd_)) < 0) |
| 420 PLOG(ERROR) << "close"; | 420 PLOG(ERROR) << "close"; |
| 421 if (IGNORE_EINTR(close(browser_socket_)) < 0) | 421 if (IGNORE_EINTR(close(browser_socket_)) < 0) |
| 422 PLOG(ERROR) << "close"; | 422 PLOG(ERROR) << "close"; |
| 423 } | 423 } |
| 424 | 424 |
| 425 } // namespace content | 425 } // namespace content |
| OLD | NEW |