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

Unified Diff: src/api.cc

Issue 2733783002: [debug] change coverage API to use offset instead of line/column. (Closed)
Patch Set: rebase Created 3 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 | « 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 483f07a9f241d1df59627af1c1d52c1d4cf19dc8..84bc171d2eddecdb0b5b01af969c10583f18534c 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -9549,20 +9549,8 @@ Local<String> CpuProfileNode::GetFunctionName() const {
}
}
-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, function->start, &start,
- i::Script::WITH_OFFSET);
- i::Script::GetPositionInfo(i_script, function->end, &end,
- i::Script::WITH_OFFSET);
- start_ = Location(start.line, start.column);
- end_ = Location(end.line, end.column);
-}
-
+int debug::Coverage::FunctionData::StartOffset() { return function_->start; }
+int debug::Coverage::FunctionData::EndOffset() { return function_->end; }
uint32_t debug::Coverage::FunctionData::Count() { return function_->count; }
MaybeLocal<String> debug::Coverage::FunctionData::Name() {
@@ -9579,7 +9567,7 @@ size_t debug::Coverage::ScriptData::FunctionCount() {
debug::Coverage::FunctionData debug::Coverage::ScriptData::GetFunctionData(
size_t i) {
- return FunctionData(&script_->functions.at(i), GetScript());
+ return FunctionData(&script_->functions.at(i));
}
debug::Coverage::~Coverage() { delete coverage_; }
« 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