summaryrefslogtreecommitdiffstats
path: root/webkit/glue/devtools/js/devtools_host_stub.js
diff options
context:
space:
mode:
authormnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 13:05:51 +0000
committermnaganov@chromium.org <mnaganov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 13:05:51 +0000
commitfbcd92d686f77817f43c262d773ca523bf16d9ae (patch)
treecb94f783b328154916ae9fcfaf0c1ccdc6b32988 /webkit/glue/devtools/js/devtools_host_stub.js
parent3244c8cb2fd6f976c7d4c7da181347dfceab9f70 (diff)
downloadchromium_src-fbcd92d686f77817f43c262d773ca523bf16d9ae.zip
chromium_src-fbcd92d686f77817f43c262d773ca523bf16d9ae.tar.gz
chromium_src-fbcd92d686f77817f43c262d773ca523bf16d9ae.tar.bz2
DevTools: implement comparison of heap snapshots in Heap profiler.
BUG=none TEST=none Review URL: http://codereview.chromium.org/164557 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/devtools/js/devtools_host_stub.js')
-rw-r--r--webkit/glue/devtools/js/devtools_host_stub.js24
1 files changed, 21 insertions, 3 deletions
diff --git a/webkit/glue/devtools/js/devtools_host_stub.js b/webkit/glue/devtools/js/devtools_host_stub.js
index 783d29c..b53c990 100644
--- a/webkit/glue/devtools/js/devtools_host_stub.js
+++ b/webkit/glue/devtools/js/devtools_host_stub.js
@@ -14,6 +14,7 @@ RemoteDebuggerAgentStub = function() {
this.activeProfilerModules_ =
devtools.DebuggerAgent.ProfilerModules.PROFILER_MODULE_NONE;
this.profileLogPos_ = 0;
+ this.heapProfSample_ = 0;
this.heapProfLog_ = '';
};
@@ -39,9 +40,16 @@ RemoteDebuggerAgentStub.prototype.StartProfiling = function(modules) {
this.heapProfLog_ +=
'heap-sample-begin,"Heap","allocated",' +
(new Date()).getTime() + '\n' +
- 'heap-sample-stats,"Heap","allocated",10000,1000\n' +
- 'heap-js-cons-item,"foo",10,1000\n' +
- 'heap-js-cons-item,"bar",20,2000\n' +
+ 'heap-sample-stats,"Heap","allocated",10000,1000\n';
+ var sample = RemoteDebuggerAgentStub.HeapSamples[this.heapProfSample_];
+ if (++this.heapProfSample_ == RemoteDebuggerAgentStub.HeapSamples.length)
+ this.heapProfSample_ = 0;
+ for (var obj in sample) {
+ this.heapProfLog_ +=
+ 'heap-js-cons-item,"' + obj + '",' + sample[obj][0] +
+ ',' + sample[obj][1] + '\n';
+ }
+ this.heapProfLog_ +=
'heap-sample-end,"Heap","allocated"\n';
}
} else {
@@ -186,6 +194,16 @@ RemoteDebuggerAgentStub.ProfilerLogBuffer =
'profiler,pause\n';
+RemoteDebuggerAgentStub.HeapSamples = [
+ {foo: [1, 100], bar: [20, 2000]},
+ {foo: [2000, 200000], bar: [10, 1000]},
+ {foo: [15, 1500], bar: [15, 1500]},
+ {bar: [20, 2000]},
+ {foo: [15, 1500], bar: [15, 1500]},
+ {bar: [20, 2000], baz: [15, 1500]}
+];
+
+
/**
* @constructor
*/