libv8-node 18.13.0.1-x86_64-linux → 20.2.0.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libv8/node/version.rb +3 -3
  3. data/vendor/v8/include/cppgc/common.h +0 -1
  4. data/vendor/v8/include/cppgc/cross-thread-persistent.h +11 -10
  5. data/vendor/v8/include/cppgc/heap-consistency.h +46 -3
  6. data/vendor/v8/include/cppgc/heap-handle.h +48 -0
  7. data/vendor/v8/include/cppgc/heap-statistics.h +2 -2
  8. data/vendor/v8/include/cppgc/heap.h +3 -7
  9. data/vendor/v8/include/cppgc/internal/api-constants.h +14 -1
  10. data/vendor/v8/include/cppgc/internal/base-page-handle.h +45 -0
  11. data/vendor/v8/include/cppgc/internal/caged-heap-local-data.h +40 -8
  12. data/vendor/v8/include/cppgc/internal/caged-heap.h +61 -0
  13. data/vendor/v8/include/cppgc/internal/gc-info.h +35 -34
  14. data/vendor/v8/include/cppgc/internal/member-storage.h +248 -0
  15. data/vendor/v8/include/cppgc/internal/name-trait.h +21 -6
  16. data/vendor/v8/include/cppgc/internal/persistent-node.h +11 -13
  17. data/vendor/v8/include/cppgc/internal/pointer-policies.h +65 -8
  18. data/vendor/v8/include/cppgc/internal/write-barrier.h +153 -101
  19. data/vendor/v8/include/cppgc/liveness-broker.h +8 -7
  20. data/vendor/v8/include/cppgc/macros.h +10 -1
  21. data/vendor/v8/include/cppgc/member.h +424 -111
  22. data/vendor/v8/include/cppgc/name-provider.h +4 -4
  23. data/vendor/v8/include/cppgc/persistent.h +27 -24
  24. data/vendor/v8/include/cppgc/platform.h +7 -5
  25. data/vendor/v8/include/cppgc/sentinel-pointer.h +1 -1
  26. data/vendor/v8/include/cppgc/trace-trait.h +4 -0
  27. data/vendor/v8/include/cppgc/type-traits.h +13 -3
  28. data/vendor/v8/include/cppgc/visitor.h +104 -57
  29. data/vendor/v8/include/libplatform/v8-tracing.h +2 -2
  30. data/vendor/v8/include/v8-array-buffer.h +59 -0
  31. data/vendor/v8/include/v8-callbacks.h +32 -5
  32. data/vendor/v8/include/v8-context.h +63 -11
  33. data/vendor/v8/include/v8-cppgc.h +22 -0
  34. data/vendor/v8/include/v8-data.h +1 -1
  35. data/vendor/v8/include/v8-date.h +5 -0
  36. data/vendor/v8/include/v8-embedder-heap.h +0 -164
  37. data/vendor/v8/include/v8-exception.h +1 -1
  38. data/vendor/v8/include/v8-fast-api-calls.h +49 -31
  39. data/vendor/v8/include/v8-function-callback.h +69 -42
  40. data/vendor/v8/include/v8-function.h +9 -0
  41. data/vendor/v8/include/v8-initialization.h +23 -49
  42. data/vendor/v8/include/v8-inspector.h +32 -11
  43. data/vendor/v8/include/v8-internal.h +480 -183
  44. data/vendor/v8/include/v8-isolate.h +52 -77
  45. data/vendor/v8/include/v8-local-handle.h +86 -53
  46. data/vendor/v8/include/v8-locker.h +0 -11
  47. data/vendor/v8/include/v8-maybe.h +24 -1
  48. data/vendor/v8/include/v8-message.h +2 -4
  49. data/vendor/v8/include/v8-metrics.h +48 -40
  50. data/vendor/v8/include/v8-microtask-queue.h +6 -1
  51. data/vendor/v8/include/v8-object.h +29 -18
  52. data/vendor/v8/include/v8-persistent-handle.h +25 -18
  53. data/vendor/v8/include/v8-platform.h +133 -35
  54. data/vendor/v8/include/v8-primitive.h +27 -20
  55. data/vendor/v8/include/v8-profiler.h +133 -53
  56. data/vendor/v8/include/v8-regexp.h +2 -1
  57. data/vendor/v8/include/v8-script.h +91 -7
  58. data/vendor/v8/include/v8-snapshot.h +4 -8
  59. data/vendor/v8/include/v8-template.h +16 -77
  60. data/vendor/v8/include/v8-traced-handle.h +22 -28
  61. data/vendor/v8/include/v8-unwinder-state.h +4 -4
  62. data/vendor/v8/include/v8-util.h +11 -7
  63. data/vendor/v8/include/v8-value-serializer.h +46 -23
  64. data/vendor/v8/include/v8-value.h +31 -4
  65. data/vendor/v8/include/v8-version.h +4 -4
  66. data/vendor/v8/include/v8-wasm.h +7 -63
  67. data/vendor/v8/include/v8-weak-callback-info.h +0 -7
  68. data/vendor/v8/include/v8config.h +353 -15
  69. data/vendor/v8/x86_64-linux/libv8/obj/libv8_monolith.a +0 -0
  70. metadata +5 -1
@@ -21,6 +21,7 @@ class Value;
21
21
  namespace internal {
22
22
  class FunctionCallbackArguments;
23
23
  class PropertyCallbackArguments;
24
+ class Builtins;
24
25
  } // namespace internal
25
26
 
26
27
  namespace debug {
@@ -74,6 +75,11 @@ class ReturnValue {
74
75
  V8_INLINE void SetInternal(internal::Address value) { *value_ = value; }
75
76
  V8_INLINE internal::Address GetDefaultValue();
76
77
  V8_INLINE explicit ReturnValue(internal::Address* slot);
78
+
79
+ // See FunctionCallbackInfo.
80
+ static constexpr int kIsolateValueIndex = -2;
81
+ static constexpr int kDefaultValueValueIndex = -1;
82
+
77
83
  internal::Address* value_;
78
84
  };
79
85
 
@@ -116,19 +122,35 @@ class FunctionCallbackInfo {
116
122
  V8_INLINE Isolate* GetIsolate() const;
117
123
  /** The ReturnValue for the call. */
118
124
  V8_INLINE ReturnValue<T> GetReturnValue() const;
119
- // This shouldn't be public, but the arm compiler needs it.
120
- static const int kArgsLength = 6;
121
125
 
122
- protected:
126
+ private:
123
127
  friend class internal::FunctionCallbackArguments;
124
128
  friend class internal::CustomArguments<FunctionCallbackInfo>;
125
129
  friend class debug::ConsoleCallArguments;
126
- static const int kHolderIndex = 0;
127
- static const int kIsolateIndex = 1;
128
- static const int kReturnValueDefaultValueIndex = 2;
129
- static const int kReturnValueIndex = 3;
130
- static const int kDataIndex = 4;
131
- static const int kNewTargetIndex = 5;
130
+ friend class internal::Builtins;
131
+ static constexpr int kHolderIndex = 0;
132
+ static constexpr int kIsolateIndex = 1;
133
+ static constexpr int kReturnValueDefaultValueIndex = 2;
134
+ static constexpr int kReturnValueIndex = 3;
135
+ static constexpr int kDataIndex = 4;
136
+ static constexpr int kNewTargetIndex = 5;
137
+
138
+ static constexpr int kArgsLength = 6;
139
+ static constexpr int kArgsLengthWithReceiver = 7;
140
+
141
+ // Codegen constants:
142
+ static constexpr int kSize = 3 * internal::kApiSystemPointerSize;
143
+ static constexpr int kImplicitArgsOffset = 0;
144
+ static constexpr int kValuesOffset =
145
+ kImplicitArgsOffset + internal::kApiSystemPointerSize;
146
+ static constexpr int kLengthOffset =
147
+ kValuesOffset + internal::kApiSystemPointerSize;
148
+
149
+ static constexpr int kThisValuesIndex = -1;
150
+ static_assert(ReturnValue<Value>::kDefaultValueValueIndex ==
151
+ kReturnValueDefaultValueIndex - kReturnValueIndex);
152
+ static_assert(ReturnValue<Value>::kIsolateValueIndex ==
153
+ kIsolateIndex - kReturnValueIndex);
132
154
 
133
155
  V8_INLINE FunctionCallbackInfo(internal::Address* implicit_args,
134
156
  internal::Address* values, int length);
@@ -229,22 +251,24 @@ class PropertyCallbackInfo {
229
251
  */
230
252
  V8_INLINE bool ShouldThrowOnError() const;
231
253
 
232
- // This shouldn't be public, but the arm compiler needs it.
233
- static const int kArgsLength = 7;
234
-
235
- protected:
254
+ private:
236
255
  friend class MacroAssembler;
237
256
  friend class internal::PropertyCallbackArguments;
238
257
  friend class internal::CustomArguments<PropertyCallbackInfo>;
239
- static const int kShouldThrowOnErrorIndex = 0;
240
- static const int kHolderIndex = 1;
241
- static const int kIsolateIndex = 2;
242
- static const int kReturnValueDefaultValueIndex = 3;
243
- static const int kReturnValueIndex = 4;
244
- static const int kDataIndex = 5;
245
- static const int kThisIndex = 6;
246
-
247
- V8_INLINE PropertyCallbackInfo(internal::Address* args) : args_(args) {}
258
+ static constexpr int kShouldThrowOnErrorIndex = 0;
259
+ static constexpr int kHolderIndex = 1;
260
+ static constexpr int kIsolateIndex = 2;
261
+ static constexpr int kReturnValueDefaultValueIndex = 3;
262
+ static constexpr int kReturnValueIndex = 4;
263
+ static constexpr int kDataIndex = 5;
264
+ static constexpr int kThisIndex = 6;
265
+
266
+ static constexpr int kArgsLength = 7;
267
+
268
+ static constexpr int kSize = 1 * internal::kApiSystemPointerSize;
269
+
270
+ V8_INLINE explicit PropertyCallbackInfo(internal::Address* args)
271
+ : args_(args) {}
248
272
  internal::Address* args_;
249
273
  };
250
274
 
@@ -285,7 +309,7 @@ void ReturnValue<T>::Set(const Local<S> handle) {
285
309
  if (V8_UNLIKELY(handle.IsEmpty())) {
286
310
  *value_ = GetDefaultValue();
287
311
  } else {
288
- *value_ = *reinterpret_cast<internal::Address*>(*handle);
312
+ *value_ = internal::ValueHelper::ValueAsAddress(*handle);
289
313
  }
290
314
  }
291
315
 
@@ -328,41 +352,46 @@ void ReturnValue<T>::Set(bool value) {
328
352
  } else {
329
353
  root_index = I::kFalseValueRootIndex;
330
354
  }
331
- *value_ = *I::GetRoot(GetIsolate(), root_index);
355
+ *value_ = I::GetRoot(GetIsolate(), root_index);
332
356
  }
333
357
 
334
358
  template <typename T>
335
359
  void ReturnValue<T>::SetNull() {
336
360
  static_assert(std::is_base_of<T, Primitive>::value, "type check");
337
361
  using I = internal::Internals;
338
- *value_ = *I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
362
+ *value_ = I::GetRoot(GetIsolate(), I::kNullValueRootIndex);
339
363
  }
340
364
 
341
365
  template <typename T>
342
366
  void ReturnValue<T>::SetUndefined() {
343
367
  static_assert(std::is_base_of<T, Primitive>::value, "type check");
344
368
  using I = internal::Internals;
345
- *value_ = *I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
369
+ *value_ = I::GetRoot(GetIsolate(), I::kUndefinedValueRootIndex);
346
370
  }
347
371
 
348
372
  template <typename T>
349
373
  void ReturnValue<T>::SetEmptyString() {
350
374
  static_assert(std::is_base_of<T, String>::value, "type check");
351
375
  using I = internal::Internals;
352
- *value_ = *I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
376
+ *value_ = I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
353
377
  }
354
378
 
355
379
  template <typename T>
356
380
  Isolate* ReturnValue<T>::GetIsolate() const {
357
381
  // Isolate is always the pointer below the default value on the stack.
358
- return *reinterpret_cast<Isolate**>(&value_[-2]);
382
+ return *reinterpret_cast<Isolate**>(&value_[kIsolateValueIndex]);
359
383
  }
360
384
 
361
385
  template <typename T>
362
386
  Local<Value> ReturnValue<T>::Get() const {
363
387
  using I = internal::Internals;
364
- if (*value_ == *I::GetRoot(GetIsolate(), I::kTheHoleValueRootIndex))
365
- return Local<Value>(*Undefined(GetIsolate()));
388
+ #if V8_STATIC_ROOTS_BOOL
389
+ if (I::is_identical(*value_, I::StaticReadOnlyRoot::kTheHoleValue)) {
390
+ #else
391
+ if (*value_ == I::GetRoot(GetIsolate(), I::kTheHoleValueRootIndex)) {
392
+ #endif
393
+ return Undefined(GetIsolate());
394
+ }
366
395
  return Local<Value>::New(GetIsolate(), reinterpret_cast<Value*>(value_));
367
396
  }
368
397
 
@@ -375,7 +404,7 @@ void ReturnValue<T>::Set(S* whatever) {
375
404
  template <typename T>
376
405
  internal::Address ReturnValue<T>::GetDefaultValue() {
377
406
  // Default value is always the pointer below value_ on the stack.
378
- return value_[-1];
407
+ return value_[kDefaultValueValueIndex];
379
408
  }
380
409
 
381
410
  template <typename T>
@@ -387,31 +416,29 @@ FunctionCallbackInfo<T>::FunctionCallbackInfo(internal::Address* implicit_args,
387
416
  template <typename T>
388
417
  Local<Value> FunctionCallbackInfo<T>::operator[](int i) const {
389
418
  // values_ points to the first argument (not the receiver).
390
- if (i < 0 || length_ <= i) return Local<Value>(*Undefined(GetIsolate()));
391
- return Local<Value>(reinterpret_cast<Value*>(values_ + i));
419
+ if (i < 0 || length_ <= i) return Undefined(GetIsolate());
420
+ return Local<Value>::FromSlot(values_ + i);
392
421
  }
393
422
 
394
423
  template <typename T>
395
424
  Local<Object> FunctionCallbackInfo<T>::This() const {
396
425
  // values_ points to the first argument (not the receiver).
397
- return Local<Object>(reinterpret_cast<Object*>(values_ - 1));
426
+ return Local<Object>::FromSlot(values_ + kThisValuesIndex);
398
427
  }
399
428
 
400
429
  template <typename T>
401
430
  Local<Object> FunctionCallbackInfo<T>::Holder() const {
402
- return Local<Object>(
403
- reinterpret_cast<Object*>(&implicit_args_[kHolderIndex]));
431
+ return Local<Object>::FromSlot(&implicit_args_[kHolderIndex]);
404
432
  }
405
433
 
406
434
  template <typename T>
407
435
  Local<Value> FunctionCallbackInfo<T>::NewTarget() const {
408
- return Local<Value>(
409
- reinterpret_cast<Value*>(&implicit_args_[kNewTargetIndex]));
436
+ return Local<Value>::FromSlot(&implicit_args_[kNewTargetIndex]);
410
437
  }
411
438
 
412
439
  template <typename T>
413
440
  Local<Value> FunctionCallbackInfo<T>::Data() const {
414
- return Local<Value>(reinterpret_cast<Value*>(&implicit_args_[kDataIndex]));
441
+ return Local<Value>::FromSlot(&implicit_args_[kDataIndex]);
415
442
  }
416
443
 
417
444
  template <typename T>
@@ -441,17 +468,17 @@ Isolate* PropertyCallbackInfo<T>::GetIsolate() const {
441
468
 
442
469
  template <typename T>
443
470
  Local<Value> PropertyCallbackInfo<T>::Data() const {
444
- return Local<Value>(reinterpret_cast<Value*>(&args_[kDataIndex]));
471
+ return Local<Value>::FromSlot(&args_[kDataIndex]);
445
472
  }
446
473
 
447
474
  template <typename T>
448
475
  Local<Object> PropertyCallbackInfo<T>::This() const {
449
- return Local<Object>(reinterpret_cast<Object*>(&args_[kThisIndex]));
476
+ return Local<Object>::FromSlot(&args_[kThisIndex]);
450
477
  }
451
478
 
452
479
  template <typename T>
453
480
  Local<Object> PropertyCallbackInfo<T>::Holder() const {
454
- return Local<Object>(reinterpret_cast<Object*>(&args_[kHolderIndex]));
481
+ return Local<Object>::FromSlot(&args_[kHolderIndex]);
455
482
  }
456
483
 
457
484
  template <typename T>
@@ -59,6 +59,7 @@ class V8_EXPORT Function : public Object {
59
59
  void SetName(Local<String> name);
60
60
  Local<Value> GetName() const;
61
61
 
62
+ V8_DEPRECATED("No direct replacement")
62
63
  MaybeLocal<UnboundScript> GetUnboundScript() const;
63
64
 
64
65
  /**
@@ -106,6 +107,14 @@ class V8_EXPORT Function : public Object {
106
107
  V8_WARN_UNUSED_RESULT MaybeLocal<String> FunctionProtoToString(
107
108
  Local<Context> context);
108
109
 
110
+ /**
111
+ * Returns true if the function does nothing.
112
+ * The function returns false on error.
113
+ * Note that this function is experimental. Embedders should not rely on
114
+ * this existing. We may remove this function in the future.
115
+ */
116
+ V8_WARN_UNUSED_RESULT bool Experimental_IsNopFunction() const;
117
+
109
118
  ScriptOrigin GetScriptOrigin() const;
110
119
  V8_INLINE static Function* Cast(Value* value) {
111
120
  #ifdef V8_ENABLE_CHECKS
@@ -100,9 +100,6 @@ class V8_EXPORT V8 {
100
100
  const int kBuildConfiguration =
101
101
  (internal::PointerCompressionIsEnabled() ? kPointerCompression : 0) |
102
102
  (internal::SmiValuesAre31Bits() ? k31BitSmis : 0) |
103
- (internal::SandboxedExternalPointersAreEnabled()
104
- ? kSandboxedExternalPointers
105
- : 0) |
106
103
  (internal::SandboxIsEnabled() ? kSandbox : 0);
107
104
  return Initialize(kBuildConfiguration);
108
105
  }
@@ -184,30 +181,19 @@ class V8_EXPORT V8 {
184
181
  * V8 was disposed.
185
182
  */
186
183
  static void DisposePlatform();
187
- V8_DEPRECATED("Use DisposePlatform()")
188
- static void ShutdownPlatform() { DisposePlatform(); }
189
-
190
- #ifdef V8_SANDBOX
191
- //
192
- // Sandbox related API.
193
- //
194
- // This API is not yet stable and subject to changes in the future.
195
- //
196
184
 
185
+ #if defined(V8_ENABLE_SANDBOX)
197
186
  /**
198
- * Initializes the V8 sandbox.
199
- *
200
- * This must be invoked after the platform was initialized but before V8 is
201
- * initialized. The sandbox is torn down during platform shutdown.
202
- * Returns true on success, false otherwise.
187
+ * Returns true if the sandbox is configured securely.
203
188
  *
204
- * TODO(saelo) Once it is no longer optional to initialize the sandbox when
205
- * compiling with V8_SANDBOX, the sandbox initialization will likely happen
206
- * as part of V8::Initialize, at which point this function should be removed.
189
+ * If V8 cannot create a regular sandbox during initialization, for example
190
+ * because not enough virtual address space can be reserved, it will instead
191
+ * create a fallback sandbox that still allows it to function normally but
192
+ * does not have the same security properties as a regular sandbox. This API
193
+ * can be used to determine if such a fallback sandbox is being used, in
194
+ * which case it will return false.
207
195
  */
208
- static bool InitializeSandbox();
209
- V8_DEPRECATE_SOON("Use InitializeSandbox()")
210
- static bool InitializeVirtualMemoryCage() { return InitializeSandbox(); }
196
+ static bool IsSandboxConfiguredSecurely();
211
197
 
212
198
  /**
213
199
  * Provides access to the virtual address subspace backing the sandbox.
@@ -220,39 +206,29 @@ class V8_EXPORT V8 {
220
206
  * and so in particular the contents of pages allocagted in this virtual
221
207
  * address space, arbitrarily and concurrently. Due to this, it is
222
208
  * recommended to to only place pure data buffers in them.
223
- *
224
- * This function must only be called after initializing the sandbox.
225
209
  */
226
210
  static VirtualAddressSpace* GetSandboxAddressSpace();
227
- V8_DEPRECATE_SOON("Use GetSandboxAddressSpace()")
228
- static PageAllocator* GetVirtualMemoryCagePageAllocator();
229
211
 
230
212
  /**
231
213
  * Returns the size of the sandbox in bytes.
232
214
  *
233
- * If the sandbox has not been initialized, or if the initialization failed,
234
- * this returns zero.
215
+ * This represents the size of the address space that V8 can directly address
216
+ * and in which it allocates its objects.
235
217
  */
236
218
  static size_t GetSandboxSizeInBytes();
237
- V8_DEPRECATE_SOON("Use GetSandboxSizeInBytes()")
238
- static size_t GetVirtualMemoryCageSizeInBytes() {
239
- return GetSandboxSizeInBytes();
240
- }
241
219
 
242
220
  /**
243
- * Returns whether the sandbox is configured securely.
221
+ * Returns the size of the address space reservation backing the sandbox.
244
222
  *
245
- * If V8 cannot create a proper sandbox, it will fall back to creating a
246
- * sandbox that doesn't have the desired security properties but at least
247
- * still allows V8 to function. This API can be used to determine if such an
248
- * insecure sandbox is being used, in which case it will return false.
223
+ * This may be larger than the sandbox (i.e. |GetSandboxSizeInBytes()|) due
224
+ * to surrounding guard regions, or may be smaller than the sandbox in case a
225
+ * fallback sandbox is being used, which will use a smaller virtual address
226
+ * space reservation. In the latter case this will also be different from
227
+ * |GetSandboxAddressSpace()->size()| as that will cover a larger part of the
228
+ * address space than what has actually been reserved.
249
229
  */
250
- static bool IsSandboxConfiguredSecurely();
251
- V8_DEPRECATE_SOON("Use IsSandboxConfiguredSecurely()")
252
- static bool IsUsingSecureVirtualMemoryCage() {
253
- return IsSandboxConfiguredSecurely();
254
- }
255
- #endif
230
+ static size_t GetSandboxReservationSizeInBytes();
231
+ #endif // V8_ENABLE_SANDBOX
256
232
 
257
233
  /**
258
234
  * Activate trap-based bounds checking for WebAssembly.
@@ -273,7 +249,7 @@ class V8_EXPORT V8 {
273
249
  * exceptions in V8-generated code.
274
250
  */
275
251
  static void SetUnhandledExceptionCallback(
276
- UnhandledExceptionCallback unhandled_exception_callback);
252
+ UnhandledExceptionCallback callback);
277
253
  #endif
278
254
 
279
255
  /**
@@ -281,8 +257,7 @@ class V8_EXPORT V8 {
281
257
  * v8 has encountered a fatal failure to allocate memory and is about to
282
258
  * terminate.
283
259
  */
284
-
285
- static void SetFatalMemoryErrorCallback(OOMErrorCallback oom_error_callback);
260
+ static void SetFatalMemoryErrorCallback(OOMErrorCallback callback);
286
261
 
287
262
  /**
288
263
  * Get statistics about the shared memory usage.
@@ -295,8 +270,7 @@ class V8_EXPORT V8 {
295
270
  enum BuildConfigurationFeatures {
296
271
  kPointerCompression = 1 << 0,
297
272
  k31BitSmis = 1 << 1,
298
- kSandboxedExternalPointers = 1 << 2,
299
- kSandbox = 1 << 3,
273
+ kSandbox = 1 << 2,
300
274
  };
301
275
 
302
276
  /**
@@ -32,19 +32,19 @@ namespace Debugger {
32
32
  namespace API {
33
33
  class SearchMatch;
34
34
  }
35
- }
35
+ } // namespace Debugger
36
36
  namespace Runtime {
37
37
  namespace API {
38
38
  class RemoteObject;
39
39
  class StackTrace;
40
40
  class StackTraceId;
41
- }
42
- }
41
+ } // namespace API
42
+ } // namespace Runtime
43
43
  namespace Schema {
44
44
  namespace API {
45
45
  class Domain;
46
46
  }
47
- }
47
+ } // namespace Schema
48
48
  } // namespace protocol
49
49
 
50
50
  class V8_EXPORT StringView {
@@ -134,6 +134,13 @@ class V8_EXPORT V8DebuggerId {
134
134
  int64_t m_second = 0;
135
135
  };
136
136
 
137
+ struct V8_EXPORT V8StackFrame {
138
+ StringView sourceURL;
139
+ StringView functionName;
140
+ int lineNumber;
141
+ int columnNumber;
142
+ };
143
+
137
144
  class V8_EXPORT V8StackTrace {
138
145
  public:
139
146
  virtual StringView firstNonEmptySourceURL() const = 0;
@@ -151,6 +158,8 @@ class V8_EXPORT V8StackTrace {
151
158
 
152
159
  // Safe to pass between threads, drops async chain.
153
160
  virtual std::unique_ptr<V8StackTrace> clone() = 0;
161
+
162
+ virtual std::vector<V8StackFrame> frames() const = 0;
154
163
  };
155
164
 
156
165
  class V8_EXPORT V8InspectorSession {
@@ -203,14 +212,17 @@ class V8_EXPORT V8InspectorSession {
203
212
  std::unique_ptr<StringBuffer>* objectGroup) = 0;
204
213
  virtual void releaseObjectGroup(StringView) = 0;
205
214
  virtual void triggerPreciseCoverageDeltaUpdate(StringView occasion) = 0;
215
+
216
+ // Prepare for shutdown (disables debugger pausing, etc.).
217
+ virtual void stop() = 0;
206
218
  };
207
219
 
208
220
  class V8_EXPORT WebDriverValue {
209
221
  public:
210
- explicit WebDriverValue(StringView type, v8::MaybeLocal<v8::Value> value = {})
211
- : type(type), value(value) {}
212
-
213
- StringView type;
222
+ explicit WebDriverValue(std::unique_ptr<StringBuffer> type,
223
+ v8::MaybeLocal<v8::Value> value = {})
224
+ : type(std::move(type)), value(value) {}
225
+ std::unique_ptr<StringBuffer> type;
214
226
  v8::MaybeLocal<v8::Value> value;
215
227
  };
216
228
 
@@ -219,6 +231,9 @@ class V8_EXPORT V8InspectorClient {
219
231
  virtual ~V8InspectorClient() = default;
220
232
 
221
233
  virtual void runMessageLoopOnPause(int contextGroupId) {}
234
+ virtual void runMessageLoopOnInstrumentationPause(int contextGroupId) {
235
+ runMessageLoopOnPause(contextGroupId);
236
+ }
222
237
  virtual void quitMessageLoopOnPause() {}
223
238
  virtual void runIfWaitingForDebugger(int contextGroupId) {}
224
239
 
@@ -361,9 +376,15 @@ class V8_EXPORT V8Inspector {
361
376
  virtual void sendNotification(std::unique_ptr<StringBuffer> message) = 0;
362
377
  virtual void flushProtocolNotifications() = 0;
363
378
  };
364
- virtual std::unique_ptr<V8InspectorSession> connect(int contextGroupId,
365
- Channel*,
366
- StringView state) = 0;
379
+ enum ClientTrustLevel { kUntrusted, kFullyTrusted };
380
+ enum SessionPauseState { kWaitingForDebugger, kNotWaitingForDebugger };
381
+ // TODO(chromium:1352175): remove default value once downstream change lands.
382
+ virtual std::unique_ptr<V8InspectorSession> connect(
383
+ int contextGroupId, Channel*, StringView state,
384
+ ClientTrustLevel client_trust_level,
385
+ SessionPauseState = kNotWaitingForDebugger) {
386
+ return nullptr;
387
+ }
367
388
 
368
389
  // API methods.
369
390
  virtual std::unique_ptr<V8StackTrace> createStackTrace(