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

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

Issue 1246783003: Check that |gpu_channel_host_| is not NULL before passing it along. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
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 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 1420
1421 scoped_refptr<GpuChannelHost> gpu_channel_host = GetGpuChannel(); 1421 scoped_refptr<GpuChannelHost> gpu_channel_host = GetGpuChannel();
1422 scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories; 1422 scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories;
1423 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner = 1423 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner =
1424 GetMediaThreadTaskRunner(); 1424 GetMediaThreadTaskRunner();
1425 if (!gpu_va_context_provider_.get() || 1425 if (!gpu_va_context_provider_.get() ||
1426 gpu_va_context_provider_->DestroyedOnMainThread()) { 1426 gpu_va_context_provider_->DestroyedOnMainThread()) {
1427 if (!gpu_channel_host.get()) { 1427 if (!gpu_channel_host.get()) {
1428 gpu_channel_host = EstablishGpuChannelSync( 1428 gpu_channel_host = EstablishGpuChannelSync(
1429 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) ; 1429 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) ;
1430 } 1430 }
Pawel Osciak 2015/07/21 00:15:00 Should we be checking gpu_channel_host again here?
sandersd (OOO until July 31) 2015/07/21 00:35:01 Both WebGraphicsContext3DCommandBufferImpl::Create
1431 blink::WebGraphicsContext3D::Attributes attributes; 1431 blink::WebGraphicsContext3D::Attributes attributes;
1432 bool lose_context_when_out_of_memory = false; 1432 bool lose_context_when_out_of_memory = false;
1433 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( 1433 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create(
1434 make_scoped_ptr( 1434 make_scoped_ptr(
1435 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( 1435 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
1436 gpu_channel_host.get(), attributes, 1436 gpu_channel_host.get(), attributes,
1437 lose_context_when_out_of_memory, 1437 lose_context_when_out_of_memory,
1438 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), 1438 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"),
1439 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), 1439 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(),
1440 NULL)), 1440 NULL)),
1441 GPU_VIDEO_ACCELERATOR_CONTEXT); 1441 GPU_VIDEO_ACCELERATOR_CONTEXT);
1442 } 1442 }
1443 if (gpu_va_context_provider_.get()) { 1443 if (gpu_va_context_provider_.get()) {
1444 bool enable_video_accelerator = 1444 bool enable_video_accelerator =
1445 !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); 1445 !cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode);
1446 std::string image_texture_target_string = 1446 std::string image_texture_target_string =
1447 cmd_line->GetSwitchValueASCII(switches::kContentImageTextureTarget); 1447 cmd_line->GetSwitchValueASCII(switches::kContentImageTextureTarget);
1448 unsigned image_texture_target = 0; 1448 unsigned image_texture_target = 0;
1449 bool parsed_image_texture_target = 1449 bool parsed_image_texture_target =
1450 base::StringToUint(image_texture_target_string, &image_texture_target); 1450 base::StringToUint(image_texture_target_string, &image_texture_target);
1451 DCHECK(parsed_image_texture_target); 1451 DCHECK(parsed_image_texture_target);
1452 CHECK(gpu_channel_host.get());
jochen (gone - plz use gerrit) 2015/07/21 14:12:58 please add a comment pointing at the crbug, and co
sandersd (OOO until July 31) 2015/07/21 17:29:57 Done.
1452 gpu_factories = RendererGpuVideoAcceleratorFactories::Create( 1453 gpu_factories = RendererGpuVideoAcceleratorFactories::Create(
1453 gpu_channel_host.get(), media_task_runner, gpu_va_context_provider_, 1454 gpu_channel_host.get(), media_task_runner, gpu_va_context_provider_,
1454 image_texture_target, enable_video_accelerator); 1455 image_texture_target, enable_video_accelerator);
1455 } 1456 }
1456 return gpu_factories; 1457 return gpu_factories;
1457 } 1458 }
1458 1459
1459 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> 1460 scoped_ptr<WebGraphicsContext3DCommandBufferImpl>
1460 RenderThreadImpl::CreateOffscreenContext3d() { 1461 RenderThreadImpl::CreateOffscreenContext3d() {
1461 blink::WebGraphicsContext3D::Attributes attributes(GetOffscreenAttribs()); 1462 blink::WebGraphicsContext3D::Attributes attributes(GetOffscreenAttribs());
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 } 2034 }
2034 2035
2035 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { 2036 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() {
2036 size_t erased = 2037 size_t erased =
2037 RenderThreadImpl::current()->pending_render_frame_connects_.erase( 2038 RenderThreadImpl::current()->pending_render_frame_connects_.erase(
2038 routing_id_); 2039 routing_id_);
2039 DCHECK_EQ(1u, erased); 2040 DCHECK_EQ(1u, erased);
2040 } 2041 }
2041 2042
2042 } // namespace content 2043 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698