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

Side by Side Diff: base/native_library_linux.cc

Issue 2268002: Implemented mid-level Negotiate protocol for Posix. (Closed)
Patch Set: Merged with trunk. Created 10 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 unified diff | Download patch
« no previous file with comments | « base/native_library.h ('k') | base/native_library_mac.mm » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/logging.h" 10 #include "base/logging.h"
(...skipping 27 matching lines...) Expand all
38 int ret = dlclose(library); 38 int ret = dlclose(library);
39 if (ret < 0) { 39 if (ret < 0) {
40 LOG(ERROR) << "dlclose failed: " << dlerror(); 40 LOG(ERROR) << "dlclose failed: " << dlerror();
41 NOTREACHED(); 41 NOTREACHED();
42 } 42 }
43 } 43 }
44 44
45 // static 45 // static
46 void* GetFunctionPointerFromNativeLibrary(NativeLibrary library, 46 void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
47 const char* name) { 47 const char* name) {
48 return dlsym(library, name); 48 DCHECK(name != NULL) << "NULL name passed in.";
49 void* lib = dlsym(library, name);
50 return lib;
49 } 51 }
50 52
51 // static 53 // static
52 string16 GetNativeLibraryName(const string16& name) { 54 string16 GetNativeLibraryName(const string16& name) {
53 return ASCIIToUTF16("lib") + name + ASCIIToUTF16(".so"); 55 return ASCIIToUTF16("lib") + name + ASCIIToUTF16(".so");
54 } 56 }
55 57
58 string16 GetLibraryErrorMessage() {
59 const char* last_err_message = dlerror();
60 string16 err_message;
61
62 if (last_err_message) {
63 err_message = ASCIIToUTF16(last_err_message);
64 }
65
66 return err_message;
67 }
68
56 } // namespace base 69 } // namespace base
OLDNEW
« no previous file with comments | « base/native_library.h ('k') | base/native_library_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698