Commit 272ecc30 authored by Marshall Greenblatt's avatar Marshall Greenblatt

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

parent ee90dc09
......@@ -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) {
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment