| 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_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_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/mouse_lock_dispatcher.h" | 20 #include "content/renderer/mouse_lock_dispatcher.h" |
| 21 #include "content/renderer/pepper/pepper_browser_connection.h" | 21 #include "content/renderer/pepper/pepper_browser_connection.h" |
| 22 #include "content/renderer/render_view_pepper_helper.h" | 22 #include "content/renderer/render_view_pepper_helper.h" |
| 23 #include "ppapi/c/pp_file_info.h" | 23 #include "ppapi/c/pp_file_info.h" |
| 24 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" | |
| 25 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" | 24 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" |
| 26 #include "ui/base/ime/text_input_type.h" | 25 #include "ui/base/ime/text_input_type.h" |
| 27 #include "webkit/plugins/ppapi/plugin_delegate.h" | 26 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 28 | 27 |
| 29 namespace base { | 28 namespace base { |
| 30 class FilePath; | 29 class FilePath; |
| 31 } | 30 } |
| 32 | 31 |
| 33 namespace IPC { | 32 namespace IPC { |
| 34 struct ChannelHandle; | 33 struct ChannelHandle; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 virtual void TCPSocketWrite(uint32 socket_id, | 281 virtual void TCPSocketWrite(uint32 socket_id, |
| 283 const std::string& buffer) OVERRIDE; | 282 const std::string& buffer) OVERRIDE; |
| 284 virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; | 283 virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; |
| 285 virtual void TCPSocketSetOption( | 284 virtual void TCPSocketSetOption( |
| 286 uint32 socket_id, | 285 uint32 socket_id, |
| 287 PP_TCPSocket_Option name, | 286 PP_TCPSocket_Option name, |
| 288 const ppapi::SocketOptionData& value) OVERRIDE; | 287 const ppapi::SocketOptionData& value) OVERRIDE; |
| 289 virtual void RegisterTCPSocket( | 288 virtual void RegisterTCPSocket( |
| 290 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 289 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |
| 291 uint32 socket_id) OVERRIDE; | 290 uint32 socket_id) OVERRIDE; |
| 292 virtual void TCPServerSocketListen( | |
| 293 PP_Resource socket_resource, | |
| 294 const PP_NetAddress_Private& addr, | |
| 295 int32_t backlog) OVERRIDE; | |
| 296 virtual void TCPServerSocketAccept(uint32 server_socket_id) OVERRIDE; | |
| 297 virtual void TCPServerSocketStopListening( | |
| 298 PP_Resource socket_resource, | |
| 299 uint32 socket_id) OVERRIDE; | |
| 300 virtual bool AddNetworkListObserver( | 291 virtual bool AddNetworkListObserver( |
| 301 webkit_glue::NetworkListObserver* observer) OVERRIDE; | 292 webkit_glue::NetworkListObserver* observer) OVERRIDE; |
| 302 virtual void RemoveNetworkListObserver( | 293 virtual void RemoveNetworkListObserver( |
| 303 webkit_glue::NetworkListObserver* observer) OVERRIDE; | 294 webkit_glue::NetworkListObserver* observer) OVERRIDE; |
| 304 virtual bool X509CertificateParseDER( | 295 virtual bool X509CertificateParseDER( |
| 305 const std::vector<char>& der, | 296 const std::vector<char>& der, |
| 306 ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE; | 297 ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE; |
| 307 virtual webkit::ppapi::FullscreenContainer* | 298 virtual webkit::ppapi::FullscreenContainer* |
| 308 CreateFullscreenContainer( | 299 CreateFullscreenContainer( |
| 309 webkit::ppapi::PluginInstance* instance) OVERRIDE; | 300 webkit::ppapi::PluginInstance* instance) OVERRIDE; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 void OnTCPSocketReadACK(uint32 plugin_dispatcher_id, | 344 void OnTCPSocketReadACK(uint32 plugin_dispatcher_id, |
| 354 uint32 socket_id, | 345 uint32 socket_id, |
| 355 int32_t result, | 346 int32_t result, |
| 356 const std::string& data); | 347 const std::string& data); |
| 357 void OnTCPSocketWriteACK(uint32 plugin_dispatcher_id, | 348 void OnTCPSocketWriteACK(uint32 plugin_dispatcher_id, |
| 358 uint32 socket_id, | 349 uint32 socket_id, |
| 359 int32_t result); | 350 int32_t result); |
| 360 void OnTCPSocketSetOptionACK(uint32 plugin_dispatcher_id, | 351 void OnTCPSocketSetOptionACK(uint32 plugin_dispatcher_id, |
| 361 uint32 socket_id, | 352 uint32 socket_id, |
| 362 int32_t result); | 353 int32_t result); |
| 363 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id, | |
| 364 PP_Resource socket_resource, | |
| 365 uint32 socket_id, | |
| 366 const PP_NetAddress_Private& local_addr, | |
| 367 int32_t status); | |
| 368 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id, | |
| 369 uint32 socket_id, | |
| 370 uint32 accepted_socket_id, | |
| 371 const PP_NetAddress_Private& local_addr, | |
| 372 const PP_NetAddress_Private& remote_addr); | |
| 373 | 354 |
| 374 // Attempts to create a PPAPI plugin for the given filepath. On success, it | 355 // Attempts to create a PPAPI plugin for the given filepath. On success, it |
| 375 // will return the newly-created module. | 356 // will return the newly-created module. |
| 376 // | 357 // |
| 377 // There are two reasons for failure. The first is that the plugin isn't | 358 // There are two reasons for failure. The first is that the plugin isn't |
| 378 // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set | 359 // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set |
| 379 // to false and the caller may want to fall back on creating an NPAPI plugin. | 360 // to false and the caller may want to fall back on creating an NPAPI plugin. |
| 380 // the second is that the plugin failed to initialize. In this case, | 361 // the second is that the plugin failed to initialize. In this case, |
| 381 // |*pepper_plugin_was_registered| will be set to true and the caller should | 362 // |*pepper_plugin_was_registered| will be set to true and the caller should |
| 382 // not fall back on any other plugin types. | 363 // not fall back on any other plugin types. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 | 405 |
| 425 std::set<webkit::ppapi::PluginInstance*> active_instances_; | 406 std::set<webkit::ppapi::PluginInstance*> active_instances_; |
| 426 typedef std::map<webkit::ppapi::PluginInstance*, | 407 typedef std::map<webkit::ppapi::PluginInstance*, |
| 427 MouseLockDispatcher::LockTarget*> LockTargetMap; | 408 MouseLockDispatcher::LockTarget*> LockTargetMap; |
| 428 LockTargetMap mouse_lock_instances_; | 409 LockTargetMap mouse_lock_instances_; |
| 429 | 410 |
| 430 IDMap<AsyncOpenFileCallback> pending_async_open_files_; | 411 IDMap<AsyncOpenFileCallback> pending_async_open_files_; |
| 431 | 412 |
| 432 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; | 413 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; |
| 433 | 414 |
| 434 IDMap<ppapi::PPB_TCPServerSocket_Shared> tcp_server_sockets_; | |
| 435 | |
| 436 typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap; | 415 typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap; |
| 437 BrokerMap pending_connect_broker_; | 416 BrokerMap pending_connect_broker_; |
| 438 | 417 |
| 439 typedef IDMap<base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> > | 418 typedef IDMap<base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> > |
| 440 PermissionRequestMap; | 419 PermissionRequestMap; |
| 441 PermissionRequestMap pending_permission_requests_; | 420 PermissionRequestMap pending_permission_requests_; |
| 442 | 421 |
| 443 // Whether or not the focus is on a PPAPI plugin | 422 // Whether or not the focus is on a PPAPI plugin |
| 444 webkit::ppapi::PluginInstance* focused_plugin_; | 423 webkit::ppapi::PluginInstance* focused_plugin_; |
| 445 | 424 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 459 device_enumeration_event_handler_; | 438 device_enumeration_event_handler_; |
| 460 | 439 |
| 461 scoped_refptr<ContextProviderCommandBuffer> offscreen_context3d_; | 440 scoped_refptr<ContextProviderCommandBuffer> offscreen_context3d_; |
| 462 | 441 |
| 463 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 442 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
| 464 }; | 443 }; |
| 465 | 444 |
| 466 } // namespace content | 445 } // namespace content |
| 467 | 446 |
| 468 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 447 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |