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

Unified Diff: src/inspector/v8-profiler-agent-impl.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 | « src/inspector/js_protocol.json ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-profiler-agent-impl.cc
diff --git a/src/inspector/v8-profiler-agent-impl.cc b/src/inspector/v8-profiler-agent-impl.cc
index c7d1cc26174bd07698943ed3290047a67695e3bd..5f5f815538169f061dbc45ef5fd08d15a94935c4 100644
--- a/src/inspector/v8-profiler-agent-impl.cc
+++ b/src/inspector/v8-profiler-agent-impl.cc
@@ -307,14 +307,19 @@ Response takeCoverage(
ranges = protocol::Array<protocol::Profiler::CoverageRange>::create();
// At this point we only have per-function coverage data, so there is
// only one range per function.
- ranges->addItem(
- protocol::Profiler::CoverageRange::create()
- .setStartLineNumber(function_data.Start().GetLineNumber())
- .setStartColumnNumber(function_data.Start().GetColumnNumber())
- .setEndLineNumber(function_data.End().GetLineNumber())
- .setEndColumnNumber(function_data.End().GetColumnNumber())
- .setCount(function_data.Count())
- .build());
+ v8::debug::Location start =
+ script->GetSourceLocation(function_data.StartOffset());
+ v8::debug::Location end =
+ script->GetSourceLocation(function_data.EndOffset());
+ ranges->addItem(protocol::Profiler::CoverageRange::create()
+ .setStartLineNumber(start.GetLineNumber())
+ .setStartColumnNumber(start.GetColumnNumber())
+ .setEndLineNumber(end.GetLineNumber())
+ .setEndColumnNumber(end.GetColumnNumber())
+ .setStartOffset(function_data.StartOffset())
+ .setEndOffset(function_data.EndOffset())
+ .setCount(function_data.Count())
+ .build());
functions->addItem(
protocol::Profiler::FunctionCoverage::create()
.setFunctionName(toProtocolString(
« no previous file with comments | « src/inspector/js_protocol.json ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698