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_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ |
6 #define WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ |
7 | 7 |
8 #include "third_party/ppapi/c/pp_stdint.h" | 8 #include "third_party/ppapi/c/pp_stdint.h" |
9 | 9 |
10 namespace skia { | 10 namespace skia { |
11 class PlatformCanvas; | 11 class PlatformCanvas; |
12 } | 12 } |
13 | 13 |
14 namespace pepper { | 14 namespace pepper { |
15 | 15 |
| 16 class PluginInstance; |
| 17 |
16 // Virtual interface that the browser implements to implement features for | 18 // Virtual interface that the browser implements to implement features for |
17 // Pepper plugins. | 19 // Pepper plugins. |
18 class PluginDelegate { | 20 class PluginDelegate { |
19 public: | 21 public: |
20 // Represents an image. This is to allow the browser layer to supply a correct | 22 // Represents an image. This is to allow the browser layer to supply a correct |
21 // image representation. In Chrome, this will be a TransportDIB. | 23 // image representation. In Chrome, this will be a TransportDIB. |
22 class PlatformImage2D { | 24 class PlatformImage2D { |
23 public: | 25 public: |
24 virtual ~PlatformImage2D() {} | 26 virtual ~PlatformImage2D() {} |
25 | 27 |
26 // Caller will own the returned pointer, returns NULL on failure. | 28 // Caller will own the returned pointer, returns NULL on failure. |
27 virtual skia::PlatformCanvas* Map() = 0; | 29 virtual skia::PlatformCanvas* Map() = 0; |
28 | 30 |
29 // Returns the platform-specific shared memory handle of the data backing | 31 // Returns the platform-specific shared memory handle of the data backing |
30 // this image. This is used by NativeClient to send the image to the | 32 // this image. This is used by NativeClient to send the image to the |
31 // out-of-process plugin. Returns 0 on failure. | 33 // out-of-process plugin. Returns 0 on failure. |
32 virtual intptr_t GetSharedMemoryHandle() const = 0; | 34 virtual intptr_t GetSharedMemoryHandle() const = 0; |
33 }; | 35 }; |
34 | 36 |
| 37 // Indicates that the given instance has been created. |
| 38 virtual void InstanceCreated(pepper::PluginInstance* instance) = 0; |
| 39 |
| 40 // Indicates that the given instance is being destroyed. This is called from |
| 41 // the destructor, so it's important that the instance is not dereferenced |
| 42 // from this call. |
| 43 virtual void InstanceDeleted(pepper::PluginInstance* instance) = 0; |
| 44 |
35 // The caller will own the pointer returned from this. | 45 // The caller will own the pointer returned from this. |
36 virtual PlatformImage2D* CreateImage2D(int width, int height) = 0; | 46 virtual PlatformImage2D* CreateImage2D(int width, int height) = 0; |
37 }; | 47 }; |
38 | 48 |
39 } // namespace pepper | 49 } // namespace pepper |
40 | 50 |
41 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ | 51 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_PLUGIN_DELEGATE_H_ |
OLD | NEW |