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_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
6 #define CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/platform_file.h" |
9 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "ipc/ipc_platform_file.h" |
10 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
11 | 13 |
12 class FilePath; | 14 class FilePath; |
13 | 15 |
14 namespace IPC { | 16 namespace IPC { |
15 struct ChannelHandle; | 17 struct ChannelHandle; |
16 } | 18 } |
17 | 19 |
18 namespace ppapi { | 20 namespace ppapi { |
19 class PpapiPermissions; | 21 class PpapiPermissions; |
20 namespace host { | 22 namespace host { |
21 class PpapiHost; | 23 class PpapiHost; |
22 } | 24 } |
23 } | 25 } |
24 | 26 |
| 27 namespace webkit { |
| 28 namespace ppapi { |
| 29 class PluginInstance; |
| 30 } |
| 31 } |
| 32 |
25 namespace WebKit { | 33 namespace WebKit { |
26 class WebPluginContainer; | 34 class WebPluginContainer; |
27 } | 35 } |
28 | 36 |
29 namespace webkit { | 37 namespace webkit { |
30 namespace ppapi { | 38 namespace ppapi { |
31 class PluginInstance; | 39 class PluginInstance; |
32 class PluginModule; | 40 class PluginModule; |
33 } | 41 } |
34 } | 42 } |
(...skipping 21 matching lines...) Expand all Loading... |
56 const IPC::ChannelHandle& channel_handle, | 64 const IPC::ChannelHandle& channel_handle, |
57 int plugin_child_id); | 65 int plugin_child_id); |
58 | 66 |
59 // Returns the PpapiHost object. | 67 // Returns the PpapiHost object. |
60 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; | 68 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; |
61 | 69 |
62 // Returns true if the given PP_Instance is valid and belongs to the | 70 // Returns true if the given PP_Instance is valid and belongs to the |
63 // plugin associated with this host. | 71 // plugin associated with this host. |
64 virtual bool IsValidInstance(PP_Instance instance) const = 0; | 72 virtual bool IsValidInstance(PP_Instance instance) const = 0; |
65 | 73 |
| 74 // Returns the PluginInstance for the given PP_Instance, or NULL if the |
| 75 // PP_Instance is invalid. |
| 76 virtual webkit::ppapi::PluginInstance* GetPluginInstance( |
| 77 PP_Instance instance) const = 0; |
| 78 |
66 // Returns the RenderView for the given plugin instance, or NULL if the | 79 // Returns the RenderView for the given plugin instance, or NULL if the |
67 // instance is invalid. | 80 // instance is invalid. |
68 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; | 81 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; |
69 | 82 |
70 // Returns the WebPluginContainer for the given plugin instance, or NULL if | 83 // Returns the WebPluginContainer for the given plugin instance, or NULL if |
71 // the instance is invalid. | 84 // the instance is invalid. |
72 virtual WebKit::WebPluginContainer* GetContainerForInstance( | 85 virtual WebKit::WebPluginContainer* GetContainerForInstance( |
73 PP_Instance instance) const = 0; | 86 PP_Instance instance) const = 0; |
74 | 87 |
75 // Returns true if the given instance is considered to be currently | 88 // Returns true if the given instance is considered to be currently |
76 // processing a user gesture or the plugin module has the "override user | 89 // processing a user gesture or the plugin module has the "override user |
77 // gesture" flag set (in which case it can always do things normally | 90 // gesture" flag set (in which case it can always do things normally |
78 // restricted by user gestures). Returns false if the instance is invalid or | 91 // restricted by user gestures). Returns false if the instance is invalid or |
79 // if there is no current user gesture. | 92 // if there is no current user gesture. |
80 virtual bool HasUserGesture(PP_Instance instance) const = 0; | 93 virtual bool HasUserGesture(PP_Instance instance) const = 0; |
81 | 94 |
| 95 // Shares a file handle (HANDLE / file descriptor) with the remote side. It |
| 96 // returns a handle that should be sent in exactly one IPC message. Upon |
| 97 // receipt, the remote side then owns that handle. Note: if sending the |
| 98 // message fails, the returned handle is properly closed by the IPC system. If |
| 99 // |should_close_source| is set to true, the original handle is closed by this |
| 100 // operation and should not be used again. |
| 101 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( |
| 102 base::PlatformFile handle, |
| 103 bool should_close_source) = 0; |
| 104 |
82 protected: | 105 protected: |
83 virtual ~RendererPpapiHost() {} | 106 virtual ~RendererPpapiHost() {} |
84 }; | 107 }; |
85 | 108 |
86 } // namespace content | 109 } // namespace content |
87 | 110 |
88 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 111 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
89 | 112 |
OLD | NEW |