| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/resource_converter.h" | 5 #include "content/renderer/pepper/resource_converter.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "content/public/renderer/renderer_ppapi_host.h" | 11 #include "content/public/renderer/renderer_ppapi_host.h" |
| 12 #include "content/renderer/pepper/pepper_file_system_host.h" | 12 #include "content/renderer/pepper/pepper_file_system_host.h" |
| 13 #include "content/renderer/pepper/pepper_media_stream_audio_track_host.h" | 13 #include "content/renderer/pepper/pepper_media_stream_audio_track_host.h" |
| 14 #include "content/renderer/pepper/pepper_media_stream_video_track_host.h" | 14 #include "content/renderer/pepper/pepper_media_stream_video_track_host.h" |
| 15 #include "ipc/ipc_message.h" | 15 #include "ipc/ipc_message.h" |
| 16 #include "media/media_features.h" |
| 16 #include "ppapi/host/ppapi_host.h" | 17 #include "ppapi/host/ppapi_host.h" |
| 17 #include "ppapi/host/resource_host.h" | 18 #include "ppapi/host/resource_host.h" |
| 18 #include "ppapi/proxy/ppapi_messages.h" | 19 #include "ppapi/proxy/ppapi_messages.h" |
| 19 #include "ppapi/shared_impl/resource_var.h" | 20 #include "ppapi/shared_impl/resource_var.h" |
| 20 #include "ppapi/shared_impl/scoped_pp_var.h" | 21 #include "ppapi/shared_impl/scoped_pp_var.h" |
| 21 #include "storage/common/fileapi/file_system_util.h" | 22 #include "storage/common/fileapi/file_system_util.h" |
| 22 #include "third_party/WebKit/public/platform/WebFileSystem.h" | 23 #include "third_party/WebKit/public/platform/WebFileSystem.h" |
| 23 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 24 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
| 24 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 25 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 25 #include "third_party/WebKit/public/web/WebDOMFileSystem.h" | 26 #include "third_party/WebKit/public/web/WebDOMFileSystem.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 160 } |
| 160 | 161 |
| 161 bool DOMMediaStreamTrackToResource( | 162 bool DOMMediaStreamTrackToResource( |
| 162 PP_Instance instance, | 163 PP_Instance instance, |
| 163 RendererPpapiHost* host, | 164 RendererPpapiHost* host, |
| 164 const blink::WebDOMMediaStreamTrack& dom_media_stream_track, | 165 const blink::WebDOMMediaStreamTrack& dom_media_stream_track, |
| 165 int* pending_renderer_id, | 166 int* pending_renderer_id, |
| 166 std::unique_ptr<IPC::Message>* create_message) { | 167 std::unique_ptr<IPC::Message>* create_message) { |
| 167 DCHECK(!dom_media_stream_track.isNull()); | 168 DCHECK(!dom_media_stream_track.isNull()); |
| 168 *pending_renderer_id = 0; | 169 *pending_renderer_id = 0; |
| 169 #if defined(ENABLE_WEBRTC) | 170 #if BUILDFLAG(ENABLE_WEBRTC) |
| 170 const blink::WebMediaStreamTrack track = dom_media_stream_track.component(); | 171 const blink::WebMediaStreamTrack track = dom_media_stream_track.component(); |
| 171 const std::string id = track.source().id().utf8(); | 172 const std::string id = track.source().id().utf8(); |
| 172 | 173 |
| 173 if (track.source().getType() == blink::WebMediaStreamSource::TypeVideo) { | 174 if (track.source().getType() == blink::WebMediaStreamSource::TypeVideo) { |
| 174 *pending_renderer_id = host->GetPpapiHost()->AddPendingResourceHost( | 175 *pending_renderer_id = host->GetPpapiHost()->AddPendingResourceHost( |
| 175 std::unique_ptr<ppapi::host::ResourceHost>( | 176 std::unique_ptr<ppapi::host::ResourceHost>( |
| 176 new PepperMediaStreamVideoTrackHost(host, instance, 0, track))); | 177 new PepperMediaStreamVideoTrackHost(host, instance, 0, track))); |
| 177 if (*pending_renderer_id == 0) | 178 if (*pending_renderer_id == 0) |
| 178 return false; | 179 return false; |
| 179 | 180 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 const IPC::Message& create_message, | 348 const IPC::Message& create_message, |
| 348 const IPC::Message& browser_host_create_message) { | 349 const IPC::Message& browser_host_create_message) { |
| 349 scoped_refptr<HostResourceVar> result = | 350 scoped_refptr<HostResourceVar> result = |
| 350 CreateResourceVar(pending_renderer_id, create_message); | 351 CreateResourceVar(pending_renderer_id, create_message); |
| 351 browser_host_create_messages_.push_back(browser_host_create_message); | 352 browser_host_create_messages_.push_back(browser_host_create_message); |
| 352 browser_vars_.push_back(result); | 353 browser_vars_.push_back(result); |
| 353 return result; | 354 return result; |
| 354 } | 355 } |
| 355 | 356 |
| 356 } // namespace content | 357 } // namespace content |
| OLD | NEW |