Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: src/api.cc

Issue 13460002: Isolatify CPU profiler public API (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8-profiler.h ('k') | src/log.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index e378f3290e3d9050acf682cd912001e7b46ffa92..65663ba5c66c6dfcb1e210d31949fa59ed642d71 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -5806,6 +5806,13 @@ HeapProfiler* Isolate::GetHeapProfiler() {
}
+CpuProfiler* Isolate::GetCpuProfiler() {
+ i::CpuProfiler* cpu_profiler =
+ reinterpret_cast<i::Isolate*>(this)->cpu_profiler();
+ return reinterpret_cast<CpuProfiler*>(cpu_profiler);
+}
+
+
void V8::SetGlobalGCPrologueCallback(GCCallback callback) {
i::Isolate* isolate = i::Isolate::Current();
if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return;
@@ -6539,6 +6546,11 @@ int CpuProfiler::GetProfilesCount() {
}
+int CpuProfiler::GetProfileCount() {
+ return reinterpret_cast<i::CpuProfiler*>(this)->GetProfilesCount();
+}
+
+
const CpuProfile* CpuProfiler::GetProfile(int index,
Handle<Value> security_token) {
i::Isolate* isolate = i::Isolate::Current();
@@ -6552,6 +6564,15 @@ const CpuProfile* CpuProfiler::GetProfile(int index,
}
+const CpuProfile* CpuProfiler::GetCpuProfile(int index,
+ Handle<Value> security_token) {
+ return reinterpret_cast<const CpuProfile*>(
+ reinterpret_cast<i::CpuProfiler*>(this)->GetProfile(
+ security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
+ index));
+}
+
+
const CpuProfile* CpuProfiler::FindProfile(unsigned uid,
Handle<Value> security_token) {
i::Isolate* isolate = i::Isolate::Current();
@@ -6565,6 +6586,15 @@ const CpuProfile* CpuProfiler::FindProfile(unsigned uid,
}
+const CpuProfile* CpuProfiler::FindCpuProfile(unsigned uid,
+ Handle<Value> security_token) {
+ return reinterpret_cast<const CpuProfile*>(
+ reinterpret_cast<i::CpuProfiler*>(this)->FindProfile(
+ security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
+ uid));
+}
+
+
void CpuProfiler::StartProfiling(Handle<String> title, bool record_samples) {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::CpuProfiler::StartProfiling");
@@ -6574,6 +6604,12 @@ void CpuProfiler::StartProfiling(Handle<String> title, bool record_samples) {
}
+void CpuProfiler::StartCpuProfiling(Handle<String> title, bool record_samples) {
+ reinterpret_cast<i::CpuProfiler*>(this)->StartProfiling(
+ *Utils::OpenHandle(*title), record_samples);
+}
+
+
const CpuProfile* CpuProfiler::StopProfiling(Handle<String> title,
Handle<Value> security_token) {
i::Isolate* isolate = i::Isolate::Current();
@@ -6587,6 +6623,15 @@ const CpuProfile* CpuProfiler::StopProfiling(Handle<String> title,
}
+const CpuProfile* CpuProfiler::StopCpuProfiling(Handle<String> title,
+ Handle<Value> security_token) {
+ return reinterpret_cast<const CpuProfile*>(
+ reinterpret_cast<i::CpuProfiler*>(this)->StopProfiling(
+ security_token.IsEmpty() ? NULL : *Utils::OpenHandle(*security_token),
+ *Utils::OpenHandle(*title)));
+}
+
+
void CpuProfiler::DeleteAllProfiles() {
i::Isolate* isolate = i::Isolate::Current();
IsDeadCheck(isolate, "v8::CpuProfiler::DeleteAllProfiles");
@@ -6596,6 +6641,11 @@ void CpuProfiler::DeleteAllProfiles() {
}
+void CpuProfiler::DeleteAllCpuProfiles() {
+ reinterpret_cast<i::CpuProfiler*>(this)->DeleteAllProfiles();
+}
+
+
static i::HeapGraphEdge* ToInternal(const HeapGraphEdge* edge) {
return const_cast<i::HeapGraphEdge*>(
reinterpret_cast<const i::HeapGraphEdge*>(edge));
« no previous file with comments | « include/v8-profiler.h ('k') | src/log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698