Grant the GL bindings permission to do file I/O during their initialization.
This one-time initialization takes very little time and is impractical
to move to another thread when the bindings are needed.

Re-enable NoStartupWindowTest.NoStartupWindowBasicTest on Mac.

BUG=100298
TEST=NoStartupWindowTest.NoStartupWindowBasicTest
TBR=atwilson
Review URL: http://codereview.chromium.org/8301014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105605 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ui/gfx/gl/gl_implementation_linux.cc b/ui/gfx/gl/gl_implementation_linux.cc
index 306f1137..dea5d440 100644
--- a/ui/gfx/gl/gl_implementation_linux.cc
+++ b/ui/gfx/gl/gl_implementation_linux.cc
@@ -12,6 +12,7 @@
 #include "base/native_library.h"
 #include "base/path_service.h"
 #include "base/synchronization/lock.h"
+#include "base/threading/thread_restrictions.h"
 #include "ui/gfx/gl/gl_bindings.h"
 #include "ui/gfx/gl/gl_implementation.h"
 
@@ -63,6 +64,12 @@
   if (GetGLImplementation() != kGLImplementationNone)
     return true;
 
+  // Allow the main thread or another to initialize these bindings
+  // after instituting restrictions on I/O. Going forward they will
+  // likely be used in the browser process on most platforms. The
+  // one-time initialization cost is small, between 2 and 5 ms.
+  base::ThreadRestrictions::ScopedAllowIO allow_io;
+
   switch (implementation) {
 #if !defined(USE_WAYLAND)
     case kGLImplementationOSMesaGL: {