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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 #if defined(OS_POSIX) | 38 #if defined(OS_POSIX) |
39 #include "content/public/browser/zygote_handle_linux.h" | 39 #include "content/public/browser/zygote_handle_linux.h" |
40 #endif // defined(OS_POSIX) | 40 #endif // defined(OS_POSIX) |
41 | 41 |
42 #if defined(OS_WIN) | 42 #if defined(OS_WIN) |
43 #include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h" | 43 #include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h" |
44 #include "content/common/sandbox_win.h" | 44 #include "content/common/sandbox_win.h" |
45 #include "sandbox/win/src/process_mitigations.h" | 45 #include "sandbox/win/src/process_mitigations.h" |
46 #include "sandbox/win/src/sandbox_policy.h" | 46 #include "sandbox/win/src/sandbox_policy.h" |
47 #include "ui/gfx/win/dpi.h" | 47 #include "ui/display/win/dpi.h" |
48 #endif | 48 #endif |
49 | 49 |
50 namespace content { | 50 namespace content { |
51 | 51 |
52 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | 52 #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
53 ZygoteHandle g_ppapi_zygote; | 53 ZygoteHandle g_ppapi_zygote; |
54 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) | 54 #endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) |
55 | 55 |
56 // NOTE: changes to this class need to be reviewed by the security team. | 56 // NOTE: changes to this class need to be reviewed by the security team. |
57 class PpapiPluginSandboxedProcessLauncherDelegate | 57 class PpapiPluginSandboxedProcessLauncherDelegate |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 cmd_line->AppendSwitchASCII(switches::kPpapiFlashArgs, existing_args); | 428 cmd_line->AppendSwitchASCII(switches::kPpapiFlashArgs, existing_args); |
429 } | 429 } |
430 | 430 |
431 std::string locale = GetContentClient()->browser()->GetApplicationLocale(); | 431 std::string locale = GetContentClient()->browser()->GetApplicationLocale(); |
432 if (!locale.empty()) { | 432 if (!locale.empty()) { |
433 // Pass on the locale so the plugin will know what language we're using. | 433 // Pass on the locale so the plugin will know what language we're using. |
434 cmd_line->AppendSwitchASCII(switches::kLang, locale); | 434 cmd_line->AppendSwitchASCII(switches::kLang, locale); |
435 } | 435 } |
436 | 436 |
437 #if defined(OS_WIN) | 437 #if defined(OS_WIN) |
438 cmd_line->AppendSwitchASCII(switches::kDeviceScaleFactor, | 438 cmd_line->AppendSwitchASCII( |
439 base::DoubleToString(gfx::GetDPIScale())); | 439 switches::kDeviceScaleFactor, |
| 440 base::DoubleToString(display::win::GetDPIScale())); |
440 #endif | 441 #endif |
441 | 442 |
442 if (!plugin_launcher.empty()) | 443 if (!plugin_launcher.empty()) |
443 cmd_line->PrependWrapper(plugin_launcher); | 444 cmd_line->PrependWrapper(plugin_launcher); |
444 | 445 |
445 // On posix, never use the zygote for the broker. Also, only use the zygote if | 446 // On posix, never use the zygote for the broker. Also, only use the zygote if |
446 // we are not using a plugin launcher - having a plugin launcher means we need | 447 // we are not using a plugin launcher - having a plugin launcher means we need |
447 // to use another process instead of just forking the zygote. | 448 // to use another process instead of just forking the zygote. |
448 process_->Launch( | 449 process_->Launch( |
449 new PpapiPluginSandboxedProcessLauncherDelegate(is_broker_, | 450 new PpapiPluginSandboxedProcessLauncherDelegate(is_broker_, |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 // sent_requests_ queue should be the one that the plugin just created. | 547 // sent_requests_ queue should be the one that the plugin just created. |
547 Client* client = sent_requests_.front(); | 548 Client* client = sent_requests_.front(); |
548 sent_requests_.pop(); | 549 sent_requests_.pop(); |
549 | 550 |
550 const ChildProcessData& data = process_->GetData(); | 551 const ChildProcessData& data = process_->GetData(); |
551 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 552 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
552 data.id); | 553 data.id); |
553 } | 554 } |
554 | 555 |
555 } // namespace content | 556 } // namespace content |
OLD | NEW |