summaryrefslogtreecommitdiffstats
path: root/webkit/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/extensions')
-rw-r--r--webkit/extensions/v8/profiler_extension.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/webkit/extensions/v8/profiler_extension.cc b/webkit/extensions/v8/profiler_extension.cc
index 7a4f13f..cbfc721 100644
--- a/webkit/extensions/v8/profiler_extension.cc
+++ b/webkit/extensions/v8/profiler_extension.cc
@@ -21,6 +21,7 @@ class ProfilerWrapper : public v8::Extension {
"chromium.Profiler = function() {"
" native function ProfilerStart();"
" native function ProfilerStop();"
+ " native function ProfilerFlush();"
" native function ProfilerClearData();"
" native function ProfilerSetThreadName();"
" this.start = function() {"
@@ -32,6 +33,9 @@ class ProfilerWrapper : public v8::Extension {
" this.clear = function() {"
" ProfilerClearData();"
" };"
+ " this.flush = function() {"
+ " ProfilerFlush();"
+ " };"
" this.setThreadName = function(name) {"
" ProfilerSetThreadName(name);"
" };"
@@ -45,6 +49,8 @@ class ProfilerWrapper : public v8::Extension {
return v8::FunctionTemplate::New(ProfilerStop);
} else if (name->Equals(v8::String::New("ProfilerClearData"))) {
return v8::FunctionTemplate::New(ProfilerClearData);
+ } else if (name->Equals(v8::String::New("ProfilerFlush"))) {
+ return v8::FunctionTemplate::New(ProfilerFlush);
} else if (name->Equals(v8::String::New("ProfilerSetThreadName"))) {
return v8::FunctionTemplate::New(ProfilerSetThreadName);
}
@@ -69,6 +75,13 @@ class ProfilerWrapper : public v8::Extension {
return v8::Undefined();
}
+ static v8::Handle<v8::Value> ProfilerFlush(
+ const v8::Arguments& args) {
+ base::Profiler::Flush();
+ return v8::Undefined();
+ }
+
+
static v8::Handle<v8::Value> ProfilerSetThreadName(
const v8::Arguments& args) {
if (args.Length() >= 1 && args[0]->IsString()) {