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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "ppapi/proxy/plugin_globals.h" | 45 #include "ppapi/proxy/plugin_globals.h" |
46 #include "ppapi/proxy/plugin_message_filter.h" | 46 #include "ppapi/proxy/plugin_message_filter.h" |
47 #include "ppapi/proxy/ppapi_messages.h" | 47 #include "ppapi/proxy/ppapi_messages.h" |
48 #include "ppapi/proxy/resource_reply_thread_registrar.h" | 48 #include "ppapi/proxy/resource_reply_thread_registrar.h" |
49 #include "third_party/WebKit/public/web/WebKit.h" | 49 #include "third_party/WebKit/public/web/WebKit.h" |
50 #include "ui/base/ui_base_switches.h" | 50 #include "ui/base/ui_base_switches.h" |
51 | 51 |
52 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
53 #include "base/win/win_util.h" | 53 #include "base/win/win_util.h" |
54 #include "base/win/windows_version.h" | 54 #include "base/win/windows_version.h" |
| 55 #include "content/common/font_warmup_win.h" |
55 #include "sandbox/win/src/sandbox.h" | 56 #include "sandbox/win/src/sandbox.h" |
56 #elif defined(OS_MACOSX) | 57 #elif defined(OS_MACOSX) |
57 #include "content/common/sandbox_init_mac.h" | 58 #include "content/common/sandbox_init_mac.h" |
58 #endif | 59 #endif |
59 | 60 |
60 #if defined(OS_WIN) | 61 #if defined(OS_WIN) |
61 const char kWidevineCdmAdapterFileName[] = "widevinecdmadapter.dll"; | 62 const char kWidevineCdmAdapterFileName[] = "widevinecdmadapter.dll"; |
62 | 63 |
63 extern sandbox::TargetServices* g_target_services; | 64 extern sandbox::TargetServices* g_target_services; |
64 | 65 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 } | 400 } |
400 } | 401 } |
401 } | 402 } |
402 | 403 |
403 // Cause advapi32 to load before the sandbox is turned on. | 404 // Cause advapi32 to load before the sandbox is turned on. |
404 unsigned int dummy_rand; | 405 unsigned int dummy_rand; |
405 rand_s(&dummy_rand); | 406 rand_s(&dummy_rand); |
406 | 407 |
407 WarmupWindowsLocales(permissions); | 408 WarmupWindowsLocales(permissions); |
408 | 409 |
| 410 if (!base::win::IsUser32AndGdi32Available() && |
| 411 permissions.HasPermission(ppapi::PERMISSION_FLASH)) { |
| 412 PatchGdiFontEnumeration(path); |
| 413 } |
| 414 |
409 g_target_services->LowerToken(); | 415 g_target_services->LowerToken(); |
410 } | 416 } |
411 #endif | 417 #endif |
412 | 418 |
413 if (is_broker_) { | 419 if (is_broker_) { |
414 // Get the InitializeBroker function (required). | 420 // Get the InitializeBroker function (required). |
415 InitializeBrokerFunc init_broker = | 421 InitializeBrokerFunc init_broker = |
416 reinterpret_cast<InitializeBrokerFunc>( | 422 reinterpret_cast<InitializeBrokerFunc>( |
417 library.GetFunctionPointer("PPP_InitializeBroker")); | 423 library.GetFunctionPointer("PPP_InitializeBroker")); |
418 if (!init_broker) { | 424 if (!init_broker) { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 GetHistogramName(is_broker_, "LoadTime", path), | 616 GetHistogramName(is_broker_, "LoadTime", path), |
611 base::TimeDelta::FromMilliseconds(1), | 617 base::TimeDelta::FromMilliseconds(1), |
612 base::TimeDelta::FromSeconds(10), | 618 base::TimeDelta::FromSeconds(10), |
613 50, | 619 50, |
614 base::HistogramBase::kUmaTargetedHistogramFlag); | 620 base::HistogramBase::kUmaTargetedHistogramFlag); |
615 | 621 |
616 histogram->AddTime(load_time); | 622 histogram->AddTime(load_time); |
617 } | 623 } |
618 | 624 |
619 } // namespace content | 625 } // namespace content |
OLD | NEW |