Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 508293003: Change media MessageLoopProxy usage to SingleThreadTaskRunners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 idle_notifications_to_skip_ = 2; 1101 idle_notifications_to_skip_ = 2;
1102 } 1102 }
1103 1103
1104 scoped_refptr<media::GpuVideoAcceleratorFactories> 1104 scoped_refptr<media::GpuVideoAcceleratorFactories>
1105 RenderThreadImpl::GetGpuFactories() { 1105 RenderThreadImpl::GetGpuFactories() {
1106 DCHECK(IsMainThread()); 1106 DCHECK(IsMainThread());
1107 1107
1108 scoped_refptr<GpuChannelHost> gpu_channel_host = GetGpuChannel(); 1108 scoped_refptr<GpuChannelHost> gpu_channel_host = GetGpuChannel();
1109 const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); 1109 const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
1110 scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories; 1110 scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories;
1111 scoped_refptr<base::MessageLoopProxy> media_loop_proxy = 1111 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner =
1112 GetMediaThreadMessageLoopProxy(); 1112 GetMediaThreadTaskRunner();
1113 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) { 1113 if (!cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) {
1114 if (!gpu_va_context_provider_.get() || 1114 if (!gpu_va_context_provider_.get() ||
1115 gpu_va_context_provider_->DestroyedOnMainThread()) { 1115 gpu_va_context_provider_->DestroyedOnMainThread()) {
1116 if (!gpu_channel_host.get()) { 1116 if (!gpu_channel_host.get()) {
1117 gpu_channel_host = EstablishGpuChannelSync( 1117 gpu_channel_host = EstablishGpuChannelSync(
1118 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ E); 1118 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ E);
1119 } 1119 }
1120 blink::WebGraphicsContext3D::Attributes attributes; 1120 blink::WebGraphicsContext3D::Attributes attributes;
1121 bool lose_context_when_out_of_memory = false; 1121 bool lose_context_when_out_of_memory = false;
1122 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( 1122 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create(
1123 make_scoped_ptr( 1123 make_scoped_ptr(
1124 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( 1124 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
1125 gpu_channel_host.get(), 1125 gpu_channel_host.get(),
1126 attributes, 1126 attributes,
1127 lose_context_when_out_of_memory, 1127 lose_context_when_out_of_memory,
1128 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), 1128 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"),
1129 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), 1129 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(),
1130 NULL)), 1130 NULL)),
1131 "GPU-VideoAccelerator-Offscreen"); 1131 "GPU-VideoAccelerator-Offscreen");
1132 } 1132 }
1133 } 1133 }
1134 if (gpu_va_context_provider_.get()) { 1134 if (gpu_va_context_provider_.get()) {
1135 gpu_factories = RendererGpuVideoAcceleratorFactories::Create( 1135 gpu_factories = RendererGpuVideoAcceleratorFactories::Create(
1136 gpu_channel_host.get(), media_loop_proxy, gpu_va_context_provider_); 1136 gpu_channel_host.get(), media_task_runner, gpu_va_context_provider_);
1137 } 1137 }
1138 return gpu_factories; 1138 return gpu_factories;
1139 } 1139 }
1140 1140
1141 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> 1141 scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
1142 RenderThreadImpl::CreateOffscreenContext3d() { 1142 RenderThreadImpl::CreateOffscreenContext3d() {
1143 blink::WebGraphicsContext3D::Attributes attributes(GetOffscreenAttribs()); 1143 blink::WebGraphicsContext3D::Attributes attributes(GetOffscreenAttribs());
1144 bool lose_context_when_out_of_memory = true; 1144 bool lose_context_when_out_of_memory = true;
1145 1145
1146 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( 1146 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync(
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1581 scoped_refptr<base::MessageLoopProxy> 1581 scoped_refptr<base::MessageLoopProxy>
1582 RenderThreadImpl::GetFileThreadMessageLoopProxy() { 1582 RenderThreadImpl::GetFileThreadMessageLoopProxy() {
1583 DCHECK(message_loop() == base::MessageLoop::current()); 1583 DCHECK(message_loop() == base::MessageLoop::current());
1584 if (!file_thread_) { 1584 if (!file_thread_) {
1585 file_thread_.reset(new base::Thread("Renderer::FILE")); 1585 file_thread_.reset(new base::Thread("Renderer::FILE"));
1586 file_thread_->Start(); 1586 file_thread_->Start();
1587 } 1587 }
1588 return file_thread_->message_loop_proxy(); 1588 return file_thread_->message_loop_proxy();
1589 } 1589 }
1590 1590
1591 scoped_refptr<base::MessageLoopProxy> 1591 scoped_refptr<base::SingleThreadTaskRunner>
1592 RenderThreadImpl::GetMediaThreadMessageLoopProxy() { 1592 RenderThreadImpl::GetMediaThreadTaskRunner() {
1593 DCHECK(message_loop() == base::MessageLoop::current()); 1593 DCHECK(message_loop() == base::MessageLoop::current());
1594 if (!media_thread_) { 1594 if (!media_thread_) {
1595 media_thread_.reset(new base::Thread("Media")); 1595 media_thread_.reset(new base::Thread("Media"));
1596 media_thread_->Start(); 1596 media_thread_->Start();
1597 1597
1598 #if defined(OS_ANDROID) 1598 #if defined(OS_ANDROID)
1599 renderer_demuxer_ = new RendererDemuxerAndroid(); 1599 renderer_demuxer_ = new RendererDemuxerAndroid();
1600 AddFilter(renderer_demuxer_.get()); 1600 AddFilter(renderer_demuxer_.get());
1601 #endif 1601 #endif
1602 } 1602 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 hidden_widget_count_--; 1644 hidden_widget_count_--;
1645 1645
1646 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1646 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1647 return; 1647 return;
1648 } 1648 }
1649 1649
1650 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1650 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1651 } 1651 }
1652 1652
1653 } // namespace content 1653 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698