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

Unified Diff: src/debug/debug-interface.h

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 | « src/debug/debug-coverage.cc ('k') | src/inspector/js_protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug-interface.h
diff --git a/src/debug/debug-interface.h b/src/debug/debug-interface.h
index ea89ce59f1ca8f3810136f8dd019fc6931253f74..be8ed902d505503a288701b71c2b4281d4aef9a6 100644
--- a/src/debug/debug-interface.h
+++ b/src/debug/debug-interface.h
@@ -17,7 +17,8 @@
namespace v8 {
namespace internal {
-struct CoverageRange;
+struct CoverageFunction;
+struct CoverageScript;
class Coverage;
class Script;
}
@@ -211,33 +212,45 @@ class GeneratorObject {
*/
class V8_EXPORT_PRIVATE Coverage {
public:
- class V8_EXPORT_PRIVATE Range {
+ class ScriptData; // Forward declaration.
+
+ class V8_EXPORT_PRIVATE FunctionData {
public:
// 0-based line and colum numbers.
Location Start() { return start_; }
Location End() { return end_; }
uint32_t Count();
- size_t NestedCount();
- Range GetNested(size_t i);
MaybeLocal<String> Name();
private:
- Range(i::CoverageRange* range, Local<debug::Script> script);
- i::CoverageRange* range_;
+ FunctionData(i::CoverageFunction* function, Local<debug::Script> script);
+ i::CoverageFunction* function_;
Location start_;
Location end_;
- Local<debug::Script> script_;
- friend class debug::Coverage;
+ friend class v8::debug::Coverage::ScriptData;
+ };
+
+ class V8_EXPORT_PRIVATE ScriptData {
+ public:
+ Local<debug::Script> GetScript();
+ size_t FunctionCount();
+ FunctionData GetFunctionData(size_t i);
+
+ private:
+ explicit ScriptData(i::CoverageScript* script) : script_(script) {}
+ i::CoverageScript* script_;
+
+ friend class v8::debug::Coverage;
};
- static Coverage Collect(Isolate* isolate);
+ static Coverage Collect(Isolate* isolate, bool reset_count);
static void TogglePrecise(Isolate* isolate, bool enable);
size_t ScriptCount();
- Local<debug::Script> GetScript(size_t i);
- Range GetRange(size_t i);
+ ScriptData GetScriptData(size_t i);
+ bool IsEmpty() { return coverage_ == nullptr; }
~Coverage();
« no previous file with comments | « src/debug/debug-coverage.cc ('k') | src/inspector/js_protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698