libv8-node 15.14.0.1-aarch64-linux-musl → 18.8.0.0-aarch64-linux-musl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/ext/libv8-node/location.rb +1 -1
  3. data/ext/libv8-node/paths.rb +5 -1
  4. data/lib/libv8/node/version.rb +3 -3
  5. data/vendor/v8/{out.gn → aarch64-linux-musl}/libv8/obj/libv8_monolith.a +0 -0
  6. data/vendor/v8/include/cppgc/allocation.h +184 -47
  7. data/vendor/v8/include/cppgc/common.h +9 -6
  8. data/vendor/v8/include/cppgc/cross-thread-persistent.h +465 -0
  9. data/vendor/v8/include/cppgc/custom-space.h +37 -2
  10. data/vendor/v8/include/cppgc/default-platform.h +40 -49
  11. data/vendor/v8/include/cppgc/ephemeron-pair.h +30 -0
  12. data/vendor/v8/include/cppgc/explicit-management.h +100 -0
  13. data/vendor/v8/include/cppgc/garbage-collected.h +19 -29
  14. data/vendor/v8/include/cppgc/heap-consistency.h +266 -0
  15. data/vendor/v8/include/cppgc/heap-state.h +82 -0
  16. data/vendor/v8/include/cppgc/heap-statistics.h +120 -0
  17. data/vendor/v8/include/cppgc/heap.h +73 -6
  18. data/vendor/v8/include/cppgc/internal/api-constants.h +11 -3
  19. data/vendor/v8/include/cppgc/internal/caged-heap-local-data.h +27 -15
  20. data/vendor/v8/include/cppgc/internal/compiler-specific.h +2 -2
  21. data/vendor/v8/include/cppgc/internal/finalizer-trait.h +4 -1
  22. data/vendor/v8/include/cppgc/internal/gc-info.h +124 -13
  23. data/vendor/v8/include/cppgc/internal/logging.h +3 -3
  24. data/vendor/v8/include/cppgc/internal/name-trait.h +122 -0
  25. data/vendor/v8/include/cppgc/internal/persistent-node.h +116 -16
  26. data/vendor/v8/include/cppgc/internal/pointer-policies.h +84 -32
  27. data/vendor/v8/include/cppgc/internal/write-barrier.h +392 -35
  28. data/vendor/v8/include/cppgc/liveness-broker.h +11 -2
  29. data/vendor/v8/include/cppgc/macros.h +2 -0
  30. data/vendor/v8/include/cppgc/member.h +91 -26
  31. data/vendor/v8/include/cppgc/name-provider.h +65 -0
  32. data/vendor/v8/include/cppgc/object-size-trait.h +58 -0
  33. data/vendor/v8/include/cppgc/persistent.h +70 -41
  34. data/vendor/v8/include/cppgc/platform.h +52 -26
  35. data/vendor/v8/include/cppgc/prefinalizer.h +36 -13
  36. data/vendor/v8/include/cppgc/process-heap-statistics.h +36 -0
  37. data/vendor/v8/include/cppgc/sentinel-pointer.h +32 -0
  38. data/vendor/v8/include/cppgc/source-location.h +2 -1
  39. data/vendor/v8/include/cppgc/testing.h +106 -0
  40. data/vendor/v8/include/cppgc/trace-trait.h +8 -3
  41. data/vendor/v8/include/cppgc/type-traits.h +163 -32
  42. data/vendor/v8/include/cppgc/visitor.h +194 -28
  43. data/vendor/v8/include/libplatform/libplatform.h +11 -11
  44. data/vendor/v8/include/libplatform/v8-tracing.h +2 -1
  45. data/vendor/v8/include/v8-array-buffer.h +445 -0
  46. data/vendor/v8/include/v8-callbacks.h +397 -0
  47. data/vendor/v8/include/v8-container.h +129 -0
  48. data/vendor/v8/include/v8-context.h +407 -0
  49. data/vendor/v8/include/v8-cppgc.h +151 -159
  50. data/vendor/v8/include/v8-data.h +80 -0
  51. data/vendor/v8/include/v8-date.h +43 -0
  52. data/vendor/v8/include/v8-debug.h +168 -0
  53. data/vendor/v8/include/v8-embedder-heap.h +218 -0
  54. data/vendor/v8/include/v8-embedder-state-scope.h +51 -0
  55. data/vendor/v8/include/v8-exception.h +217 -0
  56. data/vendor/v8/include/v8-extension.h +62 -0
  57. data/vendor/v8/include/v8-external.h +37 -0
  58. data/vendor/v8/include/v8-fast-api-calls.h +703 -152
  59. data/vendor/v8/include/v8-forward.h +81 -0
  60. data/vendor/v8/include/v8-function-callback.h +475 -0
  61. data/vendor/v8/include/v8-function.h +125 -0
  62. data/vendor/v8/include/v8-initialization.h +315 -0
  63. data/vendor/v8/include/v8-inspector.h +76 -27
  64. data/vendor/v8/include/v8-internal.h +285 -51
  65. data/vendor/v8/include/v8-isolate.h +1709 -0
  66. data/vendor/v8/include/v8-json.h +47 -0
  67. data/vendor/v8/include/v8-local-handle.h +455 -0
  68. data/vendor/v8/include/v8-locker.h +149 -0
  69. data/vendor/v8/include/v8-maybe.h +137 -0
  70. data/vendor/v8/include/v8-memory-span.h +43 -0
  71. data/vendor/v8/include/v8-message.h +216 -0
  72. data/vendor/v8/include/v8-metrics.h +131 -9
  73. data/vendor/v8/include/v8-microtask-queue.h +152 -0
  74. data/vendor/v8/include/v8-microtask.h +28 -0
  75. data/vendor/v8/include/v8-object.h +775 -0
  76. data/vendor/v8/include/v8-persistent-handle.h +590 -0
  77. data/vendor/v8/include/v8-platform.h +433 -25
  78. data/vendor/v8/include/v8-primitive-object.h +118 -0
  79. data/vendor/v8/include/v8-primitive.h +866 -0
  80. data/vendor/v8/include/v8-profiler.h +149 -10
  81. data/vendor/v8/include/v8-promise.h +174 -0
  82. data/vendor/v8/include/v8-proxy.h +50 -0
  83. data/vendor/v8/include/v8-regexp.h +105 -0
  84. data/vendor/v8/include/v8-script.h +747 -0
  85. data/vendor/v8/include/v8-snapshot.h +196 -0
  86. data/vendor/v8/include/v8-statistics.h +217 -0
  87. data/vendor/v8/include/v8-template.h +1079 -0
  88. data/vendor/v8/include/v8-traced-handle.h +420 -0
  89. data/vendor/v8/include/v8-typed-array.h +282 -0
  90. data/vendor/v8/include/v8-unwinder-state.h +31 -0
  91. data/vendor/v8/include/v8-unwinder.h +132 -0
  92. data/vendor/v8/include/v8-util.h +8 -2
  93. data/vendor/v8/include/v8-value-serializer-version.h +1 -1
  94. data/vendor/v8/include/v8-value-serializer.h +279 -0
  95. data/vendor/v8/include/v8-value.h +526 -0
  96. data/vendor/v8/include/v8-version.h +4 -4
  97. data/vendor/v8/include/v8-wasm.h +257 -0
  98. data/vendor/v8/include/v8-weak-callback-info.h +87 -0
  99. data/vendor/v8/include/v8.h +41 -12051
  100. data/vendor/v8/include/v8config.h +142 -21
  101. metadata +64 -10
  102. data/vendor/v8/include/cppgc/internal/prefinalizer-handler.h +0 -30
  103. data/vendor/v8/include/cppgc/internal/process-heap.h +0 -34
