From 064af4286ec809e9ad7b8f1949c538c97d2ba283 Mon Sep 17 00:00:00 2001 From: "mikhail.naganov@gmail.com" Date: Mon, 25 May 2009 12:34:47 +0000 Subject: [PATCH] Expose IsProfilerPaused function on the public interface. This is needed for DevTools Profiler because of its asynchronous and multi-client architecture. Review URL: http://codereview.chromium.org/115761 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2041 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8.h | 5 +++++ src/api.cc | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/v8.h b/include/v8.h index 321d4a133..3fd6fc660 100644 --- a/include/v8.h +++ b/include/v8.h @@ -2084,6 +2084,11 @@ class V8EXPORT V8 { */ static void ResumeProfiler(); + /** + * Return whether profiler is currently paused. + */ + static bool IsProfilerPaused(); + /** * If logging is performed into a memory buffer (via --logfile=*), allows to * retrieve previously written messages. This can be used for retrieving diff --git a/src/api.cc b/src/api.cc index c16920b33..5eda4de96 100644 --- a/src/api.cc +++ b/src/api.cc @@ -3123,12 +3123,23 @@ void V8::PauseProfiler() { #endif } + void V8::ResumeProfiler() { #ifdef ENABLE_LOGGING_AND_PROFILING i::Logger::ResumeProfiler(); #endif } + +bool V8::IsProfilerPaused() { +#ifdef ENABLE_LOGGING_AND_PROFILING + return i::Logger::IsProfilerPaused(); +#else + return true; +#endif +} + + int V8::GetLogLines(int from_pos, char* dest_buf, int max_size) { #ifdef ENABLE_LOGGING_AND_PROFILING return i::Logger::GetLogLines(from_pos, dest_buf, max_size); -- 2.34.1