diff options
author | dmikurube@chromium.org <dmikurube@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-15 10:12:27 +0000 |
---|---|---|
committer | dmikurube@chromium.org <dmikurube@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-15 10:12:27 +0000 |
commit | 9a1a41acdd10dc4a3d423bc072022288394785a7 (patch) | |
tree | f2e31444a274e4dc82b73c14ee8a5e83e856fdf0 /content | |
parent | 58ac52763177863e6aba103760b1dbbf48b8a5ec (diff) | |
download | chromium_src-9a1a41acdd10dc4a3d423bc072022288394785a7.zip chromium_src-9a1a41acdd10dc4a3d423bc072022288394785a7.tar.gz chromium_src-9a1a41acdd10dc4a3d423bc072022288394785a7.tar.bz2 |
Get a filename of dumped heap profile in a V8 extension HeapProfilerDump().
BUG=chromium-os:38652
TBR=darin@chromium.org
Review URL: https://chromiumcodereview.appspot.com/12212157
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182659 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/renderer/memory_benchmarking_extension.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/content/renderer/memory_benchmarking_extension.cc b/content/renderer/memory_benchmarking_extension.cc index 6918ac7..20e3e16 100644 --- a/content/renderer/memory_benchmarking_extension.cc +++ b/content/renderer/memory_benchmarking_extension.cc @@ -35,7 +35,7 @@ class MemoryBenchmarkingWrapper : public v8::Extension { "};" "chrome.memoryBenchmarking.heapProfilerDump = function(reason) {" " native function HeapProfilerDump();" - " HeapProfilerDump(reason);" + " return HeapProfilerDump(reason);" "};" ) {} @@ -60,10 +60,14 @@ class MemoryBenchmarkingWrapper : public v8::Extension { static v8::Handle<v8::Value> HeapProfilerDump(const v8::Arguments& args) { #if !defined(NO_TCMALLOC) && defined(OS_LINUX) + char dumped_filename_buffer[1000]; std::string reason("benchmarking_extension"); if (args.Length() && args[0]->IsString()) reason = *v8::String::AsciiValue(args[0]); - ::HeapProfilerDump(reason.c_str()); + ::HeapProfilerDumpWithFileName(reason.c_str(), + dumped_filename_buffer, + sizeof(dumped_filename_buffer)); + return v8::String::New(dumped_filename_buffer); #endif // !defined(NO_TCMALLOC) && defined(OS_LINUX) return v8::Undefined(); } |