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 #include "content/renderer/pepper/pepper_in_process_resource_creation.h" | 5 #include "content/renderer/pepper/pepper_in_process_resource_creation.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "content/renderer/render_view_impl.h" | 10 #include "content/renderer/render_view_impl.h" |
11 #include "content/renderer/pepper/pepper_in_process_router.h" | 11 #include "content/renderer/pepper/pepper_in_process_router.h" |
12 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 12 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
13 #include "ipc/ipc_message.h" | 13 #include "ipc/ipc_message.h" |
14 #include "ipc/ipc_message_macros.h" | 14 #include "ipc/ipc_message_macros.h" |
15 #include "ppapi/host/ppapi_host.h" | 15 #include "ppapi/host/ppapi_host.h" |
16 #include "ppapi/proxy/file_chooser_resource.h" | 16 #include "ppapi/proxy/file_chooser_resource.h" |
| 17 #include "ppapi/proxy/graphics_2d_resource.h" |
17 #include "ppapi/proxy/ppapi_messages.h" | 18 #include "ppapi/proxy/ppapi_messages.h" |
18 #include "ppapi/proxy/printing_resource.h" | 19 #include "ppapi/proxy/printing_resource.h" |
19 #include "ppapi/proxy/url_request_info_resource.h" | 20 #include "ppapi/proxy/url_request_info_resource.h" |
20 #include "ppapi/shared_impl/ppapi_globals.h" | 21 #include "ppapi/shared_impl/ppapi_globals.h" |
21 #include "ppapi/shared_impl/ppapi_permissions.h" | 22 #include "ppapi/shared_impl/ppapi_permissions.h" |
22 #include "ppapi/shared_impl/resource_tracker.h" | 23 #include "ppapi/shared_impl/resource_tracker.h" |
23 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 24 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
24 | 25 |
25 // Note that the code in the creation functions in this file should generally | 26 // Note that the code in the creation functions in this file should generally |
26 // be the same as that in ppapi/proxy/resource_creation_proxy.cc. See | 27 // be the same as that in ppapi/proxy/resource_creation_proxy.cc. See |
(...skipping 15 matching lines...) Expand all Loading... |
42 | 43 |
43 PP_Resource PepperInProcessResourceCreation::CreateFileChooser( | 44 PP_Resource PepperInProcessResourceCreation::CreateFileChooser( |
44 PP_Instance instance, | 45 PP_Instance instance, |
45 PP_FileChooserMode_Dev mode, | 46 PP_FileChooserMode_Dev mode, |
46 const char* accept_types) { | 47 const char* accept_types) { |
47 return (new ppapi::proxy::FileChooserResource( | 48 return (new ppapi::proxy::FileChooserResource( |
48 host_impl_->in_process_router()->GetPluginConnection(), | 49 host_impl_->in_process_router()->GetPluginConnection(), |
49 instance, mode, accept_types))->GetReference(); | 50 instance, mode, accept_types))->GetReference(); |
50 } | 51 } |
51 | 52 |
| 53 PP_Resource PepperInProcessResourceCreation::CreateGraphics2D( |
| 54 PP_Instance instance, |
| 55 const PP_Size& size, |
| 56 PP_Bool is_always_opaque) { |
| 57 ppapi::proxy::Graphics2DResource* res = |
| 58 ppapi::proxy::Graphics2DResource::Create( |
| 59 host_impl_->in_process_router()->GetPluginConnection(), |
| 60 instance, size, is_always_opaque); |
| 61 return res ? res->GetReference() : 0; |
| 62 } |
| 63 |
52 PP_Resource PepperInProcessResourceCreation::CreatePrinting( | 64 PP_Resource PepperInProcessResourceCreation::CreatePrinting( |
53 PP_Instance instance) { | 65 PP_Instance instance) { |
54 return (new ppapi::proxy::PrintingResource( | 66 return (new ppapi::proxy::PrintingResource( |
55 host_impl_->in_process_router()->GetPluginConnection(), | 67 host_impl_->in_process_router()->GetPluginConnection(), |
56 instance))->GetReference(); | 68 instance))->GetReference(); |
57 } | 69 } |
58 | 70 |
59 PP_Resource PepperInProcessResourceCreation::CreateURLRequestInfo( | 71 PP_Resource PepperInProcessResourceCreation::CreateURLRequestInfo( |
60 PP_Instance instance, | 72 PP_Instance instance, |
61 const ::ppapi::URLRequestInfoData& data) { | 73 const ::ppapi::URLRequestInfoData& data) { |
62 return (new ppapi::proxy::URLRequestInfoResource( | 74 return (new ppapi::proxy::URLRequestInfoResource( |
63 host_impl_->in_process_router()->GetPluginConnection(), | 75 host_impl_->in_process_router()->GetPluginConnection(), |
64 instance, data))->GetReference(); | 76 instance, data))->GetReference(); |
65 } | 77 } |
66 | 78 |
67 } // namespace content | 79 } // namespace content |
OLD | NEW |