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 "native_client/src/trusted/service_runtime/nacl_error_code.h" |
11 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 class WaitableEvent; | 15 class WaitableEvent; |
15 } // namespace base | 16 } // namespace base |
16 | 17 |
17 namespace IPC { | 18 namespace IPC { |
18 struct ChannelHandle; | 19 struct ChannelHandle; |
19 class Message; | 20 class Message; |
20 class SyncChannel; | 21 class SyncChannel; |
21 } // namespace IPC | 22 } // namespace IPC |
22 | 23 |
23 namespace nacl { | 24 namespace nacl { |
24 class NexeLoadManager; | 25 class NexeLoadManager; |
25 | 26 |
26 class TrustedPluginChannel : public IPC::Listener { | 27 class TrustedPluginChannel : public IPC::Listener { |
27 public: | 28 public: |
28 TrustedPluginChannel(NexeLoadManager* nexe_load_manager, | 29 TrustedPluginChannel(NexeLoadManager* nexe_load_manager, |
29 const IPC::ChannelHandle& handle, | 30 const IPC::ChannelHandle& handle, |
30 base::WaitableEvent* shutdown_event, | 31 base::WaitableEvent* shutdown_event, |
31 bool report_exit_status); | 32 bool is_helper_nexe); |
32 ~TrustedPluginChannel() override; | 33 ~TrustedPluginChannel() override; |
33 | 34 |
34 bool Send(IPC::Message* message); | 35 bool Send(IPC::Message* message); |
35 | 36 |
36 // Listener implementation. | 37 // Listener implementation. |
37 bool OnMessageReceived(const IPC::Message& message) override; | 38 bool OnMessageReceived(const IPC::Message& message) override; |
38 void OnChannelError() override; | 39 void OnChannelError() override; |
39 | 40 |
40 void OnReportExitStatus(int exit_status); | 41 void OnReportExitStatus(int exit_status); |
| 42 void OnReportLoadStatus(NaClErrorCode load_status); |
41 | 43 |
42 private: | 44 private: |
43 // Non-owning pointer. This is safe because the TrustedPluginChannel is owned | 45 // Non-owning pointer. This is safe because the TrustedPluginChannel is owned |
44 // by the NexeLoadManager pointed to here. | 46 // by the NexeLoadManager pointed to here. |
45 NexeLoadManager* nexe_load_manager_; | 47 NexeLoadManager* nexe_load_manager_; |
46 scoped_ptr<IPC::SyncChannel> channel_; | 48 scoped_ptr<IPC::SyncChannel> channel_; |
47 bool report_exit_status_; | 49 bool is_helper_nexe_; |
48 | 50 |
49 DISALLOW_COPY_AND_ASSIGN(TrustedPluginChannel); | 51 DISALLOW_COPY_AND_ASSIGN(TrustedPluginChannel); |
50 }; | 52 }; |
51 | 53 |
52 } // namespace nacl | 54 } // namespace nacl |
53 | 55 |
54 #endif // COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ | 56 #endif // COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ |
OLD | NEW |