Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1008)

Unified Diff: content/ppapi_plugin/ppapi_thread.cc

Issue 191533002: Preload amdhcp64.dll or amdhcp32.dll before sandbox lockdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/ppapi_plugin/ppapi_thread.cc
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
index e5ad093dbdf60601bb346390b6de7b2938f038c3..c8bfd490ea10ca59cb879a7764a4600037761859 100644
--- a/content/ppapi_plugin/ppapi_thread.cc
+++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -7,6 +7,7 @@
#include <limits>
#include "base/command_line.h"
+#include "base/cpu.h"
#include "base/debug/crash_logging.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
@@ -288,11 +289,25 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path,
// can be loaded. TODO(cpu): consider changing to the loading style of
// regular plugins.
if (g_target_services) {
- // Let Flash load DRM before lockdown on Vista+.
- if (permissions.HasPermission(ppapi::PERMISSION_FLASH) &&
- base::win::OSInfo::GetInstance()->version() >=
- base::win::VERSION_VISTA ) {
- LoadLibrary(L"dxva2.dll");
+ // Let Flash load DXVA before lockdown on Vista+.
+ if (permissions.HasPermission(ppapi::PERMISSION_FLASH)) {
+ if (base::win::OSInfo::GetInstance()->version() >=
+ base::win::VERSION_VISTA) {
+ LoadLibraryA("dxva2.dll");
+ }
+
+ if (base::win::OSInfo::GetInstance()->version() >=
+ base::win::VERSION_WIN7) {
+ base::CPU cpu;
+ if ((cpu.vendor_name() == "AuthenticAMD") && (cpu.family() > 0x14)) {
+ // The AMD crypto acceleration is only AMD Bulldozer and above.
+#if defined(_WIN64)
+ LoadLibraryA("amdhcp64.dll");
+#else
+ LoadLibraryA("amdhcp32.dll");
+#endif
+ }
+ }
}
// Cause advapi32 to load before the sandbox is turned on.
@@ -306,7 +321,7 @@ void PpapiThread::OnLoadPlugin(const base::FilePath& path,
// Warm up system locales.
EnumSystemLocalesW(EnumLocalesProc, LCID_INSTALLED);
}
-
+ // Engage the sandbox.
g_target_services->LowerToken();
}
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698