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

Unified Diff: content/ppapi_plugin/ppapi_thread.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/ppapi_thread.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/ppapi_plugin/ppapi_thread.cc
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
index 469fb78442db657294ec141961c7e3ba4aa56b43..ea5e4bc341e1bb6fa2524a3f7a1e4f85b2c32f2c 100644
--- a/content/ppapi_plugin/ppapi_thread.cc
+++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -444,8 +444,8 @@ void PpapiThread::OnCreateChannel(base::ProcessId renderer_pid,
IPC::ChannelHandle channel_handle;
if (!plugin_entry_points_.get_interface || // Plugin couldn't be loaded.
- !SetupRendererChannel(renderer_pid, renderer_child_id, incognito,
- &channel_handle)) {
+ !SetupChannel(renderer_pid, renderer_child_id, incognito,
+ &channel_handle)) {
Send(new PpapiHostMsg_ChannelCreated(IPC::ChannelHandle()));
return;
}
@@ -483,10 +483,10 @@ void PpapiThread::OnHang() {
base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
}
-bool PpapiThread::SetupRendererChannel(base::ProcessId renderer_pid,
- int renderer_child_id,
- bool incognito,
- IPC::ChannelHandle* handle) {
+bool PpapiThread::SetupChannel(base::ProcessId renderer_pid,
+ int renderer_child_id,
+ bool incognito,
+ IPC::ChannelHandle* handle) {
DCHECK(is_broker_ == (connect_instance_func_ != NULL));
IPC::ChannelHandle plugin_handle;
plugin_handle.name = IPC::Channel::GenerateVerifiedChannelID(
@@ -496,15 +496,17 @@ bool PpapiThread::SetupRendererChannel(base::ProcessId renderer_pid,
ppapi::proxy::ProxyChannel* dispatcher = NULL;
bool init_result = false;
if (is_broker_) {
+ bool peer_is_browser = renderer_pid == base::kNullProcessId;
BrokerProcessDispatcher* broker_dispatcher =
new BrokerProcessDispatcher(plugin_entry_points_.get_interface,
- connect_instance_func_);
+ connect_instance_func_, peer_is_browser);
init_result = broker_dispatcher->InitBrokerWithChannel(this,
renderer_pid,
plugin_handle,
false);
dispatcher = broker_dispatcher;
} else {
+ DCHECK_NE(base::kNullProcessId, renderer_pid);
PluginProcessDispatcher* plugin_dispatcher =
new PluginProcessDispatcher(plugin_entry_points_.get_interface,
permissions_,
« no previous file with comments | « content/ppapi_plugin/ppapi_thread.h ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698