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

Unified Diff: runtime/vm/source_report.cc

Issue 1566793002: Expose the new _getSourceReport api in the service protocol. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code rev Created 4 years, 11 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 | « runtime/vm/source_report.h ('k') | runtime/vm/source_report_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/source_report.cc
diff --git a/runtime/vm/source_report.cc b/runtime/vm/source_report.cc
index 242957bae6aa1dc4d066f9bac05b401f865ddf91..4da21b6e8a350f7cbe4fc5e918b271d8af71d95c 100644
--- a/runtime/vm/source_report.cc
+++ b/runtime/vm/source_report.cc
@@ -10,8 +10,8 @@
namespace dart {
-SourceReport::SourceReport(ReportKind report_kind, CompileMode compile_mode)
- : report_kind_(report_kind),
+SourceReport::SourceReport(intptr_t report_set, CompileMode compile_mode)
+ : report_set_(report_set),
compile_mode_(compile_mode),
thread_(NULL),
script_(NULL),
@@ -35,6 +35,11 @@ void SourceReport::Init(Thread* thread,
}
+bool SourceReport::IsReportRequested(ReportKind report_kind) {
+ return (report_set_ & report_kind) != 0;
+}
+
+
bool SourceReport::ShouldSkipFunction(const Function& func) {
if (script_ != NULL && !script_->IsNull()) {
if (func.script() != script_->raw()) {
@@ -245,9 +250,10 @@ void SourceReport::VisitFunction(JSONArray* jsarr, const Function& func) {
range.AddProperty("endPos", end_pos);
range.AddProperty("compiled", true);
- if (report_kind_ == kCallSites) {
+ if (IsReportRequested(kCallSites)) {
PrintCallSitesData(&range, func, code);
- } else if (report_kind_ == kCoverage) {
+ }
+ if (IsReportRequested(kCoverage)) {
PrintCoverageData(&range, func, code);
}
}
« no previous file with comments | « runtime/vm/source_report.h ('k') | runtime/vm/source_report_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698