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/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 #if defined(OS_ANDROID) | 147 #if defined(OS_ANDROID) |
148 #include <cpu-features.h> | 148 #include <cpu-features.h> |
149 | 149 |
150 #include "content/common/gpu/client/context_provider_command_buffer.h" | 150 #include "content/common/gpu/client/context_provider_command_buffer.h" |
151 #include "content/renderer/android/synchronous_compositor_factory.h" | 151 #include "content/renderer/android/synchronous_compositor_factory.h" |
152 #include "content/renderer/java/gin_java_bridge_dispatcher.h" | 152 #include "content/renderer/java/gin_java_bridge_dispatcher.h" |
153 #include "content/renderer/media/android/renderer_media_player_manager.h" | 153 #include "content/renderer/media/android/renderer_media_player_manager.h" |
154 #include "content/renderer/media/android/stream_texture_factory_impl.h" | 154 #include "content/renderer/media/android/stream_texture_factory_impl.h" |
155 #include "content/renderer/media/android/webmediaplayer_android.h" | 155 #include "content/renderer/media/android/webmediaplayer_android.h" |
| 156 #else |
| 157 #include "webkit/common/gpu/context_provider_web_context.h" |
156 #endif | 158 #endif |
157 | 159 |
158 #if defined(ENABLE_PEPPER_CDMS) | 160 #if defined(ENABLE_PEPPER_CDMS) |
159 #include "content/renderer/media/crypto/pepper_cdm_wrapper_impl.h" | 161 #include "content/renderer/media/crypto/pepper_cdm_wrapper_impl.h" |
160 #elif defined(ENABLE_BROWSER_CDMS) | 162 #elif defined(ENABLE_BROWSER_CDMS) |
161 #include "content/renderer/media/crypto/renderer_cdm_manager.h" | 163 #include "content/renderer/media/crypto/renderer_cdm_manager.h" |
162 #endif | 164 #endif |
163 | 165 |
164 using blink::WebContextMenuData; | 166 using blink::WebContextMenuData; |
165 using blink::WebData; | 167 using blink::WebData; |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 extra_data = &kEmptyData; | 469 extra_data = &kEmptyData; |
468 CommonNavigationParams params; | 470 CommonNavigationParams params; |
469 params.url = request->url(); | 471 params.url = request->url(); |
470 params.referrer = Referrer( | 472 params.referrer = Referrer( |
471 GURL(request->httpHeaderField(WebString::fromUTF8("Referer")).latin1()), | 473 GURL(request->httpHeaderField(WebString::fromUTF8("Referer")).latin1()), |
472 request->referrerPolicy()); | 474 request->referrerPolicy()); |
473 params.transition = extra_data->transition_type(); | 475 params.transition = extra_data->transition_type(); |
474 return params; | 476 return params; |
475 } | 477 } |
476 | 478 |
| 479 #if !defined(OS_ANDROID) |
| 480 media::Context3D GetSharedMainThreadContext3D() { |
| 481 cc::ContextProvider* provider = |
| 482 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 483 if (!provider) |
| 484 return media::Context3D(); |
| 485 return media::Context3D(provider->ContextGL(), provider->GrContext()); |
| 486 } |
| 487 #endif |
| 488 |
477 RenderFrameImpl::CreateRenderFrameImplFunction g_create_render_frame_impl = | 489 RenderFrameImpl::CreateRenderFrameImplFunction g_create_render_frame_impl = |
478 nullptr; | 490 nullptr; |
479 | 491 |
480 } // namespace | 492 } // namespace |
481 | 493 |
482 | 494 |
483 // static | 495 // static |
484 RenderFrameImpl* RenderFrameImpl::Create(RenderViewImpl* render_view, | 496 RenderFrameImpl* RenderFrameImpl::Create(RenderViewImpl* render_view, |
485 int32 routing_id) { | 497 int32 routing_id) { |
486 DCHECK(routing_id != MSG_ROUTING_NONE); | 498 DCHECK(routing_id != MSG_ROUTING_NONE); |
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 scoped_refptr<media::MediaLog> media_log(new RenderMediaLog()); | 1807 scoped_refptr<media::MediaLog> media_log(new RenderMediaLog()); |
1796 | 1808 |
1797 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 1809 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
1798 media::WebMediaPlayerParams params( | 1810 media::WebMediaPlayerParams params( |
1799 base::Bind(&ContentRendererClient::DeferMediaLoad, | 1811 base::Bind(&ContentRendererClient::DeferMediaLoad, |
1800 base::Unretained(GetContentClient()->renderer()), | 1812 base::Unretained(GetContentClient()->renderer()), |
1801 static_cast<RenderFrame*>(this)), | 1813 static_cast<RenderFrame*>(this)), |
1802 render_thread->GetAudioRendererMixerManager()->CreateInput( | 1814 render_thread->GetAudioRendererMixerManager()->CreateInput( |
1803 render_view_->routing_id_, routing_id_), | 1815 render_view_->routing_id_, routing_id_), |
1804 media_log, render_thread->GetMediaThreadTaskRunner(), | 1816 media_log, render_thread->GetMediaThreadTaskRunner(), |
1805 render_thread->compositor_message_loop_proxy(), initial_cdm); | 1817 render_thread->compositor_message_loop_proxy(), |
| 1818 base::Bind(&GetSharedMainThreadContext3D), initial_cdm); |
1806 | 1819 |
1807 #if defined(ENABLE_PEPPER_CDMS) | 1820 #if defined(ENABLE_PEPPER_CDMS) |
1808 scoped_ptr<media::CdmFactory> cdm_factory( | 1821 scoped_ptr<media::CdmFactory> cdm_factory( |
1809 new RenderCdmFactory(base::Bind(&PepperCdmWrapperImpl::Create, frame))); | 1822 new RenderCdmFactory(base::Bind(&PepperCdmWrapperImpl::Create, frame))); |
1810 #elif defined(ENABLE_BROWSER_CDMS) | 1823 #elif defined(ENABLE_BROWSER_CDMS) |
1811 scoped_ptr<media::CdmFactory> cdm_factory( | 1824 scoped_ptr<media::CdmFactory> cdm_factory( |
1812 new RenderCdmFactory(GetCdmManager())); | 1825 new RenderCdmFactory(GetCdmManager())); |
1813 #else | 1826 #else |
1814 scoped_ptr<media::CdmFactory> cdm_factory(new RenderCdmFactory()); | 1827 scoped_ptr<media::CdmFactory> cdm_factory(new RenderCdmFactory()); |
1815 #endif | 1828 #endif |
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4315 | 4328 |
4316 #if defined(ENABLE_BROWSER_CDMS) | 4329 #if defined(ENABLE_BROWSER_CDMS) |
4317 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 4330 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
4318 if (!cdm_manager_) | 4331 if (!cdm_manager_) |
4319 cdm_manager_ = new RendererCdmManager(this); | 4332 cdm_manager_ = new RendererCdmManager(this); |
4320 return cdm_manager_; | 4333 return cdm_manager_; |
4321 } | 4334 } |
4322 #endif // defined(ENABLE_BROWSER_CDMS) | 4335 #endif // defined(ENABLE_BROWSER_CDMS) |
4323 | 4336 |
4324 } // namespace content | 4337 } // namespace content |
OLD | NEW |