Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ | 5 #ifndef COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ |
| 6 #define COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ | 6 #define COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ipc/ipc_listener.h" | 10 #include "ipc/ipc_listener.h" |
| 11 #include "ppapi/c/pp_instance.h" | 11 #include "ppapi/c/pp_instance.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class WaitableEvent; | 14 class WaitableEvent; |
| 15 } // namespace base | 15 } // namespace base |
| 16 | 16 |
| 17 namespace IPC { | 17 namespace IPC { |
| 18 struct ChannelHandle; | 18 struct ChannelHandle; |
| 19 class Message; | 19 class Message; |
| 20 class SyncChannel; | 20 class SyncChannel; |
| 21 } // namespace IPC | 21 } // namespace IPC |
| 22 | 22 |
| 23 namespace nacl { | 23 namespace nacl { |
| 24 class NexeLoadManager; | |
| 24 | 25 |
| 25 class TrustedPluginChannel : public IPC::Listener { | 26 class TrustedPluginChannel : public IPC::Listener { |
| 26 public: | 27 public: |
| 27 TrustedPluginChannel(const IPC::ChannelHandle& handle, | 28 TrustedPluginChannel(NexeLoadManager* nexe_load_manager, |
| 28 base::WaitableEvent* shutdown_event); | 29 const IPC::ChannelHandle& handle, |
| 30 base::WaitableEvent* shutdown_event, | |
| 31 bool report_exit_status); | |
| 29 virtual ~TrustedPluginChannel(); | 32 virtual ~TrustedPluginChannel(); |
| 30 | 33 |
| 31 bool Send(IPC::Message* message); | 34 bool Send(IPC::Message* message); |
| 32 | 35 |
| 33 // Listener implementation. | 36 // Listener implementation. |
| 34 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 37 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 35 | 38 |
| 39 void OnReportExitStatus(int exit_status); | |
| 40 | |
| 36 private: | 41 private: |
| 42 // Non-owning pointer. | |
|
Mark Seaborn
2014/08/22 17:36:55
Can you comment here why the non-owning pointer is
dmichael (off chromium)
2014/08/22 17:39:00
NexeLoadManager owns the TrustedPluginChannel. Tho
teravest
2014/08/22 18:54:56
I've added a comment.
| |
| 43 NexeLoadManager* nexe_load_manager_; | |
| 37 scoped_ptr<IPC::SyncChannel> channel_; | 44 scoped_ptr<IPC::SyncChannel> channel_; |
| 45 bool report_exit_status_; | |
| 38 | 46 |
| 39 DISALLOW_COPY_AND_ASSIGN(TrustedPluginChannel); | 47 DISALLOW_COPY_AND_ASSIGN(TrustedPluginChannel); |
| 40 }; | 48 }; |
| 41 | 49 |
| 42 } // namespace nacl | 50 } // namespace nacl |
| 43 | 51 |
| 44 #endif // COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ | 52 #endif // COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ |
| OLD | NEW |