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_RENDERER_PEPPER_PEPPER_IN_PROCESS_RESOURCE_CREATION_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_IN_PROCESS_RESOURCE_CREATION_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_IN_PROCESS_RESOURCE_CREATION_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_IN_PROCESS_RESOURCE_CREATION_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "webkit/plugins/ppapi/resource_creation_impl.h" | 10 #include "webkit/plugins/ppapi/resource_creation_impl.h" |
11 | 11 |
12 class RenderViewImpl; | 12 class RenderViewImpl; |
13 | 13 |
| 14 namespace ppapi { |
| 15 class PpapiPermissions; |
| 16 } |
| 17 |
14 namespace content { | 18 namespace content { |
15 | 19 |
16 // This class provides creation functions for the new resources with IPC | 20 // This class provides creation functions for the new resources with IPC |
17 // backends that live in content/renderer/pepper. | 21 // backends that live in content/renderer/pepper. |
18 // | 22 // |
19 // This is a bit confusing. The "old-style" resources live in | 23 // This is a bit confusing. The "old-style" resources live in |
20 // webkit/plugins/ppapi and are created by the ResourceCreationImpl in that | 24 // webkit/plugins/ppapi and are created by the ResourceCreationImpl in that |
21 // directory. The "new-style" IPC-only resources are in ppapi/proxy and are | 25 // directory. The "new-style" IPC-only resources are in ppapi/proxy and are |
22 // created by the RessourceCreationProxy in that directory. | 26 // created by the RessourceCreationProxy in that directory. |
23 // | 27 // |
24 // This class allows us to run new-style IPC-only resources in-process. We have | 28 // This class allows us to run new-style IPC-only resources in-process. We have |
25 // an IPC reflector to run it in process. But then we have a problem with | 29 // an IPC reflector to run it in process. But then we have a problem with |
26 // allocating the resources since src/webkit can't depend on IPC or see our IPC | 30 // allocating the resources since src/webkit can't depend on IPC or see our IPC |
27 // backend in content. This class overrides the normal in-process resource | 31 // backend in content. This class overrides the normal in-process resource |
28 // creation and adds in the resources that we implement in ppapi/proxy. | 32 // creation and adds in the resources that we implement in ppapi/proxy. |
29 // | 33 // |
30 // When we convert all resources to use the new-style, we can just use the | 34 // When we convert all resources to use the new-style, we can just use the |
31 // ResourceCreationProxy for all resources. This class is just glue to manage | 35 // ResourceCreationProxy for all resources. This class is just glue to manage |
32 // the temporary "two different cases." | 36 // the temporary "two different cases." |
33 class PepperInProcessResourceCreation | 37 class PepperInProcessResourceCreation |
34 : public webkit::ppapi::ResourceCreationImpl { | 38 : public webkit::ppapi::ResourceCreationImpl { |
35 public: | 39 public: |
36 PepperInProcessResourceCreation(RenderViewImpl* render_view, | 40 PepperInProcessResourceCreation(RenderViewImpl* render_view, |
37 webkit::ppapi::PluginInstance* instance); | 41 webkit::ppapi::PluginInstance* instance, |
| 42 const ppapi::PpapiPermissions& perms); |
38 virtual ~PepperInProcessResourceCreation(); | 43 virtual ~PepperInProcessResourceCreation(); |
39 | 44 |
40 private: | 45 private: |
41 class HostToPluginRouter; | 46 class HostToPluginRouter; |
42 scoped_ptr<HostToPluginRouter> host_to_plugin_router_; | 47 scoped_ptr<HostToPluginRouter> host_to_plugin_router_; |
43 | 48 |
44 class PluginToHostRouter; | 49 class PluginToHostRouter; |
45 scoped_ptr<PluginToHostRouter> plugin_to_host_router_; | 50 scoped_ptr<PluginToHostRouter> plugin_to_host_router_; |
46 | 51 |
47 DISALLOW_COPY_AND_ASSIGN(PepperInProcessResourceCreation); | 52 DISALLOW_COPY_AND_ASSIGN(PepperInProcessResourceCreation); |
48 }; | 53 }; |
49 | 54 |
50 } // namespace content | 55 } // namespace content |
51 | 56 |
52 #endif // CONTENT_RENDERER_PEPPER_PEPPER_IN_PROCESS_RESOURCE_CREATION_H_ | 57 #endif // CONTENT_RENDERER_PEPPER_PEPPER_IN_PROCESS_RESOURCE_CREATION_H_ |
OLD | NEW |