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