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

Unified Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 534043002: Add bits to indicate which parts of GPUInfo are collected. (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 side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/gpu_data_manager_impl_private.cc
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index fd705c8967ac20837a5d2c6b45f039d7c71b3fa2..f93950e559a2865e4ca56cbd0edb0f8487f7d54d 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -363,7 +363,7 @@ bool GpuDataManagerImplPrivate::GpuAccessAllowed(
}
void GpuDataManagerImplPrivate::RequestCompleteGpuInfoIfNeeded() {
- if (complete_gpu_info_already_requested_ || gpu_info_.finalized)
+ if (complete_gpu_info_already_requested_ || IsCompleteGpuInfoAvailable(true))
return;
complete_gpu_info_already_requested_ = true;
@@ -377,8 +377,16 @@ void GpuDataManagerImplPrivate::RequestCompleteGpuInfoIfNeeded() {
new GpuMsg_CollectGraphicsInfo());
}
-bool GpuDataManagerImplPrivate::IsCompleteGpuInfoAvailable() const {
- return gpu_info_.finalized;
+bool GpuDataManagerImplPrivate::IsCompleteGpuInfoAvailable(
+ bool includes_extra) const {
+ if (gpu_info_.basic_info_state == gpu::kCollectInfoNone ||
+ gpu_info_.context_info_state == gpu::kCollectInfoNone)
+ return false;
+#if defined(OS_WIN)
+ if (gpu_info_.dx_diagnostics_info_state == gpu::kCollectInfoNone)
piman 2014/09/03 00:50:55 did you mean && includes_extra here? Otherwise, i
Zhenyao Mo 2014/09/03 01:31:23 Per estatde's comment, I divide into two functions
+ return false;
+#endif
+ return true;
}
void GpuDataManagerImplPrivate::RequestVideoMemoryUsageStatsUpdate() const {
@@ -503,9 +511,13 @@ void GpuDataManagerImplPrivate::Initialize() {
gpu::CollectBasicGraphicsInfo(&gpu_info);
}
#if defined(ARCH_CPU_X86_FAMILY)
- if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id)
- gpu_info.finalized = true;
-#endif
+ if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) {
+ gpu_info.context_info_state = gpu::kCollectInfoNonFatalFailure;
+#if defined(OS_WIN)
+ gpu_info.dx_diagnostics_info_state = gpu::kCollectInfoNonFatalFailure;
+#endif // OS_WIN
+ }
+#endif // ARCH_CPU_X86_FAMILY
std::string gpu_blacklist_string;
std::string gpu_driver_bug_list_string;
@@ -549,8 +561,8 @@ void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) {
return;
gpu::MergeGPUInfo(&gpu_info_, gpu_info);
- complete_gpu_info_already_requested_ =
- complete_gpu_info_already_requested_ || gpu_info_.finalized;
+ if (IsCompleteGpuInfoAvailable(true))
+ complete_gpu_info_already_requested_ = true;
UpdateGpuInfoHelper();
}
@@ -1073,7 +1085,10 @@ void GpuDataManagerImplPrivate::Notify3DAPIBlocked(const GURL& url,
void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() {
gpu_process_accessible_ = false;
- gpu_info_.finalized = true;
+ gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure;
+#if defined(OS_WIN)
+ gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure;
+#endif
complete_gpu_info_already_requested_ = true;
// Some observers might be waiting.
NotifyGpuInfoUpdate();

Powered by Google App Engine
This is Rietveld 408576698