| 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 CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/id_map.h" | 14 #include "base/id_map.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "content/public/renderer/render_view_observer.h" | 19 #include "content/public/renderer/render_view_observer.h" |
| 20 #include "content/renderer/pepper/pepper_browser_connection.h" | 20 #include "content/renderer/pepper/pepper_browser_connection.h" |
| 21 #include "content/renderer/pepper_helper.h" | 21 #include "content/renderer/pepper_helper.h" |
| 22 #include "ipc/ipc_platform_file.h" | 22 #include "ipc/ipc_platform_file.h" |
| 23 #include "ppapi/c/pp_file_info.h" | 23 #include "ppapi/c/pp_file_info.h" |
| 24 #include "ppapi/c/ppb_tcp_socket.h" | 24 #include "ppapi/c/ppb_tcp_socket.h" |
| 25 #include "ppapi/c/private/ppb_tcp_socket_private.h" | 25 #include "ppapi/c/private/ppb_tcp_socket_private.h" |
| 26 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" | |
| 27 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" | 26 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" |
| 28 #include "ppapi/shared_impl/url_response_info_data.h" | 27 #include "ppapi/shared_impl/url_response_info_data.h" |
| 29 #include "ui/base/ime/text_input_type.h" | 28 #include "ui/base/ime/text_input_type.h" |
| 30 | 29 |
| 31 namespace base { | 30 namespace base { |
| 32 class FilePath; | 31 class FilePath; |
| 33 } | 32 } |
| 34 | 33 |
| 35 namespace ppapi { | 34 namespace ppapi { |
| 36 class PepperFilePath; | 35 class PepperFilePath; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 void OnTCPSocketReadACK(uint32 plugin_dispatcher_id, | 191 void OnTCPSocketReadACK(uint32 plugin_dispatcher_id, |
| 193 uint32 socket_id, | 192 uint32 socket_id, |
| 194 int32_t result, | 193 int32_t result, |
| 195 const std::string& data); | 194 const std::string& data); |
| 196 void OnTCPSocketWriteACK(uint32 plugin_dispatcher_id, | 195 void OnTCPSocketWriteACK(uint32 plugin_dispatcher_id, |
| 197 uint32 socket_id, | 196 uint32 socket_id, |
| 198 int32_t result); | 197 int32_t result); |
| 199 void OnTCPSocketSetOptionACK(uint32 plugin_dispatcher_id, | 198 void OnTCPSocketSetOptionACK(uint32 plugin_dispatcher_id, |
| 200 uint32 socket_id, | 199 uint32 socket_id, |
| 201 int32_t result); | 200 int32_t result); |
| 202 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id, | |
| 203 PP_Resource socket_resource, | |
| 204 uint32 socket_id, | |
| 205 const PP_NetAddress_Private& local_addr, | |
| 206 int32_t status); | |
| 207 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id, | |
| 208 uint32 socket_id, | |
| 209 uint32 accepted_socket_id, | |
| 210 const PP_NetAddress_Private& local_addr, | |
| 211 const PP_NetAddress_Private& remote_addr); | |
| 212 void OnPpapiBrokerChannelCreated(int request_id, | 201 void OnPpapiBrokerChannelCreated(int request_id, |
| 213 base::ProcessId broker_pid, | 202 base::ProcessId broker_pid, |
| 214 const IPC::ChannelHandle& handle); | 203 const IPC::ChannelHandle& handle); |
| 215 void OnAsyncFileOpened(base::PlatformFileError error_code, | 204 void OnAsyncFileOpened(base::PlatformFileError error_code, |
| 216 IPC::PlatformFileForTransit file_for_transit, | 205 IPC::PlatformFileForTransit file_for_transit, |
| 217 int message_id); | 206 int message_id); |
| 218 void OnPpapiBrokerPermissionResult(int request_id, bool result); | 207 void OnPpapiBrokerPermissionResult(int request_id, bool result); |
| 219 | 208 |
| 220 // Attempts to create a PPAPI plugin for the given filepath. On success, it | 209 // Attempts to create a PPAPI plugin for the given filepath. On success, it |
| 221 // will return the newly-created module. | 210 // will return the newly-created module. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 // Connection for sending and receiving pepper host-related messages to/from | 245 // Connection for sending and receiving pepper host-related messages to/from |
| 257 // the browser. | 246 // the browser. |
| 258 PepperBrowserConnection pepper_browser_connection_; | 247 PepperBrowserConnection pepper_browser_connection_; |
| 259 | 248 |
| 260 std::set<PepperPluginInstanceImpl*> active_instances_; | 249 std::set<PepperPluginInstanceImpl*> active_instances_; |
| 261 | 250 |
| 262 IDMap<AsyncOpenFileCallback> pending_async_open_files_; | 251 IDMap<AsyncOpenFileCallback> pending_async_open_files_; |
| 263 | 252 |
| 264 IDMap<PPB_TCPSocket_Private_Impl> tcp_sockets_; | 253 IDMap<PPB_TCPSocket_Private_Impl> tcp_sockets_; |
| 265 | 254 |
| 266 IDMap<ppapi::PPB_TCPServerSocket_Shared> tcp_server_sockets_; | |
| 267 | |
| 268 typedef IDMap<scoped_refptr<PepperBroker>, IDMapOwnPointer> BrokerMap; | 255 typedef IDMap<scoped_refptr<PepperBroker>, IDMapOwnPointer> BrokerMap; |
| 269 BrokerMap pending_connect_broker_; | 256 BrokerMap pending_connect_broker_; |
| 270 | 257 |
| 271 typedef IDMap<base::WeakPtr<PPB_Broker_Impl> > PermissionRequestMap; | 258 typedef IDMap<base::WeakPtr<PPB_Broker_Impl> > PermissionRequestMap; |
| 272 PermissionRequestMap pending_permission_requests_; | 259 PermissionRequestMap pending_permission_requests_; |
| 273 | 260 |
| 274 // Whether or not the focus is on a PPAPI plugin | 261 // Whether or not the focus is on a PPAPI plugin |
| 275 PepperPluginInstanceImpl* focused_plugin_; | 262 PepperPluginInstanceImpl* focused_plugin_; |
| 276 | 263 |
| 277 // Current text input composition text. Empty if no composition is in | 264 // Current text input composition text. Empty if no composition is in |
| 278 // progress. | 265 // progress. |
| 279 string16 composition_text_; | 266 string16 composition_text_; |
| 280 | 267 |
| 281 // The plugin instance that received the last mouse event. It is set to NULL | 268 // The plugin instance that received the last mouse event. It is set to NULL |
| 282 // if the last mouse event went to elements other than Pepper plugins. | 269 // if the last mouse event went to elements other than Pepper plugins. |
| 283 // |last_mouse_event_target_| is not owned by this class. We can know about | 270 // |last_mouse_event_target_| is not owned by this class. We can know about |
| 284 // when it is destroyed via InstanceDeleted(). | 271 // when it is destroyed via InstanceDeleted(). |
| 285 PepperPluginInstanceImpl* last_mouse_event_target_; | 272 PepperPluginInstanceImpl* last_mouse_event_target_; |
| 286 | 273 |
| 287 scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_; | 274 scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_; |
| 288 | 275 |
| 289 scoped_refptr<ContextProviderCommandBuffer> offscreen_context3d_; | 276 scoped_refptr<ContextProviderCommandBuffer> offscreen_context3d_; |
| 290 | 277 |
| 291 DISALLOW_COPY_AND_ASSIGN(PepperHelperImpl); | 278 DISALLOW_COPY_AND_ASSIGN(PepperHelperImpl); |
| 292 }; | 279 }; |
| 293 | 280 |
| 294 } // namespace content | 281 } // namespace content |
| 295 | 282 |
| 296 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_H_ | 283 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_H_ |
| OLD | NEW |