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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 class RenderView; | 42 class RenderView; |
43 | 43 |
44 // Interface that allows components in the embedder app to talk to the | 44 // Interface that allows components in the embedder app to talk to the |
45 // PpapiHost in the renderer process. | 45 // PpapiHost in the renderer process. |
46 // | 46 // |
47 // There will be one of these objects in the renderer per plugin module. | 47 // There will be one of these objects in the renderer per plugin module. |
48 class RendererPpapiHost { | 48 class RendererPpapiHost { |
49 public: | 49 public: |
50 // Returns the RendererPpapiHost associated with the given PP_Instance, | 50 // Returns the RendererPpapiHost associated with the given PP_Instance, |
51 // or NULL if the instance is invalid. | 51 // or NULL if the instance is invalid. |
| 52 // |
| 53 // Do NOT use this when dealing with an "external plugin" that serves as a |
| 54 // bootstrap to load a second plugin. This is because the two will share a |
| 55 // PP_Instance, and the RendererPpapiHost* for the second plugin will be |
| 56 // returned after we switch the proxy on. |
52 CONTENT_EXPORT static RendererPpapiHost* GetForPPInstance( | 57 CONTENT_EXPORT static RendererPpapiHost* GetForPPInstance( |
53 PP_Instance instance); | 58 PP_Instance instance); |
54 | 59 |
55 // Returns the PpapiHost object. | 60 // Returns the PpapiHost object. |
56 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; | 61 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; |
57 | 62 |
58 // Returns true if the given PP_Instance is valid and belongs to the | 63 // Returns true if the given PP_Instance is valid and belongs to the |
59 // plugin associated with this host. | 64 // plugin associated with this host. |
60 virtual bool IsValidInstance(PP_Instance instance) const = 0; | 65 virtual bool IsValidInstance(PP_Instance instance) const = 0; |
61 | 66 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 const std::vector<IPC::Message>& nested_msgs, | 128 const std::vector<IPC::Message>& nested_msgs, |
124 const base::Callback<void(const std::vector<int>&)>& callback) const = 0; | 129 const base::Callback<void(const std::vector<int>&)>& callback) const = 0; |
125 | 130 |
126 protected: | 131 protected: |
127 virtual ~RendererPpapiHost() {} | 132 virtual ~RendererPpapiHost() {} |
128 }; | 133 }; |
129 | 134 |
130 } // namespace content | 135 } // namespace content |
131 | 136 |
132 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 137 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
OLD | NEW |