| 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_parent_context_provider.h" | 21 #include "content/renderer/pepper/pepper_parent_context_provider.h" |
| 22 #include "content/renderer/render_view_pepper_helper.h" | 22 #include "content/renderer/render_view_pepper_helper.h" |
| 23 #include "ppapi/shared_impl/private/ppb_host_resolver_shared.h" | 23 #include "ppapi/shared_impl/private/ppb_host_resolver_shared.h" |
| 24 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" | 24 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" |
| 25 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" | 25 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" |
| 26 #include "ui/base/ime/text_input_type.h" | 26 #include "ui/base/ime/text_input_type.h" |
| 27 #include "webkit/plugins/ppapi/plugin_delegate.h" | 27 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 28 | 28 |
| 29 namespace base { |
| 29 class FilePath; | 30 class FilePath; |
| 31 } |
| 30 | 32 |
| 31 namespace IPC { | 33 namespace IPC { |
| 32 struct ChannelHandle; | 34 struct ChannelHandle; |
| 33 } | 35 } |
| 34 | 36 |
| 35 namespace ppapi { | 37 namespace ppapi { |
| 36 class PepperFilePath; | 38 class PepperFilePath; |
| 37 class PPB_X509Certificate_Fields; | 39 class PPB_X509Certificate_Fields; |
| 38 class PpapiPermissions; | 40 class PpapiPermissions; |
| 39 } | 41 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 66 public: | 68 public: |
| 67 explicit PepperPluginDelegateImpl(RenderViewImpl* render_view); | 69 explicit PepperPluginDelegateImpl(RenderViewImpl* render_view); |
| 68 virtual ~PepperPluginDelegateImpl(); | 70 virtual ~PepperPluginDelegateImpl(); |
| 69 | 71 |
| 70 RenderViewImpl* render_view() { return render_view_; } | 72 RenderViewImpl* render_view() { return render_view_; } |
| 71 | 73 |
| 72 // Sets up the renderer host and out-of-process proxy for an external plugin | 74 // Sets up the renderer host and out-of-process proxy for an external plugin |
| 73 // module. Returns the renderer host, or NULL if it couldn't be created. | 75 // module. Returns the renderer host, or NULL if it couldn't be created. |
| 74 RendererPpapiHost* CreateExternalPluginModule( | 76 RendererPpapiHost* CreateExternalPluginModule( |
| 75 scoped_refptr<webkit::ppapi::PluginModule> module, | 77 scoped_refptr<webkit::ppapi::PluginModule> module, |
| 76 const FilePath& path, | 78 const base::FilePath& path, |
| 77 ppapi::PpapiPermissions permissions, | 79 ppapi::PpapiPermissions permissions, |
| 78 const IPC::ChannelHandle& channel_handle, | 80 const IPC::ChannelHandle& channel_handle, |
| 79 base::ProcessId plugin_pid, | 81 base::ProcessId plugin_pid, |
| 80 int plugin_child_id); | 82 int plugin_child_id); |
| 81 | 83 |
| 82 // Removes broker from pending_connect_broker_ if present. Returns true if so. | 84 // Removes broker from pending_connect_broker_ if present. Returns true if so. |
| 83 bool StopWaitingForBrokerConnection(PepperBrokerImpl* broker); | 85 bool StopWaitingForBrokerConnection(PepperBrokerImpl* broker); |
| 84 | 86 |
| 85 CONTENT_EXPORT int GetRoutingID() const; | 87 CONTENT_EXPORT int GetRoutingID() const; |
| 86 | 88 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 virtual void PluginCrashed(webkit::ppapi::PluginInstance* instance) OVERRIDE; | 162 virtual void PluginCrashed(webkit::ppapi::PluginInstance* instance) OVERRIDE; |
| 161 virtual void InstanceCreated( | 163 virtual void InstanceCreated( |
| 162 webkit::ppapi::PluginInstance* instance) OVERRIDE; | 164 webkit::ppapi::PluginInstance* instance) OVERRIDE; |
| 163 virtual void InstanceDeleted( | 165 virtual void InstanceDeleted( |
| 164 webkit::ppapi::PluginInstance* instance) OVERRIDE; | 166 webkit::ppapi::PluginInstance* instance) OVERRIDE; |
| 165 virtual scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> | 167 virtual scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> |
| 166 CreateResourceCreationAPI( | 168 CreateResourceCreationAPI( |
| 167 webkit::ppapi::PluginInstance* instance) OVERRIDE; | 169 webkit::ppapi::PluginInstance* instance) OVERRIDE; |
| 168 virtual SkBitmap* GetSadPluginBitmap() OVERRIDE; | 170 virtual SkBitmap* GetSadPluginBitmap() OVERRIDE; |
| 169 virtual WebKit::WebPlugin* CreatePluginReplacement( | 171 virtual WebKit::WebPlugin* CreatePluginReplacement( |
| 170 const FilePath& file_path) OVERRIDE; | 172 const base::FilePath& file_path) OVERRIDE; |
| 171 virtual uint32_t GetAudioHardwareOutputSampleRate() OVERRIDE; | 173 virtual uint32_t GetAudioHardwareOutputSampleRate() OVERRIDE; |
| 172 virtual uint32_t GetAudioHardwareOutputBufferSize() OVERRIDE; | 174 virtual uint32_t GetAudioHardwareOutputBufferSize() OVERRIDE; |
| 173 virtual PlatformAudioOutput* CreateAudioOutput( | 175 virtual PlatformAudioOutput* CreateAudioOutput( |
| 174 uint32_t sample_rate, | 176 uint32_t sample_rate, |
| 175 uint32_t sample_count, | 177 uint32_t sample_count, |
| 176 PlatformAudioOutputClient* client) OVERRIDE; | 178 PlatformAudioOutputClient* client) OVERRIDE; |
| 177 virtual PlatformAudioInput* CreateAudioInput( | 179 virtual PlatformAudioInput* CreateAudioInput( |
| 178 const std::string& device_id, | 180 const std::string& device_id, |
| 179 uint32_t sample_rate, | 181 uint32_t sample_rate, |
| 180 uint32_t sample_count, | 182 uint32_t sample_count, |
| 181 PlatformAudioInputClient* client) OVERRIDE; | 183 PlatformAudioInputClient* client) OVERRIDE; |
| 182 virtual PlatformImage2D* CreateImage2D(int width, int height) OVERRIDE; | 184 virtual PlatformImage2D* CreateImage2D(int width, int height) OVERRIDE; |
| 183 virtual PlatformGraphics2D* GetGraphics2D( | 185 virtual PlatformGraphics2D* GetGraphics2D( |
| 184 webkit::ppapi::PluginInstance* instance, | 186 webkit::ppapi::PluginInstance* instance, |
| 185 PP_Resource resource) OVERRIDE; | 187 PP_Resource resource) OVERRIDE; |
| 186 virtual PlatformContext3D* CreateContext3D() OVERRIDE; | 188 virtual PlatformContext3D* CreateContext3D() OVERRIDE; |
| 187 virtual void ReparentContext(PlatformContext3D*) OVERRIDE; | 189 virtual void ReparentContext(PlatformContext3D*) OVERRIDE; |
| 188 virtual PlatformVideoCapture* CreateVideoCapture( | 190 virtual PlatformVideoCapture* CreateVideoCapture( |
| 189 const std::string& device_id, | 191 const std::string& device_id, |
| 190 PlatformVideoCaptureEventHandler* handler) OVERRIDE; | 192 PlatformVideoCaptureEventHandler* handler) OVERRIDE; |
| 191 virtual PlatformVideoDecoder* CreateVideoDecoder( | 193 virtual PlatformVideoDecoder* CreateVideoDecoder( |
| 192 media::VideoDecodeAccelerator::Client* client, | 194 media::VideoDecodeAccelerator::Client* client, |
| 193 int32 command_buffer_route_id) OVERRIDE; | 195 int32 command_buffer_route_id) OVERRIDE; |
| 194 virtual Broker* ConnectToBroker( | 196 virtual Broker* ConnectToBroker( |
| 195 webkit::ppapi::PPB_Broker_Impl* client) OVERRIDE; | 197 webkit::ppapi::PPB_Broker_Impl* client) OVERRIDE; |
| 196 virtual void NumberOfFindResultsChanged(int identifier, | 198 virtual void NumberOfFindResultsChanged(int identifier, |
| 197 int total, | 199 int total, |
| 198 bool final_result) OVERRIDE; | 200 bool final_result) OVERRIDE; |
| 199 virtual void SelectedFindResultChanged(int identifier, int index) OVERRIDE; | 201 virtual void SelectedFindResultChanged(int identifier, int index) OVERRIDE; |
| 200 virtual bool AsyncOpenFile(const FilePath& path, | 202 virtual bool AsyncOpenFile(const base::FilePath& path, |
| 201 int flags, | 203 int flags, |
| 202 const AsyncOpenFileCallback& callback) OVERRIDE; | 204 const AsyncOpenFileCallback& callback) OVERRIDE; |
| 203 virtual bool AsyncOpenFileSystemURL( | 205 virtual bool AsyncOpenFileSystemURL( |
| 204 const GURL& path, | 206 const GURL& path, |
| 205 int flags, | 207 int flags, |
| 206 const AsyncOpenFileSystemURLCallback& callback) OVERRIDE; | 208 const AsyncOpenFileSystemURLCallback& callback) OVERRIDE; |
| 207 virtual bool OpenFileSystem( | 209 virtual bool OpenFileSystem( |
| 208 const GURL& origin_url, | 210 const GURL& origin_url, |
| 209 fileapi::FileSystemType type, | 211 fileapi::FileSystemType type, |
| 210 long long size, | 212 long long size, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 236 const GURL& directory_path, | 238 const GURL& directory_path, |
| 237 fileapi::FileSystemCallbackDispatcher* dispatcher) OVERRIDE; | 239 fileapi::FileSystemCallbackDispatcher* dispatcher) OVERRIDE; |
| 238 virtual void QueryAvailableSpace( | 240 virtual void QueryAvailableSpace( |
| 239 const GURL& origin, | 241 const GURL& origin, |
| 240 quota::StorageType type, | 242 quota::StorageType type, |
| 241 const AvailableSpaceCallback& callback) OVERRIDE; | 243 const AvailableSpaceCallback& callback) OVERRIDE; |
| 242 virtual void WillUpdateFile(const GURL& file_path) OVERRIDE; | 244 virtual void WillUpdateFile(const GURL& file_path) OVERRIDE; |
| 243 virtual void DidUpdateFile(const GURL& file_path, int64_t delta) OVERRIDE; | 245 virtual void DidUpdateFile(const GURL& file_path, int64_t delta) OVERRIDE; |
| 244 virtual void SyncGetFileSystemPlatformPath( | 246 virtual void SyncGetFileSystemPlatformPath( |
| 245 const GURL& url, | 247 const GURL& url, |
| 246 FilePath* platform_path) OVERRIDE; | 248 base::FilePath* platform_path) OVERRIDE; |
| 247 virtual scoped_refptr<base::MessageLoopProxy> | 249 virtual scoped_refptr<base::MessageLoopProxy> |
| 248 GetFileThreadMessageLoopProxy() OVERRIDE; | 250 GetFileThreadMessageLoopProxy() OVERRIDE; |
| 249 virtual uint32 TCPSocketCreate() OVERRIDE; | 251 virtual uint32 TCPSocketCreate() OVERRIDE; |
| 250 virtual void TCPSocketConnect( | 252 virtual void TCPSocketConnect( |
| 251 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 253 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |
| 252 uint32 socket_id, | 254 uint32 socket_id, |
| 253 const std::string& host, | 255 const std::string& host, |
| 254 uint16_t port) OVERRIDE; | 256 uint16_t port) OVERRIDE; |
| 255 virtual void TCPSocketConnectWithNetAddress( | 257 virtual void TCPSocketConnectWithNetAddress( |
| 256 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 258 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 bool* pepper_plugin_was_registered); | 376 bool* pepper_plugin_was_registered); |
| 375 | 377 |
| 376 // Asynchronously attempts to create a PPAPI broker for the given plugin. | 378 // Asynchronously attempts to create a PPAPI broker for the given plugin. |
| 377 scoped_refptr<PepperBrokerImpl> CreateBroker( | 379 scoped_refptr<PepperBrokerImpl> CreateBroker( |
| 378 webkit::ppapi::PluginModule* plugin_module); | 380 webkit::ppapi::PluginModule* plugin_module); |
| 379 | 381 |
| 380 // Create a new HostDispatcher for proxying, hook it to the PluginModule, | 382 // Create a new HostDispatcher for proxying, hook it to the PluginModule, |
| 381 // and perform other common initialization. | 383 // and perform other common initialization. |
| 382 RendererPpapiHost* CreateOutOfProcessModule( | 384 RendererPpapiHost* CreateOutOfProcessModule( |
| 383 webkit::ppapi::PluginModule* module, | 385 webkit::ppapi::PluginModule* module, |
| 384 const FilePath& path, | 386 const base::FilePath& path, |
| 385 ppapi::PpapiPermissions permissions, | 387 ppapi::PpapiPermissions permissions, |
| 386 const IPC::ChannelHandle& channel_handle, | 388 const IPC::ChannelHandle& channel_handle, |
| 387 base::ProcessId plugin_pid, | 389 base::ProcessId plugin_pid, |
| 388 int plugin_child_id, | 390 int plugin_child_id, |
| 389 bool is_external); | 391 bool is_external); |
| 390 | 392 |
| 391 // Implementation of PepperParentContextProvider. | 393 // Implementation of PepperParentContextProvider. |
| 392 virtual WebGraphicsContext3DCommandBufferImpl* | 394 virtual WebGraphicsContext3DCommandBufferImpl* |
| 393 GetParentContextForPlatformContext3D() OVERRIDE; | 395 GetParentContextForPlatformContext3D() OVERRIDE; |
| 394 | 396 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 | 441 |
| 440 scoped_ptr<PepperDeviceEnumerationEventHandler> | 442 scoped_ptr<PepperDeviceEnumerationEventHandler> |
| 441 device_enumeration_event_handler_; | 443 device_enumeration_event_handler_; |
| 442 | 444 |
| 443 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 445 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
| 444 }; | 446 }; |
| 445 | 447 |
| 446 } // namespace content | 448 } // namespace content |
| 447 | 449 |
| 448 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 450 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |