diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-10 23:38:59 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-10 23:38:59 +0000 |
commit | e9c3df974a20aa1a09fa93ef5a82b93882600167 (patch) | |
tree | 7d7c6a017241d516d6381cbb67f9d56770c0edde /ppapi/proxy | |
parent | b7c8d9b3f731d50cf6afa0ec9c15843d2101bfc1 (diff) | |
download | chromium_src-e9c3df974a20aa1a09fa93ef5a82b93882600167.zip chromium_src-e9c3df974a20aa1a09fa93ef5a82b93882600167.tar.gz chromium_src-e9c3df974a20aa1a09fa93ef5a82b93882600167.tar.bz2 |
Add Pepper permissions checks for FlashMessageLoop and Broker
BUG=
Review URL: https://codereview.chromium.org/11469013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172184 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-rw-r--r-- | ppapi/proxy/ppb_broker_proxy.cc | 4 | ||||
-rw-r--r-- | ppapi/proxy/ppb_flash_message_loop_proxy.cc | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/ppapi/proxy/ppb_broker_proxy.cc b/ppapi/proxy/ppb_broker_proxy.cc index f7818dc..4e19b66 100644 --- a/ppapi/proxy/ppb_broker_proxy.cc +++ b/ppapi/proxy/ppb_broker_proxy.cc @@ -147,6 +147,8 @@ bool PPB_Broker_Proxy::OnMessageReceived(const IPC::Message& msg) { void PPB_Broker_Proxy::OnMsgCreate(PP_Instance instance, HostResource* result_resource) { + if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) + return; thunk::EnterResourceCreation enter(instance); if (enter.succeeded()) { result_resource->SetHostResource( @@ -156,6 +158,8 @@ void PPB_Broker_Proxy::OnMsgCreate(PP_Instance instance, } void PPB_Broker_Proxy::OnMsgConnect(const HostResource& broker) { + if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) + return; EnterHostFromHostResourceForceCallback<PPB_Broker_API> enter( broker, callback_factory_, &PPB_Broker_Proxy::ConnectCompleteInHost, broker); diff --git a/ppapi/proxy/ppb_flash_message_loop_proxy.cc b/ppapi/proxy/ppb_flash_message_loop_proxy.cc index c4d4ce1..8b7ff823 100644 --- a/ppapi/proxy/ppb_flash_message_loop_proxy.cc +++ b/ppapi/proxy/ppb_flash_message_loop_proxy.cc @@ -118,6 +118,8 @@ bool PPB_Flash_MessageLoop_Proxy::OnMessageReceived(const IPC::Message& msg) { void PPB_Flash_MessageLoop_Proxy::OnMsgCreate(PP_Instance instance, HostResource* result) { + if (!dispatcher()->permissions().HasPermission(PERMISSION_FLASH)) + return; thunk::EnterResourceCreation enter(instance); if (enter.succeeded()) { result->SetHostResource( @@ -128,6 +130,9 @@ void PPB_Flash_MessageLoop_Proxy::OnMsgCreate(PP_Instance instance, void PPB_Flash_MessageLoop_Proxy::OnMsgRun( const HostResource& flash_message_loop, IPC::Message* reply) { + if (!dispatcher()->permissions().HasPermission(PERMISSION_FLASH)) + return; + PPB_Flash_MessageLoop_API::RunFromHostProxyCallback callback = base::Bind(&PPB_Flash_MessageLoop_Proxy::WillQuitSoon, AsWeakPtr(), base::Passed(scoped_ptr<IPC::Message>(reply))); |