Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / components / nacl / renderer / trusted_plugin_channel.h
index d1689b4..5f49f12 100644 (file)
@@ -8,6 +8,7 @@
 #include "base/callback.h"
 #include "base/memory/scoped_ptr.h"
 #include "ipc/ipc_listener.h"
+#include "ppapi/c/pp_instance.h"
 
 namespace base {
 class WaitableEvent;
@@ -20,25 +21,30 @@ class SyncChannel;
 }  // namespace IPC
 
 namespace nacl {
+class NexeLoadManager;
 
 class TrustedPluginChannel : public IPC::Listener {
  public:
-  TrustedPluginChannel(
-      const IPC::ChannelHandle& handle,
-      const base::Callback<void(int32_t)>& connected_callback,
-      base::WaitableEvent* waitable_event);
+  TrustedPluginChannel(NexeLoadManager* nexe_load_manager,
+                       const IPC::ChannelHandle& handle,
+                       base::WaitableEvent* shutdown_event,
+                       bool report_exit_status);
   virtual ~TrustedPluginChannel();
 
   bool Send(IPC::Message* message);
 
   // Listener implementation.
   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
-  virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
   virtual void OnChannelError() OVERRIDE;
 
+  void OnReportExitStatus(int exit_status);
+
  private:
-  base::Callback<void(int32_t)> connected_callback_;
+  // Non-owning pointer. This is safe because the TrustedPluginChannel is owned
+  // by the NexeLoadManager pointed to here.
+  NexeLoadManager* nexe_load_manager_;
   scoped_ptr<IPC::SyncChannel> channel_;
+  bool report_exit_status_;
 
   DISALLOW_COPY_AND_ASSIGN(TrustedPluginChannel);
 };