Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(946)

Unified Diff: content/ppapi_plugin/broker_process_dispatcher.cc

Issue 2069853002: Ignore certain messages in plugin broker process if they are not sent by the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/ppapi_plugin/broker_process_dispatcher.h ('k') | content/ppapi_plugin/ppapi_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/ppapi_plugin/broker_process_dispatcher.cc
diff --git a/content/ppapi_plugin/broker_process_dispatcher.cc b/content/ppapi_plugin/broker_process_dispatcher.cc
index 01325531cd35cee481b92a516d4f8831204b2031..b971f7ad015f42864a8d9bad8ce690125027d480 100644
--- a/content/ppapi_plugin/broker_process_dispatcher.cc
+++ b/content/ppapi_plugin/broker_process_dispatcher.cc
@@ -77,12 +77,14 @@ void GetPermissionSettingsCallback(
BrokerProcessDispatcher::BrokerProcessDispatcher(
PP_GetInterface_Func get_plugin_interface,
- PP_ConnectInstance_Func connect_instance)
+ PP_ConnectInstance_Func connect_instance,
+ bool peer_is_browser)
: ppapi::proxy::BrokerSideDispatcher(connect_instance),
get_plugin_interface_(get_plugin_interface),
flash_browser_operations_1_3_(NULL),
flash_browser_operations_1_2_(NULL),
- flash_browser_operations_1_0_(NULL) {
+ flash_browser_operations_1_0_(NULL),
+ peer_is_browser_(peer_is_browser) {
if (get_plugin_interface) {
flash_browser_operations_1_0_ =
static_cast<const PPP_Flash_BrowserOperations_1_0*>(
@@ -110,17 +112,25 @@ BrokerProcessDispatcher::~BrokerProcessDispatcher() {
}
bool BrokerProcessDispatcher::OnMessageReceived(const IPC::Message& msg) {
+ if (BrokerSideDispatcher::OnMessageReceived(msg))
+ return true;
+
+ if (!peer_is_browser_)
jschuh 2016/06/16 21:08:36 This seems like a case where we want to terminate
yzshen1 2016/06/16 22:23:15 I agree that it would be nice if we can kill the p
+ return false;
+
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(BrokerProcessDispatcher, msg)
IPC_MESSAGE_HANDLER(PpapiMsg_GetSitesWithData, OnGetSitesWithData)
IPC_MESSAGE_HANDLER(PpapiMsg_ClearSiteData, OnClearSiteData)
IPC_MESSAGE_HANDLER(PpapiMsg_DeauthorizeContentLicenses,
OnDeauthorizeContentLicenses)
- IPC_MESSAGE_HANDLER(PpapiMsg_GetPermissionSettings, OnGetPermissionSettings)
+ IPC_MESSAGE_HANDLER(PpapiMsg_GetPermissionSettings,
+ OnGetPermissionSettings)
IPC_MESSAGE_HANDLER(PpapiMsg_SetDefaultPermission, OnSetDefaultPermission)
IPC_MESSAGE_HANDLER(PpapiMsg_SetSitePermission, OnSetSitePermission)
- IPC_MESSAGE_UNHANDLED(return BrokerSideDispatcher::OnMessageReceived(msg))
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
- return true;
+ return handled;
}
void BrokerProcessDispatcher::OnGetPermissionSettingsCompleted(
« no previous file with comments | « content/ppapi_plugin/broker_process_dispatcher.h ('k') | content/ppapi_plugin/ppapi_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698