Revision: 19918
Author:   [email protected]
Date:     Fri Mar 14 09:26:31 2014 UTC
Log:      StopCpuProfiling should return non-const CpuProfile

StopCpuProfiling is replaced with StopProfiling which returns non-const CpuProfile which allows to call CpuProfile::Delete on it without const_cast. Also replaced StartCpuProfiling with StartProfiling to have symmetric names for start/stop actions.

BUG=v8:3213
LOG=Y
[email protected], [email protected]

Review URL: https://codereview.chromium.org/197873015
http://code.google.com/p/v8/source/detail?r=19918

Modified:
 /branches/bleeding_edge/include/v8-profiler.h
 /branches/bleeding_edge/src/api.cc

=======================================
--- /branches/bleeding_edge/include/v8-profiler.h Tue Feb 18 13:22:07 2014 UTC +++ /branches/bleeding_edge/include/v8-profiler.h Fri Mar 14 09:26:31 2014 UTC
@@ -158,12 +158,18 @@
    * |record_samples| parameter controls whether individual samples should
    * be recorded in addition to the aggregated tree.
    */
+  void StartProfiling(Handle<String> title, bool record_samples = false);
+
+  /** Deprecated. Use StartProfiling instead. */
void StartCpuProfiling(Handle<String> title, bool record_samples = false);

   /**
    * Stops collecting CPU profile with a given title and returns it.
    * If the title given is empty, finishes the last profile started.
    */
+  CpuProfile* StopProfiling(Handle<String> title);
+
+  /** Deprecated. Use StopProfiling instead. */
   const CpuProfile* StopCpuProfiling(Handle<String> title);

   /**
=======================================
--- /branches/bleeding_edge/src/api.cc  Thu Mar 13 11:55:31 2014 UTC
+++ /branches/bleeding_edge/src/api.cc  Fri Mar 14 09:26:31 2014 UTC
@@ -6956,17 +6956,27 @@
 }


-void CpuProfiler::StartCpuProfiling(Handle<String> title, bool record_samples) { +void CpuProfiler::StartProfiling(Handle<String> title, bool record_samples) {
   reinterpret_cast<i::CpuProfiler*>(this)->StartProfiling(
       *Utils::OpenHandle(*title), record_samples);
 }


-const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> title) {
-  return reinterpret_cast<const CpuProfile*>(
+void CpuProfiler::StartCpuProfiling(Handle<String> title, bool record_samples) {
+  StartProfiling(title, record_samples);
+}
+
+
+CpuProfile* CpuProfiler::StopProfiling(Handle<String> title) {
+  return reinterpret_cast<CpuProfile*>(
       reinterpret_cast<i::CpuProfiler*>(this)->StopProfiling(
           *Utils::OpenHandle(*title)));
 }
+
+
+const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> title) {
+  return StopProfiling(title);
+}


 void CpuProfiler::SetIdle(bool is_idle) {

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to