Index: chrome/common/profiling.cc |
diff --git a/chrome/common/profiling.cc b/chrome/common/profiling.cc |
index b15cc963482625f8661fbb261dfdc6dc3eba50a9..bc678737e841f313f93199e1d0dc6fa3deed89c4 100644 |
--- a/chrome/common/profiling.cc |
+++ b/chrome/common/profiling.cc |
@@ -13,6 +13,7 @@ |
#include "base/string_util.h" |
#include "base/threading/thread.h" |
#include "chrome/common/chrome_switches.h" |
+#include "v8/include/v8.h" |
namespace { |
std::string GetProfileName() { |
@@ -102,6 +103,17 @@ void Profiling::ProcessStarted() { |
std::string process_type = |
command_line.GetSwitchValueASCII(switches::kProcessType); |
+ // Establish the V8 return address resolution hook if we're |
+ // an instrumented binary. |
+ if (base::debug::IsBinaryInstrumented()) { |
+ base::debug::ReturnAddressLocationResolver resolve_func = |
+ base::debug::GetProfilerReturnAddrResolutionFunc(); |
+ |
+ if (resolve_func != NULL) { |
+ v8::V8::SetReturnAddressLocationResolver(resolve_func); |
+ } |
+ } |
+ |
if (command_line.HasSwitch(switches::kProfilingAtStart)) { |
std::string process_type_to_start = |
command_line.GetSwitchValueASCII(switches::kProfilingAtStart); |