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

Unified Diff: ui/gl/gl_implementation.cc

Issue 1946873005: Move LoadLibraryAndPrintError helpers to common gl_implementation.h/.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and use base::FilePath::CharType to fix build failure on win os Created 4 years, 7 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 | « ui/gl/gl_implementation.h ('k') | ui/gl/gl_implementation_osmesa.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_implementation.cc
diff --git a/ui/gl/gl_implementation.cc b/ui/gl/gl_implementation.cc
index 9c9289f17a80dd9d28725f1dae67fa70ab506ffc..4951de06fdaa08e13b037f364d2084e6e3aa7cc5 100644
--- a/ui/gl/gl_implementation.cc
+++ b/ui/gl/gl_implementation.cc
@@ -212,4 +212,20 @@ bool WillUseGLGetStringForExtensions() {
return is_es || major_version < 3;
}
+base::NativeLibrary LoadLibraryAndPrintError(
+ const base::FilePath::CharType* filename) {
+ return LoadLibraryAndPrintError(base::FilePath(filename));
+}
+
+base::NativeLibrary LoadLibraryAndPrintError(const base::FilePath& filename) {
+ base::NativeLibraryLoadError error;
+ base::NativeLibrary library = base::LoadNativeLibrary(filename, &error);
+ if (!library) {
+ LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": "
+ << error.ToString();
+ return NULL;
+ }
+ return library;
+}
+
} // namespace gfx
« no previous file with comments | « ui/gl/gl_implementation.h ('k') | ui/gl/gl_implementation_osmesa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698