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

Unified Diff: src/api.cc

Issue 2700743002: [inspector] extend protocol for code coverage. (Closed)
Patch Set: fix Created 3 years, 10 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 | « no previous file | src/d8.cc » ('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 2aefecbeb37f55c0ac6ad0387976b01142a43ecc..09da9bb6a93b50d1e629f3ff7acbacf94d72aa05 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -9576,46 +9576,50 @@ Local<String> CpuProfileNode::GetFunctionName() const {
}
}
-debug::Coverage::Range::Range(i::CoverageRange* range,
- Local<debug::Script> script)
- : range_(range), script_(script) {
+debug::Coverage::FunctionData::FunctionData(i::CoverageFunction* function,
+ Local<debug::Script> script)
+ : function_(function) {
i::Handle<i::Script> i_script = v8::Utils::OpenHandle(*script);
i::Script::PositionInfo start;
i::Script::PositionInfo end;
- i::Script::GetPositionInfo(i_script, range->start, &start,
+ i::Script::GetPositionInfo(i_script, function->start, &start,
i::Script::WITH_OFFSET);
- i::Script::GetPositionInfo(i_script, range->end, &end,
+ i::Script::GetPositionInfo(i_script, function->end, &end,
i::Script::WITH_OFFSET);
start_ = Location(start.line, start.column);
end_ = Location(end.line, end.column);
}
-uint32_t debug::Coverage::Range::Count() { return range_->count; }
+uint32_t debug::Coverage::FunctionData::Count() { return function_->count; }
-size_t debug::Coverage::Range::NestedCount() { return range_->inner.size(); }
+MaybeLocal<String> debug::Coverage::FunctionData::Name() {
+ return ToApiHandle<String>(function_->name);
+}
+
+Local<debug::Script> debug::Coverage::ScriptData::GetScript() {
+ return ToApiHandle<debug::Script>(script_->script);
+}
-debug::Coverage::Range debug::Coverage::Range::GetNested(size_t i) {
- return Range(&range_->inner[i], script_);
+size_t debug::Coverage::ScriptData::FunctionCount() {
+ return script_->functions.size();
}
-MaybeLocal<String> debug::Coverage::Range::Name() {
- return ToApiHandle<String>(range_->name);
+debug::Coverage::FunctionData debug::Coverage::ScriptData::GetFunctionData(
+ size_t i) {
+ return FunctionData(&script_->functions.at(i), GetScript());
}
debug::Coverage::~Coverage() { delete coverage_; }
size_t debug::Coverage::ScriptCount() { return coverage_->size(); }
-Local<debug::Script> debug::Coverage::GetScript(size_t i) {
- return ToApiHandle<debug::Script>(coverage_->at(i).script);
-}
-
-debug::Coverage::Range debug::Coverage::GetRange(size_t i) {
- return Range(&coverage_->at(i).toplevel, GetScript(i));
+debug::Coverage::ScriptData debug::Coverage::GetScriptData(size_t i) {
+ return ScriptData(&coverage_->at(i));
}
-debug::Coverage debug::Coverage::Collect(Isolate* isolate) {
- return Coverage(i::Coverage::Collect(reinterpret_cast<i::Isolate*>(isolate)));
+debug::Coverage debug::Coverage::Collect(Isolate* isolate, bool reset_count) {
+ return Coverage(i::Coverage::Collect(reinterpret_cast<i::Isolate*>(isolate),
+ reset_count));
}
void debug::Coverage::TogglePrecise(Isolate* isolate, bool enable) {
« no previous file with comments | « no previous file | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698