| 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_PLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 326 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |
| 327 uint32 socket_id, | 327 uint32 socket_id, |
| 328 const PP_NetAddress_Private& addr) OVERRIDE; | 328 const PP_NetAddress_Private& addr) OVERRIDE; |
| 329 virtual void TCPSocketSSLHandshake(uint32 socket_id, | 329 virtual void TCPSocketSSLHandshake(uint32 socket_id, |
| 330 const std::string& server_name, | 330 const std::string& server_name, |
| 331 uint16_t server_port) OVERRIDE; | 331 uint16_t server_port) OVERRIDE; |
| 332 virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) OVERRIDE; | 332 virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) OVERRIDE; |
| 333 virtual void TCPSocketWrite(uint32 socket_id, | 333 virtual void TCPSocketWrite(uint32 socket_id, |
| 334 const std::string& buffer) OVERRIDE; | 334 const std::string& buffer) OVERRIDE; |
| 335 virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; | 335 virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; |
| 336 virtual void RegisterTCPSocket( |
| 337 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |
| 338 uint32 socket_id) OVERRIDE; |
| 336 | 339 |
| 337 virtual uint32 UDPSocketCreate() OVERRIDE; | 340 virtual uint32 UDPSocketCreate() OVERRIDE; |
| 338 virtual void UDPSocketBind( | 341 virtual void UDPSocketBind( |
| 339 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, | 342 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, |
| 340 uint32 socket_id, | 343 uint32 socket_id, |
| 341 const PP_NetAddress_Private& addr) OVERRIDE; | 344 const PP_NetAddress_Private& addr) OVERRIDE; |
| 342 virtual void UDPSocketRecvFrom(uint32 socket_id, | 345 virtual void UDPSocketRecvFrom(uint32 socket_id, |
| 343 int32_t num_bytes) OVERRIDE; | 346 int32_t num_bytes) OVERRIDE; |
| 344 virtual void UDPSocketSendTo(uint32 socket_id, | 347 virtual void UDPSocketSendTo(uint32 socket_id, |
| 345 const std::string& buffer, | 348 const std::string& buffer, |
| 346 const PP_NetAddress_Private& addr) OVERRIDE; | 349 const PP_NetAddress_Private& addr) OVERRIDE; |
| 347 virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; | 350 virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; |
| 351 virtual void TCPServerSocketListen( |
| 352 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket, |
| 353 uint32 temp_socket_id, |
| 354 const PP_NetAddress_Private& addr, |
| 355 int32_t backlog) OVERRIDE; |
| 356 virtual void TCPServerSocketAccept(uint32 socket_id) OVERRIDE; |
| 357 virtual void TCPServerSocketStopListening(uint32 socket_id) OVERRIDE; |
| 348 | 358 |
| 349 virtual int32_t ShowContextMenu( | 359 virtual int32_t ShowContextMenu( |
| 350 webkit::ppapi::PluginInstance* instance, | 360 webkit::ppapi::PluginInstance* instance, |
| 351 webkit::ppapi::PPB_Flash_Menu_Impl* menu, | 361 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
| 352 const gfx::Point& position) OVERRIDE; | 362 const gfx::Point& position) OVERRIDE; |
| 353 void OnContextMenuClosed( | 363 void OnContextMenuClosed( |
| 354 const content::CustomContextMenuContext& custom_context); | 364 const content::CustomContextMenuContext& custom_context); |
| 355 void OnCustomContextMenuAction( | 365 void OnCustomContextMenuAction( |
| 356 const content::CustomContextMenuContext& custom_context, | 366 const content::CustomContextMenuContext& custom_context, |
| 357 unsigned action); | 367 unsigned action); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 bool succeeded); | 422 bool succeeded); |
| 413 void OnUDPSocketSendToACK(uint32 plugin_dispatcher_id, | 423 void OnUDPSocketSendToACK(uint32 plugin_dispatcher_id, |
| 414 uint32 socket_id, | 424 uint32 socket_id, |
| 415 bool succeeded, | 425 bool succeeded, |
| 416 int32_t bytes_written); | 426 int32_t bytes_written); |
| 417 void OnUDPSocketRecvFromACK(uint32 plugin_dispatcher_id, | 427 void OnUDPSocketRecvFromACK(uint32 plugin_dispatcher_id, |
| 418 uint32 socket_id, | 428 uint32 socket_id, |
| 419 bool succeeded, | 429 bool succeeded, |
| 420 const std::string& data, | 430 const std::string& data, |
| 421 const PP_NetAddress_Private& addr); | 431 const PP_NetAddress_Private& addr); |
| 432 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id, |
| 433 uint32 real_socket_id, |
| 434 uint32 temp_socket_id, |
| 435 int32_t status); |
| 436 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id, |
| 437 uint32 real_server_socket_id, |
| 438 uint32 accepted_socket_id, |
| 439 const PP_NetAddress_Private& local_addr, |
| 440 const PP_NetAddress_Private& remote_addr); |
| 422 | 441 |
| 423 CONTENT_EXPORT int GetRoutingId() const; | 442 CONTENT_EXPORT int GetRoutingId() const; |
| 424 | 443 |
| 425 private: | 444 private: |
| 426 // Asynchronously attempts to create a PPAPI broker for the given plugin. | 445 // Asynchronously attempts to create a PPAPI broker for the given plugin. |
| 427 scoped_refptr<PpapiBrokerImpl> CreatePpapiBroker( | 446 scoped_refptr<PpapiBrokerImpl> CreatePpapiBroker( |
| 428 webkit::ppapi::PluginModule* plugin_module); | 447 webkit::ppapi::PluginModule* plugin_module); |
| 429 | 448 |
| 430 // Implementation of PepperParentContextProvider. | 449 // Implementation of PepperParentContextProvider. |
| 431 virtual ContentGLContext* GetParentContextForPlatformContext3D() OVERRIDE; | 450 virtual ContentGLContext* GetParentContextForPlatformContext3D() OVERRIDE; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 458 | 477 |
| 459 IDMap<AsyncOpenFileCallback> pending_async_open_files_; | 478 IDMap<AsyncOpenFileCallback> pending_async_open_files_; |
| 460 | 479 |
| 461 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, | 480 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, |
| 462 IDMapOwnPointer> pending_connect_tcps_; | 481 IDMapOwnPointer> pending_connect_tcps_; |
| 463 | 482 |
| 464 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; | 483 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; |
| 465 | 484 |
| 466 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_; | 485 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_; |
| 467 | 486 |
| 487 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> tcp_server_sockets_; |
| 488 |
| 489 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> |
| 490 uninitialized_tcp_server_sockets_; |
| 491 |
| 468 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, | 492 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, |
| 469 IDMapOwnPointer> pending_context_menus_; | 493 IDMapOwnPointer> pending_context_menus_; |
| 470 | 494 |
| 471 typedef IDMap<scoped_refptr<PpapiBrokerImpl>, IDMapOwnPointer> BrokerMap; | 495 typedef IDMap<scoped_refptr<PpapiBrokerImpl>, IDMapOwnPointer> BrokerMap; |
| 472 BrokerMap pending_connect_broker_; | 496 BrokerMap pending_connect_broker_; |
| 473 | 497 |
| 474 // Whether or not the focus is on a PPAPI plugin | 498 // Whether or not the focus is on a PPAPI plugin |
| 475 webkit::ppapi::PluginInstance* focused_plugin_; | 499 webkit::ppapi::PluginInstance* focused_plugin_; |
| 476 | 500 |
| 477 // Current text input composition text. Empty if no composition is in | 501 // Current text input composition text. Empty if no composition is in |
| 478 // progress. | 502 // progress. |
| 479 string16 composition_text_; | 503 string16 composition_text_; |
| 480 | 504 |
| 481 // The plugin instance that received the last mouse event. It is set to NULL | 505 // The plugin instance that received the last mouse event. It is set to NULL |
| 482 // if the last mouse event went to elements other than Pepper plugins. | 506 // if the last mouse event went to elements other than Pepper plugins. |
| 483 // |last_mouse_event_target_| is not owned by this class. We can know about | 507 // |last_mouse_event_target_| is not owned by this class. We can know about |
| 484 // when it is destroyed via InstanceDeleted(). | 508 // when it is destroyed via InstanceDeleted(). |
| 485 webkit::ppapi::PluginInstance* last_mouse_event_target_; | 509 webkit::ppapi::PluginInstance* last_mouse_event_target_; |
| 486 | 510 |
| 487 scoped_ptr<content::GamepadSharedMemoryReader> gamepad_shared_memory_reader_; | 511 scoped_ptr<content::GamepadSharedMemoryReader> gamepad_shared_memory_reader_; |
| 488 | 512 |
| 489 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 513 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
| 490 }; | 514 }; |
| 491 | 515 |
| 492 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 516 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |