| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_DEBUG_DEBUG_INTERFACE_H_ | 5 #ifndef V8_DEBUG_DEBUG_INTERFACE_H_ |
| 6 #define V8_DEBUG_DEBUG_INTERFACE_H_ | 6 #define V8_DEBUG_DEBUG_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <functional> | 8 #include <functional> |
| 9 | 9 |
| 10 #include "include/v8-debug.h" | 10 #include "include/v8-debug.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 /* | 212 /* |
| 213 * Provide API layer between inspector and code coverage. | 213 * Provide API layer between inspector and code coverage. |
| 214 */ | 214 */ |
| 215 class V8_EXPORT_PRIVATE Coverage { | 215 class V8_EXPORT_PRIVATE Coverage { |
| 216 public: | 216 public: |
| 217 class ScriptData; // Forward declaration. | 217 class ScriptData; // Forward declaration. |
| 218 | 218 |
| 219 class V8_EXPORT_PRIVATE FunctionData { | 219 class V8_EXPORT_PRIVATE FunctionData { |
| 220 public: | 220 public: |
| 221 // 0-based line and colum numbers. | 221 int StartOffset(); |
| 222 Location Start() { return start_; } | 222 int EndOffset(); |
| 223 Location End() { return end_; } | |
| 224 uint32_t Count(); | 223 uint32_t Count(); |
| 225 MaybeLocal<String> Name(); | 224 MaybeLocal<String> Name(); |
| 226 | 225 |
| 227 private: | 226 private: |
| 228 FunctionData(i::CoverageFunction* function, Local<debug::Script> script); | 227 explicit FunctionData(i::CoverageFunction* function) |
| 228 : function_(function) {} |
| 229 i::CoverageFunction* function_; | 229 i::CoverageFunction* function_; |
| 230 Location start_; | |
| 231 Location end_; | |
| 232 | 230 |
| 233 friend class v8::debug::Coverage::ScriptData; | 231 friend class v8::debug::Coverage::ScriptData; |
| 234 }; | 232 }; |
| 235 | 233 |
| 236 class V8_EXPORT_PRIVATE ScriptData { | 234 class V8_EXPORT_PRIVATE ScriptData { |
| 237 public: | 235 public: |
| 238 Local<debug::Script> GetScript(); | 236 Local<debug::Script> GetScript(); |
| 239 size_t FunctionCount(); | 237 size_t FunctionCount(); |
| 240 FunctionData GetFunctionData(size_t i); | 238 FunctionData GetFunctionData(size_t i); |
| 241 | 239 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 257 ~Coverage(); | 255 ~Coverage(); |
| 258 | 256 |
| 259 private: | 257 private: |
| 260 explicit Coverage(i::Coverage* coverage) : coverage_(coverage) {} | 258 explicit Coverage(i::Coverage* coverage) : coverage_(coverage) {} |
| 261 i::Coverage* coverage_; | 259 i::Coverage* coverage_; |
| 262 }; | 260 }; |
| 263 } // namespace debug | 261 } // namespace debug |
| 264 } // namespace v8 | 262 } // namespace v8 |
| 265 | 263 |
| 266 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ | 264 #endif // V8_DEBUG_DEBUG_INTERFACE_H_ |
| OLD | NEW |