diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-22 23:05:03 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-22 23:05:03 +0000 |
commit | d5f5dc1eb49e5daa5c102d356697623b6277e091 (patch) | |
tree | 026c0f084526cf3cb3caec94542c67f1ee0d57ac /ppapi | |
parent | ecd887823ea735db045236bda63c1984f9f3af1e (diff) | |
download | chromium_src-d5f5dc1eb49e5daa5c102d356697623b6277e091.zip chromium_src-d5f5dc1eb49e5daa5c102d356697623b6277e091.tar.gz chromium_src-d5f5dc1eb49e5daa5c102d356697623b6277e091.tar.bz2 |
Verify we're not getting any plugin messages on the host side of the proxy.
If we start getting plugin messages on the host side, we could get confused.
BUG=159708
Review URL: https://codereview.chromium.org/12051024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/proxy/plugin_globals.h | 4 | ||||
-rw-r--r-- | ppapi/proxy/ppb_instance_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppp_class_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppp_content_decryptor_private_proxy.cc | 4 | ||||
-rw-r--r-- | ppapi/proxy/ppp_graphics_3d_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppp_input_event_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppp_instance_private_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppp_instance_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppp_messaging_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppp_mouse_lock_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppp_printing_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppp_text_input_proxy.cc | 3 | ||||
-rw-r--r-- | ppapi/proxy/ppp_video_decoder_proxy.cc | 3 |
13 files changed, 40 insertions, 1 deletions
diff --git a/ppapi/proxy/plugin_globals.h b/ppapi/proxy/plugin_globals.h index 9b50295..4da6d5f 100644 --- a/ppapi/proxy/plugin_globals.h +++ b/ppapi/proxy/plugin_globals.h @@ -37,7 +37,9 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals { // PpapiGlobals::Get() when possible. Use this only when you need some // plugin-specific functionality. inline static PluginGlobals* Get() { - DCHECK(PpapiGlobals::Get()->IsPluginGlobals()); + // Explicitly crash if this is the wrong process type, we want to get + // crash reports. + CHECK(PpapiGlobals::Get()->IsPluginGlobals()); return static_cast<PluginGlobals*>(PpapiGlobals::Get()); } diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc index 1e945e0..00c6942 100644 --- a/ppapi/proxy/ppb_instance_proxy.cc +++ b/ppapi/proxy/ppb_instance_proxy.cc @@ -1200,6 +1200,9 @@ void PPB_Instance_Proxy::OnHostMsgUpdateSurroundingText( void PPB_Instance_Proxy::OnPluginMsgMouseLockComplete(PP_Instance instance, int32_t result) { + if (!dispatcher()->IsPlugin()) + return; + // Save the mouse callback on the instance data. InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> GetInstanceData(instance); diff --git a/ppapi/proxy/ppp_class_proxy.cc b/ppapi/proxy/ppp_class_proxy.cc index 5e9a1da8..3c28d0d 100644 --- a/ppapi/proxy/ppp_class_proxy.cc +++ b/ppapi/proxy/ppp_class_proxy.cc @@ -246,6 +246,9 @@ PP_Bool PPP_Class_Proxy::IsInstanceOf(const PPB_Var_Deprecated* ppb_var_impl, } bool PPP_Class_Proxy::OnMessageReceived(const IPC::Message& msg) { + if (!dispatcher()->IsPlugin()) + return false; // These messages are only valid from host->plugin. + bool handled = true; IPC_BEGIN_MESSAGE_MAP(PPP_Class_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPClass_HasProperty, diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc index 5d98e0d..2d6b086 100644 --- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc +++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc @@ -386,6 +386,10 @@ const PPP_ContentDecryptor_Private* bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived( const IPC::Message& msg) { + if (!dispatcher()->IsPlugin()) + return false; // These are only valid from host->plugin. + // Don't allow the plugin to send these to the host. + bool handled = true; IPC_BEGIN_MESSAGE_MAP(PPP_ContentDecryptor_Private_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_GenerateKeyRequest, diff --git a/ppapi/proxy/ppp_graphics_3d_proxy.cc b/ppapi/proxy/ppp_graphics_3d_proxy.cc index 32e0f0c..ee00a92 100644 --- a/ppapi/proxy/ppp_graphics_3d_proxy.cc +++ b/ppapi/proxy/ppp_graphics_3d_proxy.cc @@ -60,6 +60,9 @@ const InterfaceProxy::Info* PPP_Graphics3D_Proxy::GetInfo() { } bool PPP_Graphics3D_Proxy::OnMessageReceived(const IPC::Message& msg) { + if (!dispatcher()->IsPlugin()) + return false; + bool handled = true; IPC_BEGIN_MESSAGE_MAP(PPP_Graphics3D_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPGraphics3D_ContextLost, diff --git a/ppapi/proxy/ppp_input_event_proxy.cc b/ppapi/proxy/ppp_input_event_proxy.cc index aad913b..8302dfd 100644 --- a/ppapi/proxy/ppp_input_event_proxy.cc +++ b/ppapi/proxy/ppp_input_event_proxy.cc @@ -85,6 +85,9 @@ const InterfaceProxy::Info* PPP_InputEvent_Proxy::GetInfo() { } bool PPP_InputEvent_Proxy::OnMessageReceived(const IPC::Message& msg) { + if (!dispatcher()->IsPlugin()) + return false; + bool handled = true; IPC_BEGIN_MESSAGE_MAP(PPP_InputEvent_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPInputEvent_HandleInputEvent, diff --git a/ppapi/proxy/ppp_instance_private_proxy.cc b/ppapi/proxy/ppp_instance_private_proxy.cc index 0a0ac99..1d8b8d7 100644 --- a/ppapi/proxy/ppp_instance_private_proxy.cc +++ b/ppapi/proxy/ppp_instance_private_proxy.cc @@ -65,6 +65,9 @@ const InterfaceProxy::Info* PPP_Instance_Private_Proxy::GetInfo() { } bool PPP_Instance_Private_Proxy::OnMessageReceived(const IPC::Message& msg) { + if (!dispatcher()->IsPlugin()) + return false; + bool handled = true; IPC_BEGIN_MESSAGE_MAP(PPP_Instance_Private_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstancePrivate_GetInstanceObject, diff --git a/ppapi/proxy/ppp_instance_proxy.cc b/ppapi/proxy/ppp_instance_proxy.cc index 077366e..eb1d4e4 100644 --- a/ppapi/proxy/ppp_instance_proxy.cc +++ b/ppapi/proxy/ppp_instance_proxy.cc @@ -154,6 +154,9 @@ const PPP_Instance* PPP_Instance_Proxy::GetInstanceInterface() { #endif // !defined(OS_NACL) bool PPP_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) { + if (!dispatcher()->IsPlugin()) + return false; + bool handled = true; IPC_BEGIN_MESSAGE_MAP(PPP_Instance_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPInstance_DidCreate, diff --git a/ppapi/proxy/ppp_messaging_proxy.cc b/ppapi/proxy/ppp_messaging_proxy.cc index 66b9e18..690e874 100644 --- a/ppapi/proxy/ppp_messaging_proxy.cc +++ b/ppapi/proxy/ppp_messaging_proxy.cc @@ -76,6 +76,9 @@ const InterfaceProxy::Info* PPP_Messaging_Proxy::GetInfo() { } bool PPP_Messaging_Proxy::OnMessageReceived(const IPC::Message& msg) { + if (!dispatcher()->IsPlugin()) + return false; + bool handled = true; IPC_BEGIN_MESSAGE_MAP(PPP_Messaging_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPMessaging_HandleMessage, diff --git a/ppapi/proxy/ppp_mouse_lock_proxy.cc b/ppapi/proxy/ppp_mouse_lock_proxy.cc index e4cd039..6fd746d 100644 --- a/ppapi/proxy/ppp_mouse_lock_proxy.cc +++ b/ppapi/proxy/ppp_mouse_lock_proxy.cc @@ -66,6 +66,9 @@ const InterfaceProxy::Info* PPP_MouseLock_Proxy::GetInfo() { } bool PPP_MouseLock_Proxy::OnMessageReceived(const IPC::Message& msg) { + if (!dispatcher()->IsPlugin()) + return false; + bool handled = true; IPC_BEGIN_MESSAGE_MAP(PPP_MouseLock_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPMouseLock_MouseLockLost, diff --git a/ppapi/proxy/ppp_printing_proxy.cc b/ppapi/proxy/ppp_printing_proxy.cc index b4c9409..9d58c78 100644 --- a/ppapi/proxy/ppp_printing_proxy.cc +++ b/ppapi/proxy/ppp_printing_proxy.cc @@ -127,6 +127,9 @@ const PPP_Printing_Dev* PPP_Printing_Proxy::GetProxyInterface() { } bool PPP_Printing_Proxy::OnMessageReceived(const IPC::Message& msg) { + if (!dispatcher()->IsPlugin()) + return false; + bool handled = true; IPC_BEGIN_MESSAGE_MAP(PPP_Printing_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPPrinting_QuerySupportedFormats, diff --git a/ppapi/proxy/ppp_text_input_proxy.cc b/ppapi/proxy/ppp_text_input_proxy.cc index 713323b..061b73c 100644 --- a/ppapi/proxy/ppp_text_input_proxy.cc +++ b/ppapi/proxy/ppp_text_input_proxy.cc @@ -57,6 +57,9 @@ PPP_TextInput_Proxy::~PPP_TextInput_Proxy() { } bool PPP_TextInput_Proxy::OnMessageReceived(const IPC::Message& msg) { + if (!dispatcher()->IsPlugin()) + return false; + bool handled = true; IPC_BEGIN_MESSAGE_MAP(PPP_TextInput_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPTextInput_RequestSurroundingText, diff --git a/ppapi/proxy/ppp_video_decoder_proxy.cc b/ppapi/proxy/ppp_video_decoder_proxy.cc index 0f4bd25..a24d4c3 100644 --- a/ppapi/proxy/ppp_video_decoder_proxy.cc +++ b/ppapi/proxy/ppp_video_decoder_proxy.cc @@ -102,6 +102,9 @@ const InterfaceProxy::Info* PPP_VideoDecoder_Proxy::GetInfo() { } bool PPP_VideoDecoder_Proxy::OnMessageReceived(const IPC::Message& msg) { + if (!dispatcher()->IsPlugin()) + return false; + bool handled = true; IPC_BEGIN_MESSAGE_MAP(PPP_VideoDecoder_Proxy, msg) IPC_MESSAGE_HANDLER(PpapiMsg_PPPVideoDecoder_ProvidePictureBuffers, |