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

Unified Diff: base/mac/foundation_util.mm

Issue 7019041: Fix up PathProvider on the Mac for FILE_MODULE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« base/mac/foundation_util.h ('K') | « base/mac/foundation_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/foundation_util.mm
diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
index cb5746a3b5db768638c3a46658b0c6be3116925e..a14b0e2db3c94dbe58dbaa3f4716a9832980ca1d 100644
--- a/base/mac/foundation_util.mm
+++ b/base/mac/foundation_util.mm
@@ -4,6 +4,7 @@
#include "base/mac/foundation_util.h"
+#include <dlfcn.h>
#include <stdlib.h>
#include <string.h>
@@ -200,6 +201,14 @@ FilePath GetAppBundlePath(const FilePath& exec_name) {
return FilePath();
}
+bool GetModulePathForSymbol(FilePath* path, const void* symbol) {
+ Dl_info info;
+ if (dladdr(symbol, &info) == 0)
+ return false;
+ *path = FilePath(info.dli_fname);
+ return true;
+}
+
CFTypeRef GetValueFromDictionary(CFDictionaryRef dict,
CFStringRef key,
CFTypeID expected_type) {
« base/mac/foundation_util.h ('K') | « base/mac/foundation_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698