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 "base/platform_file.h" |
10 #include "base/process.h" | 10 #include "base/process.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "ipc/ipc_platform_file.h" | 12 #include "ipc/ipc_platform_file.h" |
13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
14 #include "webkit/plugins/ppapi/plugin_delegate.h" | 14 #include "webkit/plugins/ppapi/plugin_delegate.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class FilePath; | 17 class FilePath; |
18 } | 18 } |
19 | 19 |
20 namespace gfx { | 20 namespace gfx { |
21 class Point; | 21 class Point; |
22 } | 22 } |
23 | 23 |
24 namespace IPC { | 24 namespace IPC { |
25 struct ChannelHandle; | |
26 class Message; | 25 class Message; |
27 } | 26 } |
28 | 27 |
29 namespace ppapi { | 28 namespace ppapi { |
30 class PpapiPermissions; | |
31 namespace host { | 29 namespace host { |
32 class PpapiHost; | 30 class PpapiHost; |
33 } | 31 } |
34 } | 32 } |
35 | 33 |
36 namespace WebKit { | 34 namespace WebKit { |
37 class WebPluginContainer; | 35 class WebPluginContainer; |
38 } | 36 } |
39 | 37 |
40 namespace webkit { | 38 namespace webkit { |
41 namespace ppapi { | 39 namespace ppapi { |
42 class PluginInstance; | 40 class PluginInstance; |
43 class PluginModule; | 41 class PluginModule; |
44 } | 42 } |
45 } | 43 } |
46 | 44 |
47 namespace content { | 45 namespace content { |
48 | 46 |
49 class RenderView; | 47 class RenderView; |
50 | 48 |
51 // Interface that allows components in the embedder app to talk to the | 49 // Interface that allows components in the embedder app to talk to the |
52 // PpapiHost in the renderer process. | 50 // PpapiHost in the renderer process. |
53 // | 51 // |
54 // There will be one of these objects in the renderer per plugin module. | 52 // There will be one of these objects in the renderer per plugin module. |
55 class RendererPpapiHost { | 53 class RendererPpapiHost { |
56 public: | 54 public: |
57 // Creates a host and sets up an out-of-process proxy for an external plugin | |
58 // module. |file_path| should identify the module. It is only used to report | |
59 // failures to the renderer. | |
60 // Returns a host if the external module is proxied successfully, otherwise | |
61 // returns NULL. | |
62 CONTENT_EXPORT static RendererPpapiHost* CreateExternalPluginModule( | |
63 scoped_refptr<webkit::ppapi::PluginModule> plugin_module, | |
64 webkit::ppapi::PluginInstance* plugin_instance, | |
65 const base::FilePath& file_path, | |
66 ppapi::PpapiPermissions permissions, | |
67 const IPC::ChannelHandle& channel_handle, | |
68 base::ProcessId plugin_pid, | |
69 int plugin_child_id); | |
70 | |
71 // Returns the RendererPpapiHost associated with the given PP_Instance, | 55 // Returns the RendererPpapiHost associated with the given PP_Instance, |
72 // or NULL if the instance is invalid. | 56 // or NULL if the instance is invalid. |
73 CONTENT_EXPORT static RendererPpapiHost* GetForPPInstance( | 57 CONTENT_EXPORT static RendererPpapiHost* GetForPPInstance( |
74 PP_Instance instance); | 58 PP_Instance instance); |
75 | 59 |
76 // Returns the PpapiHost object. | 60 // Returns the PpapiHost object. |
77 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; | 61 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; |
78 | 62 |
79 // 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 |
80 // plugin associated with this host. | 64 // plugin associated with this host. |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 const IPC::Message& nested_msg, | 128 const IPC::Message& nested_msg, |
145 const base::Callback<void(int)>& callback) const = 0; | 129 const base::Callback<void(int)>& callback) const = 0; |
146 | 130 |
147 protected: | 131 protected: |
148 virtual ~RendererPpapiHost() {} | 132 virtual ~RendererPpapiHost() {} |
149 }; | 133 }; |
150 | 134 |
151 } // namespace content | 135 } // namespace content |
152 | 136 |
153 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 137 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
OLD | NEW |