diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-20 22:32:16 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-20 22:32:16 +0000 |
commit | 02ec37a5c693e5c795145b92264fbb4677ad12b4 (patch) | |
tree | fc221b9063c2cf5dfb5400f0029e8e8a03729708 /chrome/gpu | |
parent | 2b6b77e5b3765de7f23f45b43c978c6111e32525 (diff) | |
download | chromium_src-02ec37a5c693e5c795145b92264fbb4677ad12b4.zip chromium_src-02ec37a5c693e5c795145b92264fbb4677ad12b4.tar.gz chromium_src-02ec37a5c693e5c795145b92264fbb4677ad12b4.tar.bz2 |
Fixed the race described in bug 54400 by changing a LOG(FATAL) to a LOG(ERROR). Queried the X server to make the error messages in the error handler more descriptive. When a MakeCurrent fails in the GPU process, the associated rendering is informed that the context is lost.
TEST=Run "chrome --enable-accelerated-compositing". Open a few tabs with "http://webkit.org/blog-files/3d-transforms/poster-circle.html". Close one of the tabs. Look for X error info logged on the console (from gpu_main.cc). Remaining tab should still be animated (the fix prevents gpu process from being terminated). This is a race condition, so there may not be an error logged the first time. A few trials should trip the error.
BUG=54400
Landing on behalf of baker@
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/gpu')
-rw-r--r-- | chrome/gpu/gpu_main.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/gpu/gpu_main.cc b/chrome/gpu/gpu_main.cc index 2e248ab..5ffd39f 100644 --- a/chrome/gpu/gpu_main.cc +++ b/chrome/gpu/gpu_main.cc @@ -20,6 +20,27 @@ #include "app/win_util.h" #endif +#if defined(USE_X11) +#include "app/x11_util.h" +#include "app/x11_util_internal.h" +#endif + +#if defined(USE_X11) +namespace { + +int GpuX11ErrorHandler(Display* d, XErrorEvent* error) { + LOG(ERROR) << x11_util::GetErrorEventDescription(d, error); + return 0; +} + +void SetGpuX11ErrorHandlers() { + // Set up the error handlers so that only general errors aren't fatal. + x11_util::SetX11ErrorHandlers(GpuX11ErrorHandler, NULL); +} + +} +#endif + // Main function for starting the Gpu process. int GpuMain(const MainFunctionParams& parameters) { #if defined(USE_LINUX_BREAKPAD) @@ -44,6 +65,10 @@ int GpuMain(const MainFunctionParams& parameters) { GpuProcess gpu_process; gpu_process.set_main_thread(new GpuThread()); +#if defined(USE_X11) + SetGpuX11ErrorHandlers(); +#endif + main_message_loop.Run(); return 0; |