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 PPAPI_NACL_IRT_PPAPI_DISPATCHER_H_ | 5 #ifndef PPAPI_NACL_IRT_PPAPI_DISPATCHER_H_ |
6 #define PPAPI_NACL_IRT_PPAPI_DISPATCHER_H_ | 6 #define PPAPI_NACL_IRT_PPAPI_DISPATCHER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <map> | 10 #include <map> |
9 #include <set> | 11 #include <set> |
10 #include <string> | 12 #include <string> |
11 | 13 |
12 #include "base/files/file.h" | 14 #include "base/files/file.h" |
13 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
14 #include "base/process/process_handle.h" | 16 #include "base/process/process_handle.h" |
15 #include "ipc/ipc_listener.h" | 17 #include "ipc/ipc_listener.h" |
16 #include "ipc/ipc_platform_file.h" | 18 #include "ipc/ipc_platform_file.h" |
17 #include "ipc/ipc_sender.h" | 19 #include "ipc/ipc_sender.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 base::SingleThreadTaskRunner* GetIPCTaskRunner() override; | 57 base::SingleThreadTaskRunner* GetIPCTaskRunner() override; |
56 base::WaitableEvent* GetShutdownEvent() override; | 58 base::WaitableEvent* GetShutdownEvent() override; |
57 IPC::PlatformFileForTransit ShareHandleWithRemote( | 59 IPC::PlatformFileForTransit ShareHandleWithRemote( |
58 base::PlatformFile handle, | 60 base::PlatformFile handle, |
59 base::ProcessId peer_pid, | 61 base::ProcessId peer_pid, |
60 bool should_close_source) override; | 62 bool should_close_source) override; |
61 base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote( | 63 base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote( |
62 const base::SharedMemoryHandle& handle, | 64 const base::SharedMemoryHandle& handle, |
63 base::ProcessId remote_pid) override; | 65 base::ProcessId remote_pid) override; |
64 std::set<PP_Instance>* GetGloballySeenInstanceIDSet() override; | 66 std::set<PP_Instance>* GetGloballySeenInstanceIDSet() override; |
65 uint32 Register(proxy::PluginDispatcher* plugin_dispatcher) override; | 67 uint32_t Register(proxy::PluginDispatcher* plugin_dispatcher) override; |
66 void Unregister(uint32 plugin_dispatcher_id) override; | 68 void Unregister(uint32_t plugin_dispatcher_id) override; |
67 | 69 |
68 // PluginProxyDelegate implementation. | 70 // PluginProxyDelegate implementation. |
69 IPC::Sender* GetBrowserSender() override; | 71 IPC::Sender* GetBrowserSender() override; |
70 std::string GetUILanguage() override; | 72 std::string GetUILanguage() override; |
71 void PreCacheFontForFlash(const void* logfontw) override; | 73 void PreCacheFontForFlash(const void* logfontw) override; |
72 void SetActiveURL(const std::string& url) override; | 74 void SetActiveURL(const std::string& url) override; |
73 PP_Resource CreateBrowserFont(proxy::Connection connection, | 75 PP_Resource CreateBrowserFont(proxy::Connection connection, |
74 PP_Instance instance, | 76 PP_Instance instance, |
75 const PP_BrowserFont_Trusted_Description& desc, | 77 const PP_BrowserFont_Trusted_Description& desc, |
76 const Preferences& prefs) override; | 78 const Preferences& prefs) override; |
77 | 79 |
78 // IPC::Listener implementation. | 80 // IPC::Listener implementation. |
79 bool OnMessageReceived(const IPC::Message& message) override; | 81 bool OnMessageReceived(const IPC::Message& message) override; |
80 void OnChannelError() override; | 82 void OnChannelError() override; |
81 | 83 |
82 // IPC::Sender implementation | 84 // IPC::Sender implementation |
83 bool Send(IPC::Message* message) override; | 85 bool Send(IPC::Message* message) override; |
84 | 86 |
85 private: | 87 private: |
86 void OnMsgInitializeNaClDispatcher(const PpapiNaClPluginArgs& args); | 88 void OnMsgInitializeNaClDispatcher(const PpapiNaClPluginArgs& args); |
87 void OnPluginDispatcherMessageReceived(const IPC::Message& msg); | 89 void OnPluginDispatcherMessageReceived(const IPC::Message& msg); |
88 | 90 |
89 std::set<PP_Instance> instances_; | 91 std::set<PP_Instance> instances_; |
90 std::map<uint32, proxy::PluginDispatcher*> plugin_dispatchers_; | 92 std::map<uint32_t, proxy::PluginDispatcher*> plugin_dispatchers_; |
91 uint32 next_plugin_dispatcher_id_; | 93 uint32_t next_plugin_dispatcher_id_; |
92 | 94 |
93 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 95 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
94 base::WaitableEvent* shutdown_event_; | 96 base::WaitableEvent* shutdown_event_; |
95 int renderer_ipc_fd_; | 97 int renderer_ipc_fd_; |
96 scoped_ptr<IPC::SyncChannel> channel_; | 98 scoped_ptr<IPC::SyncChannel> channel_; |
97 }; | 99 }; |
98 | 100 |
99 } // namespace ppapi | 101 } // namespace ppapi |
100 | 102 |
101 #endif // PPAPI_NACL_IRT_PPAPI_DISPATCHER_H_ | 103 #endif // PPAPI_NACL_IRT_PPAPI_DISPATCHER_H_ |
OLD | NEW |