summaryrefslogtreecommitdiffstats
path: root/chrome/ppapi_plugin
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/ppapi_plugin')
-rw-r--r--chrome/ppapi_plugin/ppapi_thread.cc17
-rw-r--r--chrome/ppapi_plugin/ppapi_thread.h11
2 files changed, 23 insertions, 5 deletions
diff --git a/chrome/ppapi_plugin/ppapi_thread.cc b/chrome/ppapi_plugin/ppapi_thread.cc
index 98d0014..4e998ea 100644
--- a/chrome/ppapi_plugin/ppapi_thread.cc
+++ b/chrome/ppapi_plugin/ppapi_thread.cc
@@ -48,6 +48,18 @@ bool PpapiThread::OnMessageReceived(const IPC::Message& msg) {
return true;
}
+MessageLoop* PpapiThread::GetIPCMessageLoop() {
+ return ChildProcess::current()->io_message_loop();
+}
+
+base::WaitableEvent* PpapiThread::GetShutdownEvent() {
+ return ChildProcess::current()->GetShutDownEvent();
+}
+
+std::set<PP_Instance>* PpapiThread::GetGloballySeenInstanceIDSet() {
+ return &globally_seen_instance_ids_;
+}
+
void PpapiThread::OnMsgLoadPlugin(const FilePath& path) {
base::ScopedNativeLibrary library(base::LoadNativeLibrary(path));
if (!library.is_valid())
@@ -103,10 +115,7 @@ bool PpapiThread::SetupRendererChannel(base::ProcessHandle host_process_handle,
IPC::ChannelHandle plugin_handle;
plugin_handle.name = StringPrintf("%d.r%d", base::GetCurrentProcId(),
renderer_id);
- if (!dispatcher->InitWithChannel(
- ChildProcess::current()->io_message_loop(),
- plugin_handle, false,
- ChildProcess::current()->GetShutDownEvent()))
+ if (!dispatcher->InitWithChannel(this, plugin_handle, false))
return false;
handle->name = plugin_handle.name;
diff --git a/chrome/ppapi_plugin/ppapi_thread.h b/chrome/ppapi_plugin/ppapi_thread.h
index e4058ad..34f06eb 100644
--- a/chrome/ppapi_plugin/ppapi_thread.h
+++ b/chrome/ppapi_plugin/ppapi_thread.h
@@ -27,7 +27,8 @@ class PluginDispatcher;
}
}
-class PpapiThread : public ChildThread {
+class PpapiThread : public ChildThread,
+ public pp::proxy::Dispatcher::Delegate {
public:
PpapiThread();
~PpapiThread();
@@ -36,6 +37,11 @@ class PpapiThread : public ChildThread {
// ChildThread overrides.
virtual bool OnMessageReceived(const IPC::Message& msg);
+ // Dispatcher::Delegate implementation.
+ virtual MessageLoop* GetIPCMessageLoop();
+ virtual base::WaitableEvent* GetShutdownEvent();
+ virtual std::set<PP_Instance>* GetGloballySeenInstanceIDSet();
+
// Message handlers.
void OnMsgLoadPlugin(const FilePath& path);
void OnMsgCreateChannel(base::ProcessHandle host_process_handle,
@@ -59,6 +65,9 @@ class PpapiThread : public ChildThread {
// and pass it around as necessary.
PP_Module local_pp_module_;
+ // See Dispatcher::Delegate::GetGloballySeenInstanceIDSet.
+ std::set<PP_Instance> globally_seen_instance_ids_;
+
DISALLOW_COPY_AND_ASSIGN(PpapiThread);
};