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

Unified Diff: chrome/browser/gpu_process_host.cc

Issue 6094009: Perform GPU-related initialization in GPU process in response to an... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gpu_process_host.h ('k') | chrome/common/gpu_messages_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gpu_process_host.cc
===================================================================
--- chrome/browser/gpu_process_host.cc (revision 70570)
+++ chrome/browser/gpu_process_host.cc (working copy)
@@ -97,6 +97,9 @@
if (!initialized_) {
initialized_ = true;
initialized_successfully_ = Init();
+ if (initialized_successfully_) {
+ Send(new GpuMsg_Initialize());
+ }
}
return initialized_successfully_;
}
@@ -228,10 +231,13 @@
}
void GpuProcessHost::OnSynchronizeReply() {
- const SynchronizationRequest& request =
- queued_synchronization_replies_.front();
- SendSynchronizationReply(request.reply, request.filter);
- queued_synchronization_replies_.pop();
+ // Guard against race conditions in abrupt GPU process termination.
+ if (queued_synchronization_replies_.size() > 0) {
+ const SynchronizationRequest& request =
+ queued_synchronization_replies_.front();
+ SendSynchronizationReply(request.reply, request.filter);
+ queued_synchronization_replies_.pop();
+ }
}
#if defined(OS_LINUX)
@@ -480,11 +486,26 @@
filter->Send(reply);
}
+void GpuProcessHost::SendOutstandingReplies() {
+ // First send empty channel handles for all EstablishChannel requests.
+ while (!sent_requests_.empty()) {
+ const ChannelRequest& request = sent_requests_.front();
+ SendEstablishChannelReply(IPC::ChannelHandle(), GPUInfo(), request.filter);
+ sent_requests_.pop();
+ }
+
+ // Now unblock all renderers waiting for synchronization replies.
+ while (!queued_synchronization_replies_.empty()) {
+ OnSynchronizeReply();
+ }
+}
+
bool GpuProcessHost::CanShutdown() {
return true;
}
void GpuProcessHost::OnChildDied() {
+ SendOutstandingReplies();
// Located in OnChildDied because OnProcessCrashed suffers from a race
// condition on Linux. The GPU process will only die if it crashes.
UMA_HISTOGRAM_ENUMERATION("GPU.GPUProcessLifetimeEvents",
@@ -493,6 +514,7 @@
}
void GpuProcessHost::OnProcessCrashed(int exit_code) {
+ SendOutstandingReplies();
if (++g_gpu_crash_count >= kGpuMaxCrashCount) {
// The gpu process is too unstable to use. Disable it for current session.
RenderViewHostDelegateHelper::set_gpu_enabled(false);
« no previous file with comments | « chrome/browser/gpu_process_host.h ('k') | chrome/common/gpu_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698