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

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

Issue 800483002: Handle failures for GPU info collection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | 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/renderer_blink_platform_impl.h" 5 #include "content/renderer/renderer_blink_platform_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 return in_process_context.release(); 973 return in_process_context.release();
974 } 974 }
975 #endif 975 #endif
976 976
977 scoped_refptr<GpuChannelHost> gpu_channel_host( 977 scoped_refptr<GpuChannelHost> gpu_channel_host(
978 RenderThreadImpl::current()->EstablishGpuChannelSync( 978 RenderThreadImpl::current()->EstablishGpuChannelSync(
979 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) ); 979 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) );
980 980
981 if (gpu_channel_host.get() && gl_info) { 981 if (gpu_channel_host.get() && gl_info) {
982 const gpu::GPUInfo& gpu_info = gpu_channel_host->gpu_info(); 982 const gpu::GPUInfo& gpu_info = gpu_channel_host->gpu_info();
983 gl_info->vendorInfo.assign(blink::WebString::fromUTF8(gpu_info.gl_vendor)); 983 switch (gpu_info.context_info_state) {
984 gl_info->rendererInfo.assign( 984 case gpu::kCollectInfoSuccess:
985 blink::WebString::fromUTF8(gpu_info.gl_renderer)); 985 case gpu::kCollectInfoNonFatalFailure:
986 gl_info->driverVersion.assign( 986 gl_info->vendorInfo.assign(
987 blink::WebString::fromUTF8(gpu_info.gl_version)); 987 blink::WebString::fromUTF8(gpu_info.gl_vendor));
988 gl_info->rendererInfo.assign(
989 blink::WebString::fromUTF8(gpu_info.gl_renderer));
990 gl_info->driverVersion.assign(
991 blink::WebString::fromUTF8(gpu_info.gl_version));
Zhenyao Mo 2014/12/30 18:39:45 Note that gpu_info.gl_version and gpu_info.driver_
sivag 2014/12/31 10:08:44 Done.
992 gl_info->vendorId = gpu_info.gpu.vendor_id;
993 gl_info->deviceId = gpu_info.gpu.device_id;
994 break;
995 case gpu::kCollectInfoFatalFailure:
996 gl_info->contextInfoCollectionFailure.assign(blink::WebString::fromUTF8(
997 "GPUInfoCollectionFailure: GPU initialization Failed. GPU "
998 "Info not Collected."));
999 break;
1000 default:
1001 NOTREACHED();
1002 };
988 } 1003 }
989 1004
990 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; 1005 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits;
991 bool lose_context_when_out_of_memory = false; 1006 bool lose_context_when_out_of_memory = false;
992 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( 1007 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
993 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( 1008 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
994 gpu_channel_host.get(), 1009 gpu_channel_host.get(),
995 attributes, 1010 attributes,
996 lose_context_when_out_of_memory, 1011 lose_context_when_out_of_memory,
997 GURL(attributes.topDocumentURL), 1012 GURL(attributes.topDocumentURL),
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 //------------------------------------------------------------------------------ 1239 //------------------------------------------------------------------------------
1225 1240
1226 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( 1241 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting(
1227 const blink::WebBatteryStatus& status) { 1242 const blink::WebBatteryStatus& status) {
1228 if (!g_test_battery_status_listener) 1243 if (!g_test_battery_status_listener)
1229 return; 1244 return;
1230 g_test_battery_status_listener->updateBatteryStatus(status); 1245 g_test_battery_status_listener->updateBatteryStatus(status);
1231 } 1246 }
1232 1247
1233 } // namespace content 1248 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698