OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ppapi_plugin_process_host.h" | 5 #include "content/browser/ppapi_plugin_process_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 30 matching lines...) Expand all Loading... |
41 #if defined(OS_POSIX) | 41 #if defined(OS_POSIX) |
42 #include "content/public/browser/zygote_handle_linux.h" | 42 #include "content/public/browser/zygote_handle_linux.h" |
43 #endif // defined(OS_POSIX) | 43 #endif // defined(OS_POSIX) |
44 | 44 |
45 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
46 #include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h" | 46 #include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h" |
47 #include "content/common/sandbox_win.h" | 47 #include "content/common/sandbox_win.h" |
48 #include "sandbox/win/src/process_mitigations.h" | 48 #include "sandbox/win/src/process_mitigations.h" |
49 #include "sandbox/win/src/sandbox_policy.h" | 49 #include "sandbox/win/src/sandbox_policy.h" |
50 #include "ui/display/win/dpi.h" | 50 #include "ui/display/win/dpi.h" |
| 51 #include "ui/gfx/font_render_params.h" |
51 #endif | 52 #endif |
52 | 53 |
53 namespace content { | 54 namespace content { |
54 | 55 |
55 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | 56 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
56 ZygoteHandle g_ppapi_zygote; | 57 ZygoteHandle g_ppapi_zygote; |
57 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | 58 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
58 | 59 |
59 // NOTE: changes to this class need to be reviewed by the security team. | 60 // NOTE: changes to this class need to be reviewed by the security team. |
60 class PpapiPluginSandboxedProcessLauncherDelegate | 61 class PpapiPluginSandboxedProcessLauncherDelegate |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 std::string locale = GetContentClient()->browser()->GetApplicationLocale(); | 433 std::string locale = GetContentClient()->browser()->GetApplicationLocale(); |
433 if (!locale.empty()) { | 434 if (!locale.empty()) { |
434 // Pass on the locale so the plugin will know what language we're using. | 435 // Pass on the locale so the plugin will know what language we're using. |
435 cmd_line->AppendSwitchASCII(switches::kLang, locale); | 436 cmd_line->AppendSwitchASCII(switches::kLang, locale); |
436 } | 437 } |
437 | 438 |
438 #if defined(OS_WIN) | 439 #if defined(OS_WIN) |
439 cmd_line->AppendSwitchASCII( | 440 cmd_line->AppendSwitchASCII( |
440 switches::kDeviceScaleFactor, | 441 switches::kDeviceScaleFactor, |
441 base::DoubleToString(display::win::GetDPIScale())); | 442 base::DoubleToString(display::win::GetDPIScale())); |
| 443 const gfx::FontRenderParams font_params = |
| 444 gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr); |
| 445 cmd_line->AppendSwitchASCII(switches::kPpapiAntialiasedTextEnabled, |
| 446 base::IntToString(font_params.antialiasing)); |
| 447 cmd_line->AppendSwitchASCII( |
| 448 switches::kPpapiSubpixelRenderingSetting, |
| 449 base::IntToString(font_params.subpixel_rendering)); |
442 #endif | 450 #endif |
443 | 451 |
444 if (!plugin_launcher.empty()) | 452 if (!plugin_launcher.empty()) |
445 cmd_line->PrependWrapper(plugin_launcher); | 453 cmd_line->PrependWrapper(plugin_launcher); |
446 | 454 |
447 // On posix, never use the zygote for the broker. Also, only use the zygote if | 455 // On posix, never use the zygote for the broker. Also, only use the zygote if |
448 // we are not using a plugin launcher - having a plugin launcher means we need | 456 // we are not using a plugin launcher - having a plugin launcher means we need |
449 // to use another process instead of just forking the zygote. | 457 // to use another process instead of just forking the zygote. |
450 process_->Launch( | 458 process_->Launch( |
451 new PpapiPluginSandboxedProcessLauncherDelegate(is_broker_, | 459 new PpapiPluginSandboxedProcessLauncherDelegate(is_broker_, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 // sent_requests_ queue should be the one that the plugin just created. | 560 // sent_requests_ queue should be the one that the plugin just created. |
553 Client* client = sent_requests_.front(); | 561 Client* client = sent_requests_.front(); |
554 sent_requests_.pop(); | 562 sent_requests_.pop(); |
555 | 563 |
556 const ChildProcessData& data = process_->GetData(); | 564 const ChildProcessData& data = process_->GetData(); |
557 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 565 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
558 data.id); | 566 data.id); |
559 } | 567 } |
560 | 568 |
561 } // namespace content | 569 } // namespace content |
OLD | NEW |