| 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/pepper/plugin_delegate.h" | 22 #include "content/renderer/pepper/plugin_delegate.h" |
| 23 #include "content/renderer/render_view_pepper_helper.h" | 23 #include "content/renderer/render_view_pepper_helper.h" |
| 24 #include "ppapi/c/pp_file_info.h" | 24 #include "ppapi/c/pp_file_info.h" |
| 25 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" | |
| 26 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" | 25 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" |
| 27 #include "ui/base/ime/text_input_type.h" | 26 #include "ui/base/ime/text_input_type.h" |
| 28 | 27 |
| 29 namespace base { | 28 namespace base { |
| 30 class FilePath; | 29 class FilePath; |
| 31 } | 30 } |
| 32 | 31 |
| 33 namespace ppapi { | 32 namespace ppapi { |
| 34 class PepperFilePath; | 33 class PepperFilePath; |
| 35 class PPB_X509Certificate_Fields; | 34 class PPB_X509Certificate_Fields; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) OVERRIDE; | 214 virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) OVERRIDE; |
| 216 virtual void TCPSocketWrite(uint32 socket_id, | 215 virtual void TCPSocketWrite(uint32 socket_id, |
| 217 const std::string& buffer) OVERRIDE; | 216 const std::string& buffer) OVERRIDE; |
| 218 virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; | 217 virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; |
| 219 virtual void TCPSocketSetOption( | 218 virtual void TCPSocketSetOption( |
| 220 uint32 socket_id, | 219 uint32 socket_id, |
| 221 PP_TCPSocket_Option name, | 220 PP_TCPSocket_Option name, |
| 222 const ppapi::SocketOptionData& value) OVERRIDE; | 221 const ppapi::SocketOptionData& value) OVERRIDE; |
| 223 virtual void RegisterTCPSocket(PPB_TCPSocket_Private_Impl* socket, | 222 virtual void RegisterTCPSocket(PPB_TCPSocket_Private_Impl* socket, |
| 224 uint32 socket_id) OVERRIDE; | 223 uint32 socket_id) OVERRIDE; |
| 225 virtual void TCPServerSocketListen( | |
| 226 PP_Resource socket_resource, | |
| 227 const PP_NetAddress_Private& addr, | |
| 228 int32_t backlog) OVERRIDE; | |
| 229 virtual void TCPServerSocketAccept(uint32 server_socket_id) OVERRIDE; | |
| 230 virtual void TCPServerSocketStopListening( | |
| 231 PP_Resource socket_resource, | |
| 232 uint32 socket_id) OVERRIDE; | |
| 233 virtual bool X509CertificateParseDER( | 224 virtual bool X509CertificateParseDER( |
| 234 const std::vector<char>& der, | 225 const std::vector<char>& der, |
| 235 ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE; | 226 ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE; |
| 236 virtual FullscreenContainer* CreateFullscreenContainer( | 227 virtual FullscreenContainer* CreateFullscreenContainer( |
| 237 PepperPluginInstanceImpl* instance) OVERRIDE; | 228 PepperPluginInstanceImpl* instance) OVERRIDE; |
| 238 virtual gfx::Size GetScreenSize() OVERRIDE; | 229 virtual gfx::Size GetScreenSize() OVERRIDE; |
| 239 virtual std::string GetDefaultEncoding() OVERRIDE; | 230 virtual std::string GetDefaultEncoding() OVERRIDE; |
| 240 virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor) | 231 virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor) |
| 241 OVERRIDE; | 232 OVERRIDE; |
| 242 virtual base::SharedMemory* CreateAnonymousSharedMemory(size_t size) | 233 virtual base::SharedMemory* CreateAnonymousSharedMemory(size_t size) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 void OnTCPSocketReadACK(uint32 plugin_dispatcher_id, | 271 void OnTCPSocketReadACK(uint32 plugin_dispatcher_id, |
| 281 uint32 socket_id, | 272 uint32 socket_id, |
| 282 int32_t result, | 273 int32_t result, |
| 283 const std::string& data); | 274 const std::string& data); |
| 284 void OnTCPSocketWriteACK(uint32 plugin_dispatcher_id, | 275 void OnTCPSocketWriteACK(uint32 plugin_dispatcher_id, |
| 285 uint32 socket_id, | 276 uint32 socket_id, |
| 286 int32_t result); | 277 int32_t result); |
| 287 void OnTCPSocketSetOptionACK(uint32 plugin_dispatcher_id, | 278 void OnTCPSocketSetOptionACK(uint32 plugin_dispatcher_id, |
| 288 uint32 socket_id, | 279 uint32 socket_id, |
| 289 int32_t result); | 280 int32_t result); |
| 290 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id, | |
| 291 PP_Resource socket_resource, | |
| 292 uint32 socket_id, | |
| 293 const PP_NetAddress_Private& local_addr, | |
| 294 int32_t status); | |
| 295 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id, | |
| 296 uint32 socket_id, | |
| 297 uint32 accepted_socket_id, | |
| 298 const PP_NetAddress_Private& local_addr, | |
| 299 const PP_NetAddress_Private& remote_addr); | |
| 300 | 281 |
| 301 // Attempts to create a PPAPI plugin for the given filepath. On success, it | 282 // Attempts to create a PPAPI plugin for the given filepath. On success, it |
| 302 // will return the newly-created module. | 283 // will return the newly-created module. |
| 303 // | 284 // |
| 304 // There are two reasons for failure. The first is that the plugin isn't | 285 // There are two reasons for failure. The first is that the plugin isn't |
| 305 // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set | 286 // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set |
| 306 // to false and the caller may want to fall back on creating an NPAPI plugin. | 287 // to false and the caller may want to fall back on creating an NPAPI plugin. |
| 307 // the second is that the plugin failed to initialize. In this case, | 288 // the second is that the plugin failed to initialize. In this case, |
| 308 // |*pepper_plugin_was_registered| will be set to true and the caller should | 289 // |*pepper_plugin_was_registered| will be set to true and the caller should |
| 309 // not fall back on any other plugin types. | 290 // not fall back on any other plugin types. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 330 |
| 350 std::set<PepperPluginInstanceImpl*> active_instances_; | 331 std::set<PepperPluginInstanceImpl*> active_instances_; |
| 351 typedef std::map<PepperPluginInstanceImpl*, | 332 typedef std::map<PepperPluginInstanceImpl*, |
| 352 MouseLockDispatcher::LockTarget*> LockTargetMap; | 333 MouseLockDispatcher::LockTarget*> LockTargetMap; |
| 353 LockTargetMap mouse_lock_instances_; | 334 LockTargetMap mouse_lock_instances_; |
| 354 | 335 |
| 355 IDMap<AsyncOpenFileCallback> pending_async_open_files_; | 336 IDMap<AsyncOpenFileCallback> pending_async_open_files_; |
| 356 | 337 |
| 357 IDMap<PPB_TCPSocket_Private_Impl> tcp_sockets_; | 338 IDMap<PPB_TCPSocket_Private_Impl> tcp_sockets_; |
| 358 | 339 |
| 359 IDMap<ppapi::PPB_TCPServerSocket_Shared> tcp_server_sockets_; | |
| 360 | |
| 361 typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap; | 340 typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap; |
| 362 BrokerMap pending_connect_broker_; | 341 BrokerMap pending_connect_broker_; |
| 363 | 342 |
| 364 typedef IDMap<base::WeakPtr<PPB_Broker_Impl> > PermissionRequestMap; | 343 typedef IDMap<base::WeakPtr<PPB_Broker_Impl> > PermissionRequestMap; |
| 365 PermissionRequestMap pending_permission_requests_; | 344 PermissionRequestMap pending_permission_requests_; |
| 366 | 345 |
| 367 // Whether or not the focus is on a PPAPI plugin | 346 // Whether or not the focus is on a PPAPI plugin |
| 368 PepperPluginInstanceImpl* focused_plugin_; | 347 PepperPluginInstanceImpl* focused_plugin_; |
| 369 | 348 |
| 370 // Current text input composition text. Empty if no composition is in | 349 // Current text input composition text. Empty if no composition is in |
| 371 // progress. | 350 // progress. |
| 372 string16 composition_text_; | 351 string16 composition_text_; |
| 373 | 352 |
| 374 // The plugin instance that received the last mouse event. It is set to NULL | 353 // The plugin instance that received the last mouse event. It is set to NULL |
| 375 // if the last mouse event went to elements other than Pepper plugins. | 354 // if the last mouse event went to elements other than Pepper plugins. |
| 376 // |last_mouse_event_target_| is not owned by this class. We can know about | 355 // |last_mouse_event_target_| is not owned by this class. We can know about |
| 377 // when it is destroyed via InstanceDeleted(). | 356 // when it is destroyed via InstanceDeleted(). |
| 378 PepperPluginInstanceImpl* last_mouse_event_target_; | 357 PepperPluginInstanceImpl* last_mouse_event_target_; |
| 379 | 358 |
| 380 scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_; | 359 scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_; |
| 381 | 360 |
| 382 scoped_refptr<ContextProviderCommandBuffer> offscreen_context3d_; | 361 scoped_refptr<ContextProviderCommandBuffer> offscreen_context3d_; |
| 383 | 362 |
| 384 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 363 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
| 385 }; | 364 }; |
| 386 | 365 |
| 387 } // namespace content | 366 } // namespace content |
| 388 | 367 |
| 389 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 368 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |