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

Unified Diff: ui/gfx/gl/gl_implementation_linux.cc

Issue 7724003: Lock the initialization of the GL bindings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Widen to all Linux builds with browser compositor enabled. Created 9 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gl/gl_implementation_linux.cc
diff --git a/ui/gfx/gl/gl_implementation_linux.cc b/ui/gfx/gl/gl_implementation_linux.cc
index 97e30877bc4ad49fe35958f56c8a366dc0975a42..bf79b1bc19ead5fae529e26418778da477383601 100644
--- a/ui/gfx/gl/gl_implementation_linux.cc
+++ b/ui/gfx/gl/gl_implementation_linux.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/native_library.h"
#include "base/path_service.h"
+#include "base/synchronization/lock.h"
#include "ui/gfx/gl/gl_bindings.h"
#include "ui/gfx/gl/gl_implementation.h"
@@ -43,9 +44,18 @@ base::NativeLibrary LoadLibrary(const char* filename) {
return LoadLibrary(FilePath(filename));
}
+// TODO(backer): Find a more principled (less heavy handed) way to prevent a
+// race in the bindings initialization.
+#if (defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)) || defined(TOUCH_UI)
+base::Lock g_lock;
jam 2011/08/25 20:23:33 this goes against the chromium/google style guide:
+#endif
+
} // namespace anonymous
bool InitializeGLBindings(GLImplementation implementation) {
+#if (defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)) || defined(TOUCH_UI)
+ base::AutoLock locked(g_lock);
+#endif
// Prevent reinitialization with a different implementation. Once the gpu
// unit tests have initialized with kGLImplementationMock, we don't want to
// later switch to another GL implementation.
« 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