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

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 6 years 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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 return in_process_context.release(); 972 return in_process_context.release();
973 } 973 }
974 #endif 974 #endif
975 975
976 scoped_refptr<GpuChannelHost> gpu_channel_host( 976 scoped_refptr<GpuChannelHost> gpu_channel_host(
977 RenderThreadImpl::current()->EstablishGpuChannelSync( 977 RenderThreadImpl::current()->EstablishGpuChannelSync(
978 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) ); 978 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) );
979 979
980 if (gpu_channel_host.get() && gl_info) { 980 if (gpu_channel_host.get() && gl_info) {
981 const gpu::GPUInfo& gpu_info = gpu_channel_host->gpu_info(); 981 const gpu::GPUInfo& gpu_info = gpu_channel_host->gpu_info();
982 gl_info->vendorInfo.assign(blink::WebString::fromUTF8(gpu_info.gl_vendor)); 982 switch (gpu_info.context_info_state) {
983 gl_info->rendererInfo.assign( 983 case gpu::kCollectInfoSuccess:
984 blink::WebString::fromUTF8(gpu_info.gl_renderer)); 984 case gpu::kCollectInfoNonFatalFailure:
985 gl_info->driverVersion.assign( 985 gl_info->vendorInfo.assign(
986 blink::WebString::fromUTF8(gpu_info.gl_version)); 986 blink::WebString::fromUTF8(gpu_info.gl_vendor));
987 gl_info->rendererInfo.assign(
988 blink::WebString::fromUTF8(gpu_info.gl_renderer));
989 gl_info->driverVersion.assign(
990 blink::WebString::fromUTF8(gpu_info.gl_version));
991 break;
992 case gpu::kCollectInfoFatalFailure:
993 gl_info->contextInfoCollectionFailure.assign(blink::WebString::fromUTF8(
994 "GPUInfoCollectionFailure: GPU initialization Failed. GPU"
Ken Russell (switch to Gerrit) 2014/12/16 23:55:47 Needs space at the end of this string for when it'
sivag 2014/12/17 10:40:43 Done.
995 "Info not Collected"));
996 break;
997 default:
998 NOTREACHED();
999 };
987 } 1000 }
988 1001
989 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; 1002 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits;
990 bool lose_context_when_out_of_memory = false; 1003 bool lose_context_when_out_of_memory = false;
991 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( 1004 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
992 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( 1005 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext(
993 gpu_channel_host.get(), 1006 gpu_channel_host.get(),
994 attributes, 1007 attributes,
995 lose_context_when_out_of_memory, 1008 lose_context_when_out_of_memory,
996 GURL(attributes.topDocumentURL), 1009 GURL(attributes.topDocumentURL),
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1221 //------------------------------------------------------------------------------ 1234 //------------------------------------------------------------------------------
1222 1235
1223 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting( 1236 void RendererBlinkPlatformImpl::MockBatteryStatusChangedForTesting(
1224 const blink::WebBatteryStatus& status) { 1237 const blink::WebBatteryStatus& status) {
1225 if (!g_test_battery_status_listener) 1238 if (!g_test_battery_status_listener)
1226 return; 1239 return;
1227 g_test_battery_status_listener->updateBatteryStatus(status); 1240 g_test_battery_status_listener->updateBatteryStatus(status);
1228 } 1241 }
1229 1242
1230 } // namespace content 1243 } // 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