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

Side by Side Diff: ui/gfx/gl/gl_implementation_linux.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/gl/gl_context.cc ('k') | ui/gfx/gl/gl_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 base::NativeLibrary LoadLibrary(const char* filename) { 45 base::NativeLibrary LoadLibrary(const char* filename) {
46 return LoadLibrary(FilePath(filename)); 46 return LoadLibrary(FilePath(filename));
47 } 47 }
48 48
49 // TODO(backer): Find a more principled (less heavy handed) way to prevent a 49 // TODO(backer): Find a more principled (less heavy handed) way to prevent a
50 // race in the bindings initialization. 50 // race in the bindings initialization.
51 #if (defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)) || defined(TOUCH_UI) 51 #if (defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)) || defined(TOUCH_UI)
52 base::LazyInstance<base::Lock, 52 base::LazyInstance<base::Lock,
53 base::LeakyLazyInstanceTraits<base::Lock> > 53 base::LeakyLazyInstanceTraits<base::Lock> >
54 g_lock(base::LINKER_INITIALIZED); 54 g_lock = LAZY_INSTANCE_INITIALIZER;
55 #endif 55 #endif
56 56
57 } // namespace anonymous 57 } // namespace anonymous
58 58
59 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { 59 void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) {
60 impls->push_back(kGLImplementationDesktopGL); 60 impls->push_back(kGLImplementationDesktopGL);
61 impls->push_back(kGLImplementationEGLGLES2); 61 impls->push_back(kGLImplementationEGLGLES2);
62 impls->push_back(kGLImplementationOSMesaGL); 62 impls->push_back(kGLImplementationOSMesaGL);
63 } 63 }
64 64
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 #if !defined(USE_WAYLAND) 227 #if !defined(USE_WAYLAND)
228 ClearGLBindingsGLX(); 228 ClearGLBindingsGLX();
229 ClearGLBindingsOSMESA(); 229 ClearGLBindingsOSMESA();
230 #endif 230 #endif
231 SetGLImplementation(kGLImplementationNone); 231 SetGLImplementation(kGLImplementationNone);
232 232
233 UnloadGLNativeLibraries(); 233 UnloadGLNativeLibraries();
234 } 234 }
235 235
236 } // namespace gfx 236 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/gl/gl_context.cc ('k') | ui/gfx/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698