@@ -0,0 +1,315 @@
1
+ // Copyright 2021 the V8 project authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef INCLUDE_V8_INITIALIZATION_H_
6
+ #define INCLUDE_V8_INITIALIZATION_H_
7
+
8
+ #include <stddef.h>
9
+ #include <stdint.h>
10
+
11
+ #include "v8-callbacks.h" // NOLINT(build/include_directory)
12
+ #include "v8-internal.h" // NOLINT(build/include_directory)
13
+ #include "v8-isolate.h" // NOLINT(build/include_directory)
14
+ #include "v8-platform.h" // NOLINT(build/include_directory)
15
+ #include "v8config.h" // NOLINT(build/include_directory)
16
+
17
+ // We reserve the V8_* prefix for macros defined in V8 public API and
18
+ // assume there are no name conflicts with the embedder's code.
19
+
20
+ /**
21
+ * The v8 JavaScript engine.
22
+ */
23
+ namespace v8 {
24
+
25
+ class PageAllocator;
26
+ class Platform;
27
+ template <class K, class V, class T>
28
+ class PersistentValueMapBase;
29
+
30
+ /**
31
+ * EntropySource is used as a callback function when v8 needs a source
32
+ * of entropy.
33
+ */
34
+ using EntropySource = bool (*)(unsigned char* buffer, size_t length);
35
+
36
+ /**
37
+ * ReturnAddressLocationResolver is used as a callback function when v8 is
38
+ * resolving the location of a return address on the stack. Profilers that
39
+ * change the return address on the stack can use this to resolve the stack
40
+ * location to wherever the profiler stashed the original return address.
41
+ *
42
+ * \param return_addr_location A location on stack where a machine
43
+ * return address resides.
44
+ * \returns Either return_addr_location, or else a pointer to the profiler's
45
+ * copy of the original return address.
46
+ *
47
+ * \note The resolver function must not cause garbage collection.
48
+ */
49
+ using ReturnAddressLocationResolver =
50
+ uintptr_t (*)(uintptr_t return_addr_location);
51
+
52
+ using DcheckErrorCallback = void (*)(const char* file, int line,
53
+ const char* message);
54
+
55
+ /**
56
+ * Container class for static utility functions.
57
+ */
58
+ class V8_EXPORT V8 {
59
+ public:
60
+ /**
61
+ * Hand startup data to V8, in case the embedder has chosen to build
62
+ * V8 with external startup data.
63
+ *
64
+ * Note:
65
+ * - By default the startup data is linked into the V8 library, in which
66
+ * case this function is not meaningful.
67
+ * - If this needs to be called, it needs to be called before V8
68
+ * tries to make use of its built-ins.
69
+ * - To avoid unnecessary copies of data, V8 will point directly into the
70
+ * given data blob, so pretty please keep it around until V8 exit.
71
+ * - Compression of the startup blob might be useful, but needs to
72
+ * handled entirely on the embedders' side.
73
+ * - The call will abort if the data is invalid.
74
+ */
75
+ static void SetSnapshotDataBlob(StartupData* startup_blob);
76
+
77
+ /** Set the callback to invoke in case of Dcheck failures. */
78
+ static void SetDcheckErrorHandler(DcheckErrorCallback that);
79
+
80
+ /**
81
+ * Sets V8 flags from a string.
82
+ */
83
+ static void SetFlagsFromString(const char* str);
84
+ static void SetFlagsFromString(const char* str, size_t length);
85
+
86
+ /**
87
+ * Sets V8 flags from the command line.
88
+ */
89
+ static void SetFlagsFromCommandLine(int* argc, char** argv,
90
+ bool remove_flags);
91
+
92
+ /** Get the version string. */
93
+ static const char* GetVersion();
94
+
95
+ /**
96
+ * Initializes V8. This function needs to be called before the first Isolate
97
+ * is created. It always returns true.
98
+ */
99
+ V8_INLINE static bool Initialize() {
100
+ const int kBuildConfiguration =
101
+ (internal::PointerCompressionIsEnabled() ? kPointerCompression : 0) |
102
+ (internal::SmiValuesAre31Bits() ? k31BitSmis : 0) |
103
+ (internal::SandboxedExternalPointersAreEnabled()
104
+ ? kSandboxedExternalPointers
105
+ : 0) |
106
+ (internal::SandboxIsEnabled() ? kSandbox : 0);
107
+ return Initialize(kBuildConfiguration);
108
+ }
109
+
110
+ /**
111
+ * Allows the host application to provide a callback which can be used
112
+ * as a source of entropy for random number generators.
113
+ */
114
+ static void SetEntropySource(EntropySource source);
115
+
116
+ /**
117
+ * Allows the host application to provide a callback that allows v8 to
118
+ * cooperate with a profiler that rewrites return addresses on stack.
119
+ */
120
+ static void SetReturnAddressLocationResolver(
121
+ ReturnAddressLocationResolver return_address_resolver);
122
+
123
+ /**
124
+ * Releases any resources used by v8 and stops any utility threads
125
+ * that may be running. Note that disposing v8 is permanent, it
126
+ * cannot be reinitialized.
127
+ *
128
+ * It should generally not be necessary to dispose v8 before exiting
129
+ * a process, this should happen automatically. It is only necessary
130
+ * to use if the process needs the resources taken up by v8.
131
+ */
132
+ static bool Dispose();
133
+
134
+ /**
135
+ * Initialize the ICU library bundled with V8. The embedder should only
136
+ * invoke this method when using the bundled ICU. Returns true on success.
137
+ *
138
+ * If V8 was compiled with the ICU data in an external file, the location
139
+ * of the data file has to be provided.
140
+ */
141
+ static bool InitializeICU(const char* icu_data_file = nullptr);
142
+
143
+ /**
144
+ * Initialize the ICU library bundled with V8. The embedder should only
145
+ * invoke this method when using the bundled ICU. If V8 was compiled with
146
+ * the ICU data in an external file and when the default location of that
147
+ * file should be used, a path to the executable must be provided.
148
+ * Returns true on success.
149
+ *
150
+ * The default is a file called icudtl.dat side-by-side with the executable.
151
+ *
152
+ * Optionally, the location of the data file can be provided to override the
153
+ * default.
154
+ */
155
+ static bool InitializeICUDefaultLocation(const char* exec_path,
156
+ const char* icu_data_file = nullptr);
157
+
158
+ /**
159
+ * Initialize the external startup data. The embedder only needs to
160
+ * invoke this method when external startup data was enabled in a build.
161
+ *
162
+ * If V8 was compiled with the startup data in an external file, then
163
+ * V8 needs to be given those external files during startup. There are
164
+ * three ways to do this:
165
+ * - InitializeExternalStartupData(const char*)
166
+ * This will look in the given directory for the file "snapshot_blob.bin".
167
+ * - InitializeExternalStartupDataFromFile(const char*)
168
+ * As above, but will directly use the given file name.
169
+ * - Call SetSnapshotDataBlob.
170
+ * This will read the blobs from the given data structure and will
171
+ * not perform any file IO.
172
+ */
173
+ static void InitializeExternalStartupData(const char* directory_path);
174
+ static void InitializeExternalStartupDataFromFile(const char* snapshot_blob);
175
+
176
+ /**
177
+ * Sets the v8::Platform to use. This should be invoked before V8 is
178
+ * initialized.
179
+ */
180
+ static void InitializePlatform(Platform* platform);
181
+
182
+ /**
183
+ * Clears all references to the v8::Platform. This should be invoked after
184
+ * V8 was disposed.
185
+ */
186
+ 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
+
197
+ /**
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.
203
+ *
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.
207
+ */
208
+ static bool InitializeSandbox();
209
+ V8_DEPRECATE_SOON("Use InitializeSandbox()")
210
+ static bool InitializeVirtualMemoryCage() { return InitializeSandbox(); }
211
+
212
+ /**
213
+ * Provides access to the virtual address subspace backing the sandbox.
214
+ *
215
+ * This can be used to allocate pages inside the sandbox, for example to
216
+ * obtain virtual memory for ArrayBuffer backing stores, which must be
217
+ * located inside the sandbox.
218
+ *
219
+ * It should be assumed that an attacker can corrupt data inside the sandbox,
220
+ * and so in particular the contents of pages allocagted in this virtual
221
+ * address space, arbitrarily and concurrently. Due to this, it is
222
+ * recommended to to only place pure data buffers in them.
223
+ *
224
+ * This function must only be called after initializing the sandbox.
225
+ */
226
+ static VirtualAddressSpace* GetSandboxAddressSpace();
227
+ V8_DEPRECATE_SOON("Use GetSandboxAddressSpace()")
228
+ static PageAllocator* GetVirtualMemoryCagePageAllocator();
229
+
230
+ /**
231
+ * Returns the size of the sandbox in bytes.
232
+ *
233
+ * If the sandbox has not been initialized, or if the initialization failed,
234
+ * this returns zero.
235
+ */
236
+ static size_t GetSandboxSizeInBytes();
237
+ V8_DEPRECATE_SOON("Use GetSandboxSizeInBytes()")
238
+ static size_t GetVirtualMemoryCageSizeInBytes() {
239
+ return GetSandboxSizeInBytes();
240
+ }
241
+
242
+ /**
243
+ * Returns whether the sandbox is configured securely.
244
+ *
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.
249
+ */
250
+ static bool IsSandboxConfiguredSecurely();
251
+ V8_DEPRECATE_SOON("Use IsSandboxConfiguredSecurely()")
252
+ static bool IsUsingSecureVirtualMemoryCage() {
253
+ return IsSandboxConfiguredSecurely();
254
+ }
255
+ #endif
256
+
257
+ /**
258
+ * Activate trap-based bounds checking for WebAssembly.
259
+ *
260
+ * \param use_v8_signal_handler Whether V8 should install its own signal
261
+ * handler or rely on the embedder's.
262
+ */
263
+ static bool EnableWebAssemblyTrapHandler(bool use_v8_signal_handler);
264
+
265
+ #if defined(V8_OS_WIN)
266
+ /**
267
+ * On Win64, by default V8 does not emit unwinding data for jitted code,
268
+ * which means the OS cannot walk the stack frames and the system Structured
269
+ * Exception Handling (SEH) cannot unwind through V8-generated code:
270
+ * https://code.google.com/p/v8/issues/detail?id=3598.
271
+ *
272
+ * This function allows embedders to register a custom exception handler for
273
+ * exceptions in V8-generated code.
274
+ */
275
+ static void SetUnhandledExceptionCallback(
276
+ UnhandledExceptionCallback unhandled_exception_callback);
277
+ #endif
278
+
279
+ /**
280
+ * Allows the host application to provide a callback that will be called when
281
+ * v8 has encountered a fatal failure to allocate memory and is about to
282
+ * terminate.
283
+ */
284
+
285
+ static void SetFatalMemoryErrorCallback(OOMErrorCallback oom_error_callback);
286
+
287
+ /**
288
+ * Get statistics about the shared memory usage.
289
+ */
290
+ static void GetSharedMemoryStatistics(SharedMemoryStatistics* statistics);
291
+
292
+ private:
293
+ V8();
294
+
295
+ enum BuildConfigurationFeatures {
296
+ kPointerCompression = 1 << 0,
297
+ k31BitSmis = 1 << 1,
298
+ kSandboxedExternalPointers = 1 << 2,
299
+ kSandbox = 1 << 3,
300
+ };
301
+
302
+ /**
303
+ * Checks that the embedder build configuration is compatible with
304
+ * the V8 binary and if so initializes V8.
305
+ */
306
+ static bool Initialize(int build_config);
307
+
308
+ friend class Context;
309
+ template <class K, class V, class T>
310
+ friend class PersistentValueMapBase;
311
+ };
312
+
313
+ } // namespace v8
314
+
315
+ #endif // INCLUDE_V8_INITIALIZATION_H_
@@ -6,15 +6,27 @@
6
6
  #define V8_V8_INSPECTOR_H_
7
7
 
8
8
  #include <stdint.h>
9
- #include <cctype>
10
9
 
10
+ #include <cctype>
11
11
  #include <memory>
12
- #include <unordered_map>
13
12
 
14
- #include "v8.h" // NOLINT(build/include_directory)
13
+ #include "v8-isolate.h" // NOLINT(build/include_directory)
14
+ #include "v8-local-handle.h" // NOLINT(build/include_directory)
15
+
16
+ namespace v8 {
17
+ class Context;
18
+ class Name;
19
+ class Object;
20
+ class StackTrace;
21
+ class Value;
22
+ } // namespace v8
15
23
 
16
24
  namespace v8_inspector {
17
25
 
26
+ namespace internal {
27
+ class V8DebuggerId;
28
+ } // namespace internal
29
+
18
30
  namespace protocol {
19
31
  namespace Debugger {
20
32
  namespace API {
@@ -98,6 +110,30 @@ class V8_EXPORT V8ContextInfo {
98
110
  V8ContextInfo& operator=(const V8ContextInfo&) = delete;
99
111
  };
100
112
 
113
+ // This debugger id tries to be unique by generating two random
114
+ // numbers, which should most likely avoid collisions.
115
+ // Debugger id has a 1:1 mapping to context group. It is used to
116
+ // attribute stack traces to a particular debugging, when doing any
117
+ // cross-debugger operations (e.g. async step in).
118
+ // See also Runtime.UniqueDebuggerId in the protocol.
119
+ class V8_EXPORT V8DebuggerId {
120
+ public:
121
+ V8DebuggerId() = default;
122
+ V8DebuggerId(const V8DebuggerId&) = default;
123
+ V8DebuggerId& operator=(const V8DebuggerId&) = default;
124
+
125
+ std::unique_ptr<StringBuffer> toString() const;
126
+ bool isValid() const;
127
+ std::pair<int64_t, int64_t> pair() const;
128
+
129
+ private:
130
+ friend class internal::V8DebuggerId;
131
+ explicit V8DebuggerId(std::pair<int64_t, int64_t>);
132
+
133
+ int64_t m_first = 0;
134
+ int64_t m_second = 0;
135
+ };
136
+
101
137
  class V8_EXPORT V8StackTrace {
102
138
  public:
103
139
  virtual StringView firstNonEmptySourceURL() const = 0;
@@ -105,13 +141,11 @@ class V8_EXPORT V8StackTrace {
105
141
  virtual StringView topSourceURL() const = 0;
106
142
  virtual int topLineNumber() const = 0;
107
143
  virtual int topColumnNumber() const = 0;
108
- virtual StringView topScriptId() const = 0;
144
+ virtual int topScriptId() const = 0;
109
145
  virtual StringView topFunctionName() const = 0;
110
146
 
111
147
  virtual ~V8StackTrace() = default;
112
148
  virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
113
- buildInspectorObject() const = 0;
114
- virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
115
149
  buildInspectorObject(int maxAsyncDepth) const = 0;
116
150
  virtual std::unique_ptr<StringBuffer> toString() const = 0;
117
151
 
@@ -129,6 +163,10 @@ class V8_EXPORT V8InspectorSession {
129
163
  virtual v8::Local<v8::Value> get(v8::Local<v8::Context>) = 0;
130
164
  virtual ~Inspectable() = default;
131
165
  };
166
+ class V8_EXPORT CommandLineAPIScope {
167
+ public:
168
+ virtual ~CommandLineAPIScope() = default;
169
+ };
132
170
  virtual void addInspectedObject(std::unique_ptr<Inspectable>) = 0;
133
171
 
134
172
  // Dispatching protocol messages.
@@ -138,6 +176,9 @@ class V8_EXPORT V8InspectorSession {
138
176
  virtual std::vector<std::unique_ptr<protocol::Schema::API::Domain>>
139
177
  supportedDomains() = 0;
140
178
 
179
+ virtual std::unique_ptr<V8InspectorSession::CommandLineAPIScope>
180
+ initializeCommandLineAPIScope(int executionContextId) = 0;
181
+
141
182
  // Debugger actions.
142
183
  virtual void schedulePauseOnNextStatement(StringView breakReason,
143
184
  StringView breakDetails) = 0;
@@ -161,7 +202,16 @@ class V8_EXPORT V8InspectorSession {
161
202
  v8::Local<v8::Context>*,
162
203
  std::unique_ptr<StringBuffer>* objectGroup) = 0;
163
204
  virtual void releaseObjectGroup(StringView) = 0;
164
- virtual void triggerPreciseCoverageDeltaUpdate(StringView occassion) = 0;
205
+ virtual void triggerPreciseCoverageDeltaUpdate(StringView occasion) = 0;
206
+ };
207
+
208
+ class V8_EXPORT WebDriverValue {
209
+ public:
210
+ explicit WebDriverValue(StringView type, v8::MaybeLocal<v8::Value> value = {})
211
+ : type(type), value(value) {}
212
+
213
+ StringView type;
214
+ v8::MaybeLocal<v8::Value> value;
165
215
  };
166
216
 
167
217
  class V8_EXPORT V8InspectorClient {
@@ -178,11 +228,16 @@ class V8_EXPORT V8InspectorClient {
178
228
  virtual void beginUserGesture() {}
179
229
  virtual void endUserGesture() {}
180
230
 
231
+ virtual std::unique_ptr<WebDriverValue> serializeToWebDriverValue(
232
+ v8::Local<v8::Value> v8_value, int max_depth) {
233
+ return nullptr;
234
+ }
181
235
  virtual std::unique_ptr<StringBuffer> valueSubtype(v8::Local<v8::Value>) {
182
236
  return nullptr;
183
237
  }
184
- virtual bool formatAccessorsAsProperties(v8::Local<v8::Value>) {
185
- return false;
238
+ virtual std::unique_ptr<StringBuffer> descriptionForValueSubtype(
239
+ v8::Local<v8::Context>, v8::Local<v8::Value>) {
240
+ return nullptr;
186
241
  }
187
242
  virtual bool isInspectableHeapObject(v8::Local<v8::Object>) { return true; }
188
243
 
@@ -224,6 +279,13 @@ class V8_EXPORT V8InspectorClient {
224
279
  const StringView& resourceName) {
225
280
  return nullptr;
226
281
  }
282
+
283
+ // The caller would defer to generating a random 64 bit integer if
284
+ // this method returns 0.
285
+ virtual int64_t generateUniqueId() { return 0; }
286
+
287
+ virtual void dispatchError(v8::Local<v8::Context>, v8::Local<v8::Message>,
288
+ v8::Local<v8::Value>) {}
227
289
  };
228
290
 
229
291
  // These stack trace ids are intended to be passed between debuggers and be
@@ -258,6 +320,7 @@ class V8_EXPORT V8Inspector {
258
320
  virtual void contextDestroyed(v8::Local<v8::Context>) = 0;
259
321
  virtual void resetContextGroup(int contextGroupId) = 0;
260
322
  virtual v8::MaybeLocal<v8::Context> contextById(int contextId) = 0;
323
+ virtual V8DebuggerId uniqueDebuggerId(int contextId) = 0;
261
324
 
262
325
  // Various instrumentation.
263
326
  virtual void idleStarted() = 0;
@@ -284,6 +347,10 @@ class V8_EXPORT V8Inspector {
284
347
  int scriptId) = 0;
285
348
  virtual void exceptionRevoked(v8::Local<v8::Context>, unsigned exceptionId,
286
349
  StringView message) = 0;
350
+ virtual bool associateExceptionData(v8::Local<v8::Context>,
351
+ v8::Local<v8::Value> exception,
352
+ v8::Local<v8::Name> key,
353
+ v8::Local<v8::Value> value) = 0;
287
354
 
288
355
  // Connection.
289
356
  class V8_EXPORT Channel {
@@ -302,24 +369,6 @@ class V8_EXPORT V8Inspector {
302
369
  virtual std::unique_ptr<V8StackTrace> createStackTrace(
303
370
  v8::Local<v8::StackTrace>) = 0;
304
371
  virtual std::unique_ptr<V8StackTrace> captureStackTrace(bool fullStack) = 0;
305
-
306
- // Performance counters.
307
- class V8_EXPORT Counters : public std::enable_shared_from_this<Counters> {
308
- public:
309
- explicit Counters(v8::Isolate* isolate);
310
- ~Counters();
311
- const std::unordered_map<std::string, int>& getCountersMap() const {
312
- return m_countersMap;
313
- }
314
-
315
- private:
316
- static int* getCounterPtr(const char* name);
317
-
318
- v8::Isolate* m_isolate;
319
- std::unordered_map<std::string, int> m_countersMap;
320
- };
321
-
322
- virtual std::shared_ptr<Counters> enableCounters() = 0;
323
372
  };
324
373
 
325
374
  } // namespace v8_inspector