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

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

Issue 2700743002: [inspector] extend protocol for code coverage. (Closed)
Patch Set: small 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
Index: src/debug/debug-interface.h
diff --git a/src/debug/debug-interface.h b/src/debug/debug-interface.h
index ea89ce59f1ca8f3810136f8dd019fc6931253f74..89586e6c3ef1c998797a23f4d1da0d822e2d31dd 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,24 +212,36 @@ 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);
@@ -236,8 +249,8 @@ class V8_EXPORT_PRIVATE Coverage {
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();

Powered by Google App Engine
This is Rietveld 408576698