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_MANIFEST_SERVICE_CHANNEL_H_ |
6 #define COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ | 6 #define COMPONENTS_NACL_RENDERER_MANIFEST_SERVICE_CHANNEL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
10 #include "ipc/ipc_listener.h" | 11 #include "ipc/ipc_listener.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class WaitableEvent; | 14 class WaitableEvent; |
14 } // namespace base | 15 } // namespace base |
15 | 16 |
16 namespace IPC { | 17 namespace IPC { |
17 struct ChannelHandle; | 18 struct ChannelHandle; |
18 class Message; | 19 class Message; |
19 class SyncChannel; | 20 class SyncChannel; |
20 } // namespace IPC | 21 } // namespace IPC |
21 | 22 |
22 namespace nacl { | 23 namespace nacl { |
23 | 24 |
24 class TrustedPluginChannel : public IPC::Listener { | 25 class ManifestServiceChannel : public IPC::Listener { |
25 public: | 26 public: |
26 TrustedPluginChannel( | 27 ManifestServiceChannel( |
27 const IPC::ChannelHandle& handle, | 28 const IPC::ChannelHandle& handle, |
28 const base::Callback<void(int32_t)>& connected_callback, | 29 const base::Callback<void(int32_t)>& connected_callback, |
29 base::WaitableEvent* waitable_event); | 30 base::WaitableEvent* waitable_event); |
30 virtual ~TrustedPluginChannel(); | 31 virtual ~ManifestServiceChannel(); |
31 | |
32 bool Send(IPC::Message* message); | |
33 | 32 |
34 // Listener implementation. | 33 // Listener implementation. |
35 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 34 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
36 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 35 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
37 virtual void OnChannelError() OVERRIDE; | 36 virtual void OnChannelError() OVERRIDE; |
38 | 37 |
39 private: | 38 private: |
40 base::Callback<void(int32_t)> connected_callback_; | 39 base::Callback<void(int32_t)> connected_callback_; |
41 scoped_ptr<IPC::SyncChannel> channel_; | 40 scoped_ptr<IPC::SyncChannel> channel_; |
42 | 41 |
43 DISALLOW_COPY_AND_ASSIGN(TrustedPluginChannel); | 42 DISALLOW_COPY_AND_ASSIGN(ManifestServiceChannel); |
44 }; | 43 }; |
45 | 44 |
46 } // namespace nacl | 45 } // namespace nacl |
47 | 46 |
48 #endif // COMPONENTS_NACL_RENDERER_TRUSTED_PLUGIN_CHANNEL_H_ | 47 #endif // COMPONENTS_NACL_RENDERER_MANIFEST_SERVICE_CHANNEL_H_ |
OLD | NEW |