| 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/content_renderer_pepper_host_factory.h" | 5 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "content/public/common/content_client.h" | 9 #include "content/public/common/content_client.h" |
| 10 #include "content/public/renderer/content_renderer_client.h" | 10 #include "content/public/renderer/content_renderer_client.h" |
| 11 #include "content/renderer/pepper/pepper_audio_input_host.h" | 11 #include "content/renderer/pepper/pepper_audio_input_host.h" |
| 12 #include "content/renderer/pepper/pepper_file_chooser_host.h" | 12 #include "content/renderer/pepper/pepper_file_chooser_host.h" |
| 13 #include "content/renderer/pepper/pepper_file_ref_renderer_host.h" | 13 #include "content/renderer/pepper/pepper_file_ref_renderer_host.h" |
| 14 #include "content/renderer/pepper/pepper_file_system_host.h" | 14 #include "content/renderer/pepper/pepper_file_system_host.h" |
| 15 #include "content/renderer/pepper/pepper_graphics_2d_host.h" | 15 #include "content/renderer/pepper/pepper_graphics_2d_host.h" |
| 16 #include "content/renderer/pepper/pepper_truetype_font_host.h" | 16 #include "content/renderer/pepper/pepper_truetype_font_host.h" |
| 17 #include "content/renderer/pepper/pepper_url_loader_host.h" | 17 #include "content/renderer/pepper/pepper_url_loader_host.h" |
| 18 #include "content/renderer/pepper/pepper_video_capture_host.h" | 18 #include "content/renderer/pepper/pepper_video_capture_host.h" |
| 19 #include "content/renderer/pepper/pepper_video_destination_host.h" | 19 #include "content/renderer/pepper/pepper_video_destination_host.h" |
| 20 #include "content/renderer/pepper/pepper_video_source_host.h" | 20 #include "content/renderer/pepper/pepper_video_source_host.h" |
| 21 #include "content/renderer/pepper/pepper_websocket_host.h" | 21 #include "content/renderer/pepper/pepper_websocket_host.h" |
| 22 #include "content/renderer/pepper/ppb_image_data_impl.h" |
| 22 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 23 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
| 23 #include "ppapi/host/resource_host.h" | 24 #include "ppapi/host/resource_host.h" |
| 24 #include "ppapi/proxy/ppapi_message_utils.h" | 25 #include "ppapi/proxy/ppapi_message_utils.h" |
| 25 #include "ppapi/proxy/ppapi_messages.h" | 26 #include "ppapi/proxy/ppapi_messages.h" |
| 26 #include "ppapi/proxy/serialized_structs.h" | 27 #include "ppapi/proxy/serialized_structs.h" |
| 28 #include "ppapi/shared_impl/ppb_image_data_shared.h" |
| 27 #include "third_party/WebKit/public/platform/WebURL.h" | 29 #include "third_party/WebKit/public/platform/WebURL.h" |
| 28 #include "third_party/WebKit/public/web/WebDocument.h" | 30 #include "third_party/WebKit/public/web/WebDocument.h" |
| 29 #include "third_party/WebKit/public/web/WebElement.h" | 31 #include "third_party/WebKit/public/web/WebElement.h" |
| 30 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 32 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
| 31 | 33 |
| 32 using ppapi::host::ResourceHost; | 34 using ppapi::host::ResourceHost; |
| 33 using ppapi::proxy::SerializedTrueTypeFontDesc; | 35 using ppapi::proxy::SerializedTrueTypeFontDesc; |
| 34 using ppapi::UnpackMessage; | 36 using ppapi::UnpackMessage; |
| 35 | 37 |
| 36 namespace content { | 38 namespace content { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 host_, instance, params.pp_resource(), file_system_type)); | 102 host_, instance, params.pp_resource(), file_system_type)); |
| 101 } | 103 } |
| 102 case PpapiHostMsg_Graphics2D_Create::ID: { | 104 case PpapiHostMsg_Graphics2D_Create::ID: { |
| 103 PP_Size size; | 105 PP_Size size; |
| 104 PP_Bool is_always_opaque; | 106 PP_Bool is_always_opaque; |
| 105 if (!UnpackMessage<PpapiHostMsg_Graphics2D_Create>(message, &size, | 107 if (!UnpackMessage<PpapiHostMsg_Graphics2D_Create>(message, &size, |
| 106 &is_always_opaque)) { | 108 &is_always_opaque)) { |
| 107 NOTREACHED(); | 109 NOTREACHED(); |
| 108 return scoped_ptr<ResourceHost>(); | 110 return scoped_ptr<ResourceHost>(); |
| 109 } | 111 } |
| 112 scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl( |
| 113 instance, ppapi::PPB_ImageData_Shared::PLATFORM)); |
| 110 return scoped_ptr<ResourceHost>( | 114 return scoped_ptr<ResourceHost>( |
| 111 PepperGraphics2DHost::Create(host_, instance, params.pp_resource(), | 115 PepperGraphics2DHost::Create(host_, instance, params.pp_resource(), |
| 112 size, is_always_opaque)); | 116 size, is_always_opaque, image_data)); |
| 113 } | 117 } |
| 114 case PpapiHostMsg_URLLoader_Create::ID: | 118 case PpapiHostMsg_URLLoader_Create::ID: |
| 115 return scoped_ptr<ResourceHost>(new PepperURLLoaderHost( | 119 return scoped_ptr<ResourceHost>(new PepperURLLoaderHost( |
| 116 host_, false, instance, params.pp_resource())); | 120 host_, false, instance, params.pp_resource())); |
| 117 case PpapiHostMsg_WebSocket_Create::ID: | 121 case PpapiHostMsg_WebSocket_Create::ID: |
| 118 return scoped_ptr<ResourceHost>(new PepperWebSocketHost( | 122 return scoped_ptr<ResourceHost>(new PepperWebSocketHost( |
| 119 host_, instance, params.pp_resource())); | 123 host_, instance, params.pp_resource())); |
| 120 #if defined(ENABLE_WEBRTC) | 124 #if defined(ENABLE_WEBRTC) |
| 121 // These private MediaStream interfaces are exposed as if they were public | 125 // These private MediaStream interfaces are exposed as if they were public |
| 122 // so they can be used by NaCl plugins. However, they are available only | 126 // so they can be used by NaCl plugins. However, they are available only |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 174 |
| 171 return scoped_ptr<ResourceHost>(); | 175 return scoped_ptr<ResourceHost>(); |
| 172 } | 176 } |
| 173 | 177 |
| 174 const ppapi::PpapiPermissions& | 178 const ppapi::PpapiPermissions& |
| 175 ContentRendererPepperHostFactory::GetPermissions() const { | 179 ContentRendererPepperHostFactory::GetPermissions() const { |
| 176 return host_->GetPpapiHost()->permissions(); | 180 return host_->GetPpapiHost()->permissions(); |
| 177 } | 181 } |
| 178 | 182 |
| 179 } // namespace content | 183 } // namespace content |
| OLD | NEW |