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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 class PpapiHost; | 33 class PpapiHost; |
34 } | 34 } |
35 } | 35 } |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 class WebPluginContainer; | 38 class WebPluginContainer; |
39 } | 39 } |
40 | 40 |
41 namespace content { | 41 namespace content { |
42 class PepperPluginInstance; | 42 class PepperPluginInstance; |
| 43 class RenderFrame; |
43 class RenderView; | 44 class RenderView; |
44 | 45 |
45 // Interface that allows components in the embedder app to talk to the | 46 // Interface that allows components in the embedder app to talk to the |
46 // PpapiHost in the renderer process. | 47 // PpapiHost in the renderer process. |
47 // | 48 // |
48 // There will be one of these objects in the renderer per plugin module. | 49 // There will be one of these objects in the renderer per plugin module. |
49 class RendererPpapiHost { | 50 class RendererPpapiHost { |
50 public: | 51 public: |
51 // Returns the RendererPpapiHost associated with the given PP_Instance, | 52 // Returns the RendererPpapiHost associated with the given PP_Instance, |
52 // or NULL if the instance is invalid. | 53 // or NULL if the instance is invalid. |
(...skipping 11 matching lines...) Expand all Loading... |
64 // Returns true if the given PP_Instance is valid and belongs to the | 65 // Returns true if the given PP_Instance is valid and belongs to the |
65 // plugin associated with this host. | 66 // plugin associated with this host. |
66 virtual bool IsValidInstance(PP_Instance instance) const = 0; | 67 virtual bool IsValidInstance(PP_Instance instance) const = 0; |
67 | 68 |
68 // Returns the PluginInstance for the given PP_Instance, or NULL if the | 69 // Returns the PluginInstance for the given PP_Instance, or NULL if the |
69 // PP_Instance is invalid (the common case this will be invalid is during | 70 // PP_Instance is invalid (the common case this will be invalid is during |
70 // plugin teardown when resource hosts are being force-freed). | 71 // plugin teardown when resource hosts are being force-freed). |
71 virtual PepperPluginInstance* GetPluginInstance( | 72 virtual PepperPluginInstance* GetPluginInstance( |
72 PP_Instance instance) const = 0; | 73 PP_Instance instance) const = 0; |
73 | 74 |
| 75 // Returns the RenderFrame for the given plugin instance, or NULL if the |
| 76 // instance is invalid. |
| 77 virtual RenderFrame* GetRenderFrameForInstance( |
| 78 PP_Instance instance) const = 0; |
| 79 |
74 // Returns the RenderView for the given plugin instance, or NULL if the | 80 // Returns the RenderView for the given plugin instance, or NULL if the |
75 // instance is invalid. | 81 // instance is invalid. |
76 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; | 82 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; |
77 | 83 |
78 // Returns the WebPluginContainer for the given plugin instance, or NULL if | 84 // Returns the WebPluginContainer for the given plugin instance, or NULL if |
79 // the instance is invalid. | 85 // the instance is invalid. |
80 virtual blink::WebPluginContainer* GetContainerForInstance( | 86 virtual blink::WebPluginContainer* GetContainerForInstance( |
81 PP_Instance instance) const = 0; | 87 PP_Instance instance) const = 0; |
82 | 88 |
83 // Returns the PID of the child process containing the plugin. If running | 89 // Returns the PID of the child process containing the plugin. If running |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // interface. Consider changing them to static helpers. | 142 // interface. Consider changing them to static helpers. |
137 virtual GURL GetDocumentURL(PP_Instance instance) const = 0; | 143 virtual GURL GetDocumentURL(PP_Instance instance) const = 0; |
138 | 144 |
139 protected: | 145 protected: |
140 virtual ~RendererPpapiHost() {} | 146 virtual ~RendererPpapiHost() {} |
141 }; | 147 }; |
142 | 148 |
143 } // namespace content | 149 } // namespace content |
144 | 150 |
145 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 151 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
OLD | NEW |