| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PROXY_HOST_DISPATCHER_H_ | 5 #ifndef PPAPI_PROXY_HOST_DISPATCHER_H_ |
| 6 #define PPAPI_PROXY_HOST_DISPATCHER_H_ | 6 #define PPAPI_PROXY_HOST_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 HostDispatcher(PP_Module module, | 51 HostDispatcher(PP_Module module, |
| 52 PP_GetInterface_Func local_get_interface, | 52 PP_GetInterface_Func local_get_interface, |
| 53 SyncMessageStatusReceiver* sync_status, | 53 SyncMessageStatusReceiver* sync_status, |
| 54 const PpapiPermissions& permissions); | 54 const PpapiPermissions& permissions); |
| 55 ~HostDispatcher(); | 55 ~HostDispatcher(); |
| 56 | 56 |
| 57 // You must call this function before anything else. Returns true on success. | 57 // You must call this function before anything else. Returns true on success. |
| 58 // The delegate pointer must outlive this class, ownership is not | 58 // The delegate pointer must outlive this class, ownership is not |
| 59 // transferred. | 59 // transferred. |
| 60 virtual bool InitHostWithChannel(Delegate* delegate, | 60 virtual bool InitHostWithChannel(Delegate* delegate, |
| 61 base::ProcessId peer_pid, |
| 61 const IPC::ChannelHandle& channel_handle, | 62 const IPC::ChannelHandle& channel_handle, |
| 62 bool is_client, | 63 bool is_client, |
| 63 const Preferences& preferences); | 64 const Preferences& preferences); |
| 64 | 65 |
| 65 // The host side maintains a mapping from PP_Instance to Dispatcher so | 66 // The host side maintains a mapping from PP_Instance to Dispatcher so |
| 66 // that we can send the messages to the right channel. | 67 // that we can send the messages to the right channel. |
| 67 static HostDispatcher* GetForInstance(PP_Instance instance); | 68 static HostDispatcher* GetForInstance(PP_Instance instance); |
| 68 static void SetForInstance(PP_Instance instance, | 69 static void SetForInstance(PP_Instance instance, |
| 69 HostDispatcher* dispatcher); | 70 HostDispatcher* dispatcher); |
| 70 static void RemoveForInstance(PP_Instance instance); | 71 static void RemoveForInstance(PP_Instance instance); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 private: | 147 private: |
| 147 HostDispatcher* dispatcher_; | 148 HostDispatcher* dispatcher_; |
| 148 | 149 |
| 149 DISALLOW_COPY_AND_ASSIGN(ScopedModuleReference); | 150 DISALLOW_COPY_AND_ASSIGN(ScopedModuleReference); |
| 150 }; | 151 }; |
| 151 | 152 |
| 152 } // namespace proxy | 153 } // namespace proxy |
| 153 } // namespace ppapi | 154 } // namespace ppapi |
| 154 | 155 |
| 155 #endif // PPAPI_PROXY_HOST_DISPATCHER_H_ | 156 #endif // PPAPI_PROXY_HOST_DISPATCHER_H_ |
| OLD | NEW |