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/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "content/child/browser_font_resource_trusted.h" | 11 #include "content/child/browser_font_resource_trusted.h" |
12 #include "content/renderer/pepper/pepper_in_process_router.h" | 12 #include "content/renderer/pepper/pepper_in_process_router.h" |
13 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 13 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 14 #include "content/renderer/pepper/ppapi_preferences_builder.h" |
14 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 15 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
15 #include "content/renderer/render_view_impl.h" | 16 #include "content/renderer/render_view_impl.h" |
16 #include "ipc/ipc_message.h" | 17 #include "ipc/ipc_message.h" |
17 #include "ipc/ipc_message_macros.h" | 18 #include "ipc/ipc_message_macros.h" |
18 #include "ppapi/host/ppapi_host.h" | 19 #include "ppapi/host/ppapi_host.h" |
19 #include "ppapi/proxy/file_chooser_resource.h" | 20 #include "ppapi/proxy/file_chooser_resource.h" |
20 #include "ppapi/proxy/file_io_resource.h" | 21 #include "ppapi/proxy/file_io_resource.h" |
21 #include "ppapi/proxy/file_ref_resource.h" | 22 #include "ppapi/proxy/file_ref_resource.h" |
22 #include "ppapi/proxy/file_system_resource.h" | 23 #include "ppapi/proxy/file_system_resource.h" |
23 #include "ppapi/proxy/graphics_2d_resource.h" | 24 #include "ppapi/proxy/graphics_2d_resource.h" |
(...skipping 21 matching lines...) Expand all Loading... |
45 PepperPluginInstanceImpl* instance) | 46 PepperPluginInstanceImpl* instance) |
46 : ResourceCreationImpl(instance), host_impl_(host_impl) {} | 47 : ResourceCreationImpl(instance), host_impl_(host_impl) {} |
47 | 48 |
48 PepperInProcessResourceCreation::~PepperInProcessResourceCreation() {} | 49 PepperInProcessResourceCreation::~PepperInProcessResourceCreation() {} |
49 | 50 |
50 PP_Resource PepperInProcessResourceCreation::CreateBrowserFont( | 51 PP_Resource PepperInProcessResourceCreation::CreateBrowserFont( |
51 PP_Instance instance, | 52 PP_Instance instance, |
52 const PP_BrowserFont_Trusted_Description* description) { | 53 const PP_BrowserFont_Trusted_Description* description) { |
53 if (!BrowserFontResource_Trusted::IsPPFontDescriptionValid(*description)) | 54 if (!BrowserFontResource_Trusted::IsPPFontDescriptionValid(*description)) |
54 return 0; | 55 return 0; |
55 ppapi::Preferences prefs( | 56 ppapi::Preferences prefs(PpapiPreferencesBuilder::Build( |
56 host_impl_->GetRenderViewForInstance(instance)->GetWebkitPreferences()); | 57 host_impl_->GetRenderViewForInstance(instance)->GetWebkitPreferences())); |
57 return (new BrowserFontResource_Trusted( | 58 return (new BrowserFontResource_Trusted( |
58 host_impl_->in_process_router()->GetPluginConnection(instance), | 59 host_impl_->in_process_router()->GetPluginConnection(instance), |
59 instance, | 60 instance, |
60 *description, | 61 *description, |
61 prefs))->GetReference(); | 62 prefs))->GetReference(); |
62 } | 63 } |
63 | 64 |
64 PP_Resource PepperInProcessResourceCreation::CreateFileChooser( | 65 PP_Resource PepperInProcessResourceCreation::CreateFileChooser( |
65 PP_Instance instance, | 66 PP_Instance instance, |
66 PP_FileChooserMode_Dev mode, | 67 PP_FileChooserMode_Dev mode, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 142 } |
142 | 143 |
143 PP_Resource PepperInProcessResourceCreation::CreateWebSocket( | 144 PP_Resource PepperInProcessResourceCreation::CreateWebSocket( |
144 PP_Instance instance) { | 145 PP_Instance instance) { |
145 return (new ppapi::proxy::WebSocketResource( | 146 return (new ppapi::proxy::WebSocketResource( |
146 host_impl_->in_process_router()->GetPluginConnection(instance), | 147 host_impl_->in_process_router()->GetPluginConnection(instance), |
147 instance))->GetReference(); | 148 instance))->GetReference(); |
148 } | 149 } |
149 | 150 |
150 } // namespace content | 151 } // namespace content |
OLD | NEW |