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/ppapi_plugin/ppapi_thread.h" | 5 #include "content/ppapi_plugin/ppapi_thread.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/cpu.h" | 10 #include "base/cpu.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 #include "ppapi/proxy/plugin_globals.h" | 44 #include "ppapi/proxy/plugin_globals.h" |
45 #include "ppapi/proxy/plugin_message_filter.h" | 45 #include "ppapi/proxy/plugin_message_filter.h" |
46 #include "ppapi/proxy/ppapi_messages.h" | 46 #include "ppapi/proxy/ppapi_messages.h" |
47 #include "ppapi/proxy/resource_reply_thread_registrar.h" | 47 #include "ppapi/proxy/resource_reply_thread_registrar.h" |
48 #include "third_party/WebKit/public/web/WebKit.h" | 48 #include "third_party/WebKit/public/web/WebKit.h" |
49 #include "ui/base/ui_base_switches.h" | 49 #include "ui/base/ui_base_switches.h" |
50 | 50 |
51 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
52 #include "base/win/win_util.h" | 52 #include "base/win/win_util.h" |
53 #include "base/win/windows_version.h" | 53 #include "base/win/windows_version.h" |
54 #include "content/public/common/render_font_warmup_win.h" | |
54 #include "sandbox/win/src/sandbox.h" | 55 #include "sandbox/win/src/sandbox.h" |
55 #elif defined(OS_MACOSX) | 56 #elif defined(OS_MACOSX) |
56 #include "content/common/sandbox_init_mac.h" | 57 #include "content/common/sandbox_init_mac.h" |
57 #endif | 58 #endif |
58 | 59 |
59 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
60 const char kWidevineCdmAdapterFileName[] = "widevinecdmadapter.dll"; | 61 const char kWidevineCdmAdapterFileName[] = "widevinecdmadapter.dll"; |
61 | 62 |
62 extern sandbox::TargetServices* g_target_services; | 63 extern sandbox::TargetServices* g_target_services; |
63 | 64 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
418 } | 419 } |
419 } | 420 } |
420 } | 421 } |
421 | 422 |
422 // Cause advapi32 to load before the sandbox is turned on. | 423 // Cause advapi32 to load before the sandbox is turned on. |
423 unsigned int dummy_rand; | 424 unsigned int dummy_rand; |
424 rand_s(&dummy_rand); | 425 rand_s(&dummy_rand); |
425 | 426 |
426 WarmupWindowsLocales(permissions); | 427 WarmupWindowsLocales(permissions); |
427 | 428 |
429 // If Win32k lockdown is on and loading Flash then we need to patch | |
430 // its GDI font enumeration code. | |
palmer
2015/09/11 22:34:16
Nit: The code is admirably clear, so I don't think
| |
431 if (IsWin32kLockdownEnabled() && | |
432 permissions.HasPermission(ppapi::PERMISSION_FLASH)) { | |
433 PatchGdiFontEnumeration(path); | |
434 } | |
435 | |
428 g_target_services->LowerToken(); | 436 g_target_services->LowerToken(); |
429 } | 437 } |
430 #endif | 438 #endif |
431 | 439 |
432 if (is_broker_) { | 440 if (is_broker_) { |
433 // Get the InitializeBroker function (required). | 441 // Get the InitializeBroker function (required). |
434 InitializeBrokerFunc init_broker = | 442 InitializeBrokerFunc init_broker = |
435 reinterpret_cast<InitializeBrokerFunc>( | 443 reinterpret_cast<InitializeBrokerFunc>( |
436 library.GetFunctionPointer("PPP_InitializeBroker")); | 444 library.GetFunctionPointer("PPP_InitializeBroker")); |
437 if (!init_broker) { | 445 if (!init_broker) { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
623 GetHistogramName(is_broker_, "LoadTime", path), | 631 GetHistogramName(is_broker_, "LoadTime", path), |
624 base::TimeDelta::FromMilliseconds(1), | 632 base::TimeDelta::FromMilliseconds(1), |
625 base::TimeDelta::FromSeconds(10), | 633 base::TimeDelta::FromSeconds(10), |
626 50, | 634 50, |
627 base::HistogramBase::kUmaTargetedHistogramFlag); | 635 base::HistogramBase::kUmaTargetedHistogramFlag); |
628 | 636 |
629 histogram->AddTime(load_time); | 637 histogram->AddTime(load_time); |
630 } | 638 } |
631 | 639 |
632 } // namespace content | 640 } // namespace content |
OLD | NEW |