Reviewers: Søren Gjesse,

Description:
Expose IsProfilerPaused function on the public interface.

This is needed for DevTools Profiler because of its asynchronous and
multi-client architecture.

Please review this at http://codereview.chromium.org/115761

Affected files:
   M include/v8.h
   M src/api.cc


Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index  
321d4a13319316e3996ebc2118e58d630fa21e3d..3fd6fc6605194cbe9ced65b8ac5523050f234865
  
100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -2085,6 +2085,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
     * profiler log data in the application. This function is thread-safe.
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index  
c16920b336166aaba3d0f5a7421250a5eb02b563..5eda4de96a4c29c5432e180e6bf5b4eb1c92fdf9
  
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);



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to