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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_
6 #define COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ipc/ipc_listener.h"
24 class TrustedPluginChannel : public IPC::Listener {
27 const IPC::ChannelHandle& handle,
28 const base::Callback<void(int32_t)>& connected_callback,
29 base::WaitableEvent* waitable_event);
30 virtual ~TrustedPluginChannel();
32 bool Send(IPC::Message* message);
34 // Listener implementation.
35 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
36 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
37 virtual void OnChannelError() OVERRIDE;
40 base::Callback<void(int32_t)> connected_callback_;
41 scoped_ptr<IPC::SyncChannel> channel_;
43 DISALLOW_COPY_AND_ASSIGN(TrustedPluginChannel);
48 #endif // COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_