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

Side by Side Diff: base/native_library_mac.mm

Issue 12282019: Disable "using base::FilePath" on Linux since it now compiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/i18n/file_util_icu_unittest.cc ('k') | base/process_linux.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 "base/native_library.h" 5 #include "base/native_library.h"
6 6
7 #include <dlfcn.h> 7 #include <dlfcn.h>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/mac/scoped_cftyperef.h" 11 #include "base/mac/scoped_cftyperef.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/threading/thread_restrictions.h" 13 #include "base/threading/thread_restrictions.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 15
16 namespace base { 16 namespace base {
17 17
18 // static 18 // static
19 NativeLibrary LoadNativeLibrary(const FilePath& library_path, 19 NativeLibrary LoadNativeLibrary(const base::FilePath& library_path,
20 std::string* error) { 20 std::string* error) {
21 // dlopen() etc. open the file off disk. 21 // dlopen() etc. open the file off disk.
22 if (library_path.Extension() == "dylib" || 22 if (library_path.Extension() == "dylib" ||
23 !file_util::DirectoryExists(library_path)) { 23 !file_util::DirectoryExists(library_path)) {
24 void* dylib = dlopen(library_path.value().c_str(), RTLD_LAZY); 24 void* dylib = dlopen(library_path.value().c_str(), RTLD_LAZY);
25 if (!dylib) 25 if (!dylib)
26 return NULL; 26 return NULL;
27 NativeLibrary native_lib = new NativeLibraryStruct(); 27 NativeLibrary native_lib = new NativeLibraryStruct();
28 native_lib->type = DYNAMIC_LIB; 28 native_lib->type = DYNAMIC_LIB;
29 native_lib->dylib = dylib; 29 native_lib->dylib = dylib;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 return dlsym(library->dylib, name); 72 return dlsym(library->dylib, name);
73 } 73 }
74 74
75 // static 75 // static
76 string16 GetNativeLibraryName(const string16& name) { 76 string16 GetNativeLibraryName(const string16& name) {
77 return name + ASCIIToUTF16(".dylib"); 77 return name + ASCIIToUTF16(".dylib");
78 } 78 }
79 79
80 } // namespace base 80 } // namespace base
OLDNEW
« no previous file with comments | « base/i18n/file_util_icu_unittest.cc ('k') | base/process_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698