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

Unified Diff: base/native_library_mac.mm

Issue 2048523002: Fix base::GetNativeLibraryName() for Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@native_lib_clean
Patch Set: rebase Created 4 years, 6 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 | « base/native_library_ios.mm ('k') | base/native_library_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/native_library_mac.mm
diff --git a/base/native_library_mac.mm b/base/native_library_mac.mm
index f7eeba3e7e208057872ced882f5b75e707b2acfd..f2df0a711a436087c3ff15f99fa2406c3b9b8957 100644
--- a/base/native_library_mac.mm
+++ b/base/native_library_mac.mm
@@ -47,7 +47,7 @@ NativeLibrary LoadNativeLibrary(const FilePath& library_path,
if (!dylib) {
if (error)
error->message = dlerror();
- return NULL;
+ return nullptr;
}
NativeLibrary native_lib = new NativeLibraryStruct();
native_lib->type = DYNAMIC_LIB;
@@ -61,10 +61,10 @@ NativeLibrary LoadNativeLibrary(const FilePath& library_path,
library_path.value().length(),
true));
if (!url)
- return NULL;
+ return nullptr;
CFBundleRef bundle = CFBundleCreate(kCFAllocatorDefault, url.get());
if (!bundle)
- return NULL;
+ return nullptr;
NativeLibrary native_lib = new NativeLibraryStruct();
native_lib->type = BUNDLE;
@@ -97,7 +97,7 @@ void UnloadNativeLibrary(NativeLibrary library) {
// static
void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
StringPiece name) {
- void* function_pointer = NULL;
+ void* function_pointer = nullptr;
// Get the function pointer using the right API for the type.
if (library->type == BUNDLE) {
@@ -118,8 +118,9 @@ void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
}
// static
-string16 GetNativeLibraryName(StringPiece16 name) {
- return name.as_string() + ASCIIToUTF16(".dylib");
+std::string GetNativeLibraryName(StringPiece name) {
+ DCHECK(IsStringASCII(name));
+ return "lib" + name.as_string() + ".dylib";
}
} // namespace base
« no previous file with comments | « base/native_library_ios.mm ('k') | base/native_library_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698