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

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: Symbol->Address 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
« no previous file with comments | « 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..4aec60eaba6148213c03584e8d1217c774e9b968 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 GetModulePathForAddress(FilePath* path, const void* address) {
Mark Mentovai 2011/05/23 16:52:16 I don’t believe that this belongs in foundation_ut
+ Dl_info info;
+ if (dladdr(address, &info) == 0)
+ return false;
+ *path = FilePath(info.dli_fname);
+ return true;
+}
+
CFTypeRef GetValueFromDictionary(CFDictionaryRef dict,
CFStringRef key,
CFTypeID expected_type) {
« no previous file with comments | « base/mac/foundation_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698