diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 965435706..551485ae2 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -63,6 +63,10 @@ #include "content/public/common/content_descriptors.h" #endif +#if defined(OS_WIN) +#include "sandbox/win/src/sandbox_policy.h" +#endif + namespace { // In-memory store for access tokens used by geolocation. @@ -964,6 +968,20 @@ const wchar_t* CefContentBrowserClient::GetResourceDllName() { return file_path; } + +void CefContentBrowserClient::PreSpawnRenderer( + sandbox::TargetPolicy* policy, + bool* success) { + // Flash requires this permission to play video files. + sandbox::ResultCode result = policy->AddRule( + sandbox::TargetPolicy::SUBSYS_HANDLES, + sandbox::TargetPolicy::HANDLES_DUP_ANY, + L"File"); + if (result != sandbox::SBOX_ALL_OK) { + *success = false; + return; + } +} #endif // defined(OS_WIN) void CefContentBrowserClient::RegisterCustomScheme(const std::string& scheme) { diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index 86f1fa8d1..bfa8f979d 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -143,6 +143,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient { #if defined(OS_WIN) const wchar_t* GetResourceDllName() override; + void PreSpawnRenderer(sandbox::TargetPolicy* policy, bool* success) override; #endif // Perform browser process registration for the custom scheme.