OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ |
| 6 #define COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "ipc/ipc_channel_handle.h" |
| 11 #include "ipc/ipc_listener.h" |
| 12 #include "ipc/ipc_sync_channel.h" |
| 13 #include "ppapi/c/pp_completion_callback.h" |
| 14 |
| 15 namespace nacl { |
| 16 |
| 17 class TrustedPluginChannel : public IPC::Listener { |
| 18 public: |
| 19 TrustedPluginChannel(const IPC::ChannelHandle& handle, |
| 20 PP_CompletionCallback connected_callback); |
| 21 |
| 22 bool Send(IPC::Message* message); |
| 23 |
| 24 // Listener implementation. |
| 25 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 26 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
| 27 virtual void OnChannelError() OVERRIDE; |
| 28 |
| 29 private: |
| 30 scoped_ptr<IPC::SyncChannel> channel_; |
| 31 PP_CompletionCallback connected_callback_; |
| 32 base::WaitableEvent shutdown_event_; |
| 33 }; |
| 34 |
| 35 } // namespace nacl |
| 36 |
| 37 #endif // COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ |
OLD | NEW |