Commit 0a61b7c9 authored by yurys@chromium.org's avatar yurys@chromium.org

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
R=alph@chromium.org, svenpanne@chromium.org

Review URL: https://codereview.chromium.org/197873015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19918 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a992481b
......@@ -158,12 +158,18 @@ class V8_EXPORT CpuProfiler {
* |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);
/**
......
......@@ -6956,19 +6956,29 @@ void CpuProfiler::SetSamplingInterval(int us) {
}
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) {
i::Isolate* isolate = reinterpret_cast<i::CpuProfiler*>(this)->isolate();
i::StateTag state = isolate->current_vm_state();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment