Windows: Fix sandbox permissions for Flash video playback (issue #1650)

This commit is contained in:
Marshall Greenblatt 2015-06-11 19:00:09 -04:00
parent ee90dc0915
commit 272ecc3047
2 changed files with 19 additions and 0 deletions

View File

@ -63,6 +63,10 @@
#include "content/public/common/content_descriptors.h" #include "content/public/common/content_descriptors.h"
#endif #endif
#if defined(OS_WIN)
#include "sandbox/win/src/sandbox_policy.h"
#endif
namespace { namespace {
// In-memory store for access tokens used by geolocation. // In-memory store for access tokens used by geolocation.
@ -964,6 +968,20 @@ const wchar_t* CefContentBrowserClient::GetResourceDllName() {
return file_path; 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) #endif // defined(OS_WIN)
void CefContentBrowserClient::RegisterCustomScheme(const std::string& scheme) { void CefContentBrowserClient::RegisterCustomScheme(const std::string& scheme) {

View File

@ -143,6 +143,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
#if defined(OS_WIN) #if defined(OS_WIN)
const wchar_t* GetResourceDllName() override; const wchar_t* GetResourceDllName() override;
void PreSpawnRenderer(sandbox::TargetPolicy* policy, bool* success) override;
#endif #endif
// Perform browser process registration for the custom scheme. // Perform browser process registration for the custom scheme.