| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
| 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/platform_file.h" | 11 #include "base/platform_file.h" |
| 12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 13 #include "base/shared_memory.h" | 13 #include "base/shared_memory.h" |
| 14 #include "base/sync_socket.h" | 14 #include "base/sync_socket.h" |
| 15 #include "gfx/size.h" | 15 #include "gfx/size.h" |
| 16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
| 17 #include "ppapi/c/pp_completion_callback.h" | 17 #include "ppapi/c/pp_completion_callback.h" |
| 18 #include "ppapi/c/pp_errors.h" | 18 #include "ppapi/c/pp_errors.h" |
| 19 #include "ppapi/c/pp_instance.h" | 19 #include "ppapi/c/pp_instance.h" |
| 20 #include "ppapi/c/pp_stdint.h" | 20 #include "ppapi/c/pp_stdint.h" |
| 21 #include "webkit/fileapi/file_system_types.h" | 21 #include "webkit/fileapi/file_system_types.h" |
| 22 #include "webkit/glue/plugins/pepper_dir_contents.h" | 22 #include "webkit/plugins/ppapi/dir_contents.h" |
| 23 | 23 |
| 24 class AudioMessageFilter; | 24 class AudioMessageFilter; |
| 25 class GURL; | 25 class GURL; |
| 26 | 26 |
| 27 namespace base { | 27 namespace base { |
| 28 class MessageLoopProxy; | 28 class MessageLoopProxy; |
| 29 class Time; | 29 class Time; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace fileapi { | 32 namespace fileapi { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 51 class WebFileChooserCompletion; | 51 class WebFileChooserCompletion; |
| 52 struct WebFileChooserParams; | 52 struct WebFileChooserParams; |
| 53 } | 53 } |
| 54 | 54 |
| 55 struct PP_VideoCompressedDataBuffer_Dev; | 55 struct PP_VideoCompressedDataBuffer_Dev; |
| 56 struct PP_VideoDecoderConfig_Dev; | 56 struct PP_VideoDecoderConfig_Dev; |
| 57 struct PP_VideoUncompressedDataBuffer_Dev; | 57 struct PP_VideoUncompressedDataBuffer_Dev; |
| 58 | 58 |
| 59 class TransportDIB; | 59 class TransportDIB; |
| 60 | 60 |
| 61 namespace pepper { | 61 namespace webkit { |
| 62 namespace plugins { |
| 63 namespace ppapi { |
| 62 | 64 |
| 63 class FileIO; | 65 class FileIO; |
| 64 class PluginInstance; | 66 class PluginInstance; |
| 65 class FullscreenContainer; | 67 class FullscreenContainer; |
| 66 | 68 |
| 67 // Virtual interface that the browser implements to implement features for | 69 // Virtual interface that the browser implements to implement features for |
| 68 // Pepper plugins. | 70 // PPAPI plugins. |
| 69 class PluginDelegate { | 71 class PluginDelegate { |
| 70 public: | 72 public: |
| 71 // This class is implemented by the PluginDelegate implementation and is | 73 // This class is implemented by the PluginDelegate implementation and is |
| 72 // designed to manage the lifetime and communicatin with the proxy's | 74 // designed to manage the lifetime and communicatin with the proxy's |
| 73 // HostDispatcher for out-of-process pepper plugins. | 75 // HostDispatcher for out-of-process PPAPI plugins. |
| 74 // | 76 // |
| 75 // The point of this is to avoid having a relationship from the pepper plugin | 77 // The point of this is to avoid having a relationship from the PPAPI plugin |
| 76 // implementation to the ppapi proxy code. Otherwise, things like the IPC | 78 // implementation to the ppapi proxy code. Otherwise, things like the IPC |
| 77 // system will be dependencies of the webkit directory, which we don't want. | 79 // system will be dependencies of the webkit directory, which we don't want. |
| 78 // | 80 // |
| 79 // The PluginModule will scope the lifetime of this object to its own | 81 // The PluginModule will scope the lifetime of this object to its own |
| 80 // lifetime, so the implementation can use this to manage the HostDispatcher | 82 // lifetime, so the implementation can use this to manage the HostDispatcher |
| 81 // lifetime without introducing the dependency. | 83 // lifetime without introducing the dependency. |
| 82 class OutOfProcessProxy { | 84 class OutOfProcessProxy { |
| 83 public: | 85 public: |
| 84 virtual ~OutOfProcessProxy() {} | 86 virtual ~OutOfProcessProxy() {} |
| 85 | 87 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 virtual ~PlatformVideoDecoder() {} | 183 virtual ~PlatformVideoDecoder() {} |
| 182 | 184 |
| 183 // Returns false on failure. | 185 // Returns false on failure. |
| 184 virtual bool Decode(PP_VideoCompressedDataBuffer_Dev& input_buffer) = 0; | 186 virtual bool Decode(PP_VideoCompressedDataBuffer_Dev& input_buffer) = 0; |
| 185 virtual int32_t Flush(PP_CompletionCallback& callback) = 0; | 187 virtual int32_t Flush(PP_CompletionCallback& callback) = 0; |
| 186 virtual bool ReturnUncompressedDataBuffer( | 188 virtual bool ReturnUncompressedDataBuffer( |
| 187 PP_VideoUncompressedDataBuffer_Dev& buffer) = 0; | 189 PP_VideoUncompressedDataBuffer_Dev& buffer) = 0; |
| 188 }; | 190 }; |
| 189 | 191 |
| 190 // Indicates that the given instance has been created. | 192 // Indicates that the given instance has been created. |
| 191 virtual void InstanceCreated(pepper::PluginInstance* instance) = 0; | 193 virtual void InstanceCreated(PluginInstance* instance) = 0; |
| 192 | 194 |
| 193 // Indicates that the given instance is being destroyed. This is called from | 195 // Indicates that the given instance is being destroyed. This is called from |
| 194 // the destructor, so it's important that the instance is not dereferenced | 196 // the destructor, so it's important that the instance is not dereferenced |
| 195 // from this call. | 197 // from this call. |
| 196 virtual void InstanceDeleted(pepper::PluginInstance* instance) = 0; | 198 virtual void InstanceDeleted(PluginInstance* instance) = 0; |
| 197 | 199 |
| 198 // The caller will own the pointer returned from this. | 200 // The caller will own the pointer returned from this. |
| 199 virtual PlatformImage2D* CreateImage2D(int width, int height) = 0; | 201 virtual PlatformImage2D* CreateImage2D(int width, int height) = 0; |
| 200 | 202 |
| 201 // The caller will own the pointer returned from this. | 203 // The caller will own the pointer returned from this. |
| 202 virtual PlatformContext3D* CreateContext3D() = 0; | 204 virtual PlatformContext3D* CreateContext3D() = 0; |
| 203 | 205 |
| 204 // The caller will own the pointer returned from this. | 206 // The caller will own the pointer returned from this. |
| 205 virtual PlatformVideoDecoder* CreateVideoDecoder( | 207 virtual PlatformVideoDecoder* CreateVideoDecoder( |
| 206 const PP_VideoDecoderConfig_Dev& decoder_config) = 0; | 208 const PP_VideoDecoderConfig_Dev& decoder_config) = 0; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 virtual base::PlatformFileError CreateModuleLocalDir( | 271 virtual base::PlatformFileError CreateModuleLocalDir( |
| 270 const std::string& module_name, | 272 const std::string& module_name, |
| 271 const FilePath& path) = 0; | 273 const FilePath& path) = 0; |
| 272 virtual base::PlatformFileError QueryModuleLocalFile( | 274 virtual base::PlatformFileError QueryModuleLocalFile( |
| 273 const std::string& module_name, | 275 const std::string& module_name, |
| 274 const FilePath& path, | 276 const FilePath& path, |
| 275 base::PlatformFileInfo* info) = 0; | 277 base::PlatformFileInfo* info) = 0; |
| 276 virtual base::PlatformFileError GetModuleLocalDirContents( | 278 virtual base::PlatformFileError GetModuleLocalDirContents( |
| 277 const std::string& module_name, | 279 const std::string& module_name, |
| 278 const FilePath& path, | 280 const FilePath& path, |
| 279 PepperDirContents* contents) = 0; | 281 DirContents* contents) = 0; |
| 280 | 282 |
| 281 // Returns a MessageLoopProxy instance associated with the message loop | 283 // Returns a MessageLoopProxy instance associated with the message loop |
| 282 // of the file thread in this renderer. | 284 // of the file thread in this renderer. |
| 283 virtual scoped_refptr<base::MessageLoopProxy> | 285 virtual scoped_refptr<base::MessageLoopProxy> |
| 284 GetFileThreadMessageLoopProxy() = 0; | 286 GetFileThreadMessageLoopProxy() = 0; |
| 285 | 287 |
| 286 // Create a fullscreen container for a plugin instance. This effectively | 288 // Create a fullscreen container for a plugin instance. This effectively |
| 287 // switches the plugin to fullscreen. | 289 // switches the plugin to fullscreen. |
| 288 virtual FullscreenContainer* CreateFullscreenContainer( | 290 virtual FullscreenContainer* CreateFullscreenContainer( |
| 289 PluginInstance* instance) = 0; | 291 PluginInstance* instance) = 0; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 300 virtual std::string ResolveProxy(const GURL& url) = 0; | 302 virtual std::string ResolveProxy(const GURL& url) = 0; |
| 301 | 303 |
| 302 // Tell the browser when resource loading starts/ends. | 304 // Tell the browser when resource loading starts/ends. |
| 303 virtual void DidStartLoading() = 0; | 305 virtual void DidStartLoading() = 0; |
| 304 virtual void DidStopLoading() = 0; | 306 virtual void DidStopLoading() = 0; |
| 305 | 307 |
| 306 // Sets restrictions on how the content can be used (i.e. no print/copy). | 308 // Sets restrictions on how the content can be used (i.e. no print/copy). |
| 307 virtual void SetContentRestriction(int restrictions) = 0; | 309 virtual void SetContentRestriction(int restrictions) = 0; |
| 308 }; | 310 }; |
| 309 | 311 |
| 310 } // namespace pepper | 312 } // namespace ppapi |
| 313 } // namespace plugins |
| 314 } // namespace webkit |
| 311 | 315 |
| 312 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ | 316 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
| OLD | NEW |