Chromium Code Reviews| Index: runtime/vm/coverage.h |
| diff --git a/runtime/vm/coverage.h b/runtime/vm/coverage.h |
| index 72c639ae01844c7b531516fc877034e66619e72c..12c4023fa882ec2e55d0bcc48cdef1c5c49ea0a6 100644 |
| --- a/runtime/vm/coverage.h |
| +++ b/runtime/vm/coverage.h |
| @@ -23,20 +23,27 @@ class Library; |
| class Script; |
| class String; |
| +class CoverageFilter : public ValueObject { |
| + public: |
| + virtual bool GetCoverage(const Library& lib, |
|
Michael Lippautz (Google)
2014/06/27 00:16:48
Performance of using only one filter function (and
Cutch
2014/06/27 15:07:19
Maybe rename to "ShouldOutputCoverageFor"
Also, m
Michael Lippautz (Google)
2014/06/27 17:12:24
Done.
|
| + const Script& script, |
| + const Class& cls, |
| + const Function& func) = 0; |
| + virtual ~CoverageFilter() {} |
| +}; |
| + |
| class CodeCoverage : public AllStatic { |
| public: |
| static void Write(Isolate* isolate); |
| - static void PrintJSON(Isolate* isolate, JSONStream* stream); |
| - |
| - static void PrintJSONForScript(const Script& script, JSONStream* stream); |
| - static void PrintJSONForLibrary( |
| - const Library& lib, const Script& script_filter, JSONStream* stream); |
| - static void PrintJSONForClass(const Class& lib, JSONStream* stream); |
| + static void PrintJSON(Isolate* isolate, |
| + JSONStream* stream, |
| + CoverageFilter* filter); |
| private: |
| - static void PrintClass(const Class& cls, |
| + static void PrintClass(const Library& lib, |
| + const Class& cls, |
| const JSONArray& arr, |
| - const Script& script_filter); |
| + CoverageFilter* filter); |
| static void CompileAndAdd(const Function& function, |
| const JSONArray& hits_arr, |
| const GrowableArray<intptr_t>& pos_to_line); |