summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-27 18:55:34 +0000
committerzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-27 18:55:34 +0000
commite2f8f8ade4fed8722823bf6afb9077763ddb8309 (patch)
tree195a97a5a6bccc727d2d692cf8f6082ca9efc42e
parent021bd23df4e9193cf4d6efa1e1dbc8cd638af7da (diff)
downloadchromium_src-e2f8f8ade4fed8722823bf6afb9077763ddb8309.zip
chromium_src-e2f8f8ade4fed8722823bf6afb9077763ddb8309.tar.gz
chromium_src-e2f8f8ade4fed8722823bf6afb9077763ddb8309.tar.bz2
Make sure if GPU process fails to launch, all observers waiting for full gpu info get a response.
BUG=174296 TEST=AutofillRiskFingerprintTest.GetFingerprint Review URL: https://codereview.chromium.org/12335100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184995 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.cc18
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.h5
-rw-r--r--content/browser/gpu/gpu_process_host.cc2
-rw-r--r--content/common/gpu/gpu_messages.h1
-rw-r--r--content/gpu/gpu_info_collector.cc1
-rw-r--r--content/gpu/gpu_main.cc3
-rw-r--r--content/public/common/gpu_info.cc1
-rw-r--r--content/public/common/gpu_info.h3
8 files changed, 23 insertions, 11 deletions
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index 834bf55..098ab732 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -136,7 +136,7 @@ bool GpuDataManagerImpl::GpuAccessAllowed() const {
if (software_rendering_)
return true;
- if (!gpu_info_.gpu_accessible)
+ if (!gpu_process_accessible_)
return false;
if (card_blacklisted_)
@@ -592,7 +592,8 @@ GpuDataManagerImpl::GpuDataManagerImpl()
card_blacklisted_(false),
update_histograms_(true),
window_count_(0),
- domain_blocking_enabled_(true) {
+ domain_blocking_enabled_(true),
+ gpu_process_accessible_(true) {
CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kDisableAcceleratedCompositing)) {
command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas);
@@ -803,4 +804,17 @@ void GpuDataManagerImpl::Notify3DAPIBlocked(const GURL& url,
url, render_process_id, render_view_id, requester);
}
+void GpuDataManagerImpl::OnGpuProcessInitFailure() {
+ gpu_process_accessible_ = false;
+
+ GPUInfo gpu_info;
+ {
+ base::AutoLock auto_lock(gpu_info_lock_);
+ gpu_info = gpu_info_;
+ }
+ gpu_info.finalized = true;
+ // Need to call UpdateGpuInfo() - some observers might be waiting.
+ UpdateGpuInfo(gpu_info);
+}
+
} // namespace content
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
index c862ab0..edcfacd 100644
--- a/content/browser/gpu/gpu_data_manager_impl.h
+++ b/content/browser/gpu/gpu_data_manager_impl.h
@@ -155,6 +155,9 @@ class CONTENT_EXPORT GpuDataManagerImpl
// Disables domain blocking for 3D APIs. For use only in tests.
void DisableDomainBlockingFor3DAPIsForTesting();
+ // Called when GPU process initialization failed.
+ void OnGpuProcessInitFailure();
+
private:
struct DomainBlockEntry {
DomainGuilt last_guilt;
@@ -263,6 +266,8 @@ class CONTENT_EXPORT GpuDataManagerImpl
mutable std::list<base::Time> timestamps_of_gpu_resets_;
bool domain_blocking_enabled_;
+ bool gpu_process_accessible_;
+
DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl);
};
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 6b22dc0..61b10b21 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -654,6 +654,8 @@ void GpuProcessHost::DeleteImage(int client_id,
void GpuProcessHost::OnInitialized(bool result) {
UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessInitialized", result);
+ if (!result)
+ GpuDataManagerImpl::GetInstance()->OnGpuProcessInitFailure();
}
void GpuProcessHost::OnChannelEstablished(
diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h
index 687340c..3bcd377 100644
--- a/content/common/gpu/gpu_messages.h
+++ b/content/common/gpu/gpu_messages.h
@@ -146,7 +146,6 @@ IPC_STRUCT_TRAITS_BEGIN(content::GPUInfo)
IPC_STRUCT_TRAITS_MEMBER(gl_renderer)
IPC_STRUCT_TRAITS_MEMBER(gl_extensions)
IPC_STRUCT_TRAITS_MEMBER(can_lose_context)
- IPC_STRUCT_TRAITS_MEMBER(gpu_accessible)
IPC_STRUCT_TRAITS_MEMBER(performance_stats)
IPC_STRUCT_TRAITS_MEMBER(software_rendering)
IPC_STRUCT_TRAITS_MEMBER(sandboxed)
diff --git a/content/gpu/gpu_info_collector.cc b/content/gpu/gpu_info_collector.cc
index 86fb0c5..756c23f 100644
--- a/content/gpu/gpu_info_collector.cc
+++ b/content/gpu/gpu_info_collector.cc
@@ -129,7 +129,6 @@ void MergeGPUInfoGL(content::GPUInfo* basic_gpu_info,
basic_gpu_info->can_lose_context = context_gpu_info.can_lose_context;
basic_gpu_info->sandboxed = context_gpu_info.sandboxed;
- basic_gpu_info->gpu_accessible = context_gpu_info.gpu_accessible;
basic_gpu_info->finalized = context_gpu_info.finalized;
basic_gpu_info->initialization_time = context_gpu_info.initialization_time;
}
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index ffb90fe..37828f4 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -195,15 +195,12 @@ int GpuMain(const MainFunctionParams& parameters) {
base::ThreadRestrictions::AssertIOAllowed();
if (access("/dev/nvidiactl", R_OK) != 0) {
VLOG(1) << "NVIDIA device file /dev/nvidiactl access denied";
- gpu_info.gpu_accessible = false;
dead_on_arrival = true;
}
}
#endif // OS_CHROMEOS
} else {
VLOG(1) << "gfx::GLSurface::InitializeOneOff failed";
- gpu_info.gpu_accessible = false;
- gpu_info.finalized = true;
dead_on_arrival = true;
}
diff --git a/content/public/common/gpu_info.cc b/content/public/common/gpu_info.cc
index 130732f..4db16a9 100644
--- a/content/public/common/gpu_info.cc
+++ b/content/public/common/gpu_info.cc
@@ -18,7 +18,6 @@ GPUInfo::GPUInfo()
optimus(false),
amd_switchable(false),
can_lose_context(false),
- gpu_accessible(true),
software_rendering(false),
sandboxed(false) {
}
diff --git a/content/public/common/gpu_info.h b/content/public/common/gpu_info.h
index da6fcfa..454fdef 100644
--- a/content/public/common/gpu_info.h
+++ b/content/public/common/gpu_info.h
@@ -100,9 +100,6 @@ struct CONTENT_EXPORT GPUInfo {
// semantics are available.
bool can_lose_context;
- // Whether gpu or driver is accessible.
- bool gpu_accessible;
-
// By default all values are 0.
GpuPerformanceStats performance_stats;