-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcdp_runtime.ml
More file actions
504 lines (380 loc) · 19.3 KB
/
Copy pathcdp_runtime.ml
File metadata and controls
504 lines (380 loc) · 19.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
(* Generated by cdp-gen from Chrome DevTools Protocol r1687809. DO NOT EDIT. *)
include Cdp_runtime_types
open Jsonkit.Primitives
module Await_promise = struct
let name = "Runtime.awaitPromise"
type params = {
promise_object_id : Cdp_base.Runtime.Remote_object_id.t; [@key "promiseObjectId"]
return_by_value : bool option; [@key "returnByValue"] [@option] [@json.drop_default]
generate_preview : bool option; [@key "generatePreview"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = {
result : remote_object; [@key "result"]
exception_details : exception_details option; [@key "exceptionDetails"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Call_function_on = struct
let name = "Runtime.callFunctionOn"
type params = {
function_declaration : string; [@key "functionDeclaration"]
object_id : Cdp_base.Runtime.Remote_object_id.t option; [@key "objectId"] [@option] [@json.drop_default]
arguments : call_argument list option; [@key "arguments"] [@option] [@json.drop_default]
silent : bool option; [@key "silent"] [@option] [@json.drop_default]
return_by_value : bool option; [@key "returnByValue"] [@option] [@json.drop_default]
generate_preview : bool option; [@key "generatePreview"] [@option] [@json.drop_default]
user_gesture : bool option; [@key "userGesture"] [@option] [@json.drop_default]
await_promise : bool option; [@key "awaitPromise"] [@option] [@json.drop_default]
execution_context_id : Cdp_base.Runtime.Execution_context_id.t option;
[@key "executionContextId"] [@option] [@json.drop_default]
object_group : string option; [@key "objectGroup"] [@option] [@json.drop_default]
throw_on_side_effect : bool option; [@key "throwOnSideEffect"] [@option] [@json.drop_default]
unique_context_id : string option; [@key "uniqueContextId"] [@option] [@json.drop_default]
serialization_options : serialization_options option; [@key "serializationOptions"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = {
result : remote_object; [@key "result"]
exception_details : exception_details option; [@key "exceptionDetails"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Compile_script = struct
let name = "Runtime.compileScript"
type params = {
expression : string; [@key "expression"]
source_url : string; [@key "sourceURL"]
persist_script : bool; [@key "persistScript"]
execution_context_id : Cdp_base.Runtime.Execution_context_id.t option;
[@key "executionContextId"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = {
script_id : Cdp_base.Runtime.Script_id.t option; [@key "scriptId"] [@option] [@json.drop_default]
exception_details : exception_details option; [@key "exceptionDetails"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Disable = struct
let name = "Runtime.disable"
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
module Discard_console_entries = struct
let name = "Runtime.discardConsoleEntries"
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
module Enable = struct
let name = "Runtime.enable"
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
module Evaluate = struct
let name = "Runtime.evaluate"
type params = {
expression : string; [@key "expression"]
object_group : string option; [@key "objectGroup"] [@option] [@json.drop_default]
include_command_line_api : bool option; [@key "includeCommandLineAPI"] [@option] [@json.drop_default]
silent : bool option; [@key "silent"] [@option] [@json.drop_default]
context_id : Cdp_base.Runtime.Execution_context_id.t option; [@key "contextId"] [@option] [@json.drop_default]
return_by_value : bool option; [@key "returnByValue"] [@option] [@json.drop_default]
generate_preview : bool option; [@key "generatePreview"] [@option] [@json.drop_default]
user_gesture : bool option; [@key "userGesture"] [@option] [@json.drop_default]
await_promise : bool option; [@key "awaitPromise"] [@option] [@json.drop_default]
throw_on_side_effect : bool option; [@key "throwOnSideEffect"] [@option] [@json.drop_default]
timeout : Cdp_base.Runtime.Time_delta.t option; [@key "timeout"] [@option] [@json.drop_default]
disable_breaks : bool option; [@key "disableBreaks"] [@option] [@json.drop_default]
repl_mode : bool option; [@key "replMode"] [@option] [@json.drop_default]
allow_unsafe_eval_blocked_by_csp : bool option; [@key "allowUnsafeEvalBlockedByCSP"] [@option] [@json.drop_default]
unique_context_id : string option; [@key "uniqueContextId"] [@option] [@json.drop_default]
serialization_options : serialization_options option; [@key "serializationOptions"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = {
result : remote_object; [@key "result"]
exception_details : exception_details option; [@key "exceptionDetails"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Get_isolate_id = struct
let name = "Runtime.getIsolateId"
type result = { id : string [@key "id"] } [@@allow_extra_fields] [@@deriving json, show, eq]
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Get_heap_usage = struct
let name = "Runtime.getHeapUsage"
type result = {
used_size : float; [@key "usedSize"]
total_size : float; [@key "totalSize"]
embedder_heap_used_size : float; [@key "embedderHeapUsedSize"]
backing_storage_size : float; [@key "backingStorageSize"]
}
[@@allow_extra_fields] [@@deriving json, show, eq]
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Get_properties = struct
let name = "Runtime.getProperties"
type params = {
object_id : Cdp_base.Runtime.Remote_object_id.t; [@key "objectId"]
own_properties : bool option; [@key "ownProperties"] [@option] [@json.drop_default]
accessor_properties_only : bool option; [@key "accessorPropertiesOnly"] [@option] [@json.drop_default]
generate_preview : bool option; [@key "generatePreview"] [@option] [@json.drop_default]
non_indexed_properties_only : bool option; [@key "nonIndexedPropertiesOnly"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = {
result : property_descriptor list; [@key "result"]
internal_properties : internal_property_descriptor list option;
[@key "internalProperties"] [@option] [@json.drop_default]
private_properties : private_property_descriptor list option;
[@key "privateProperties"] [@option] [@json.drop_default]
exception_details : exception_details option; [@key "exceptionDetails"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Global_lexical_scope_names = struct
let name = "Runtime.globalLexicalScopeNames"
type params = {
execution_context_id : Cdp_base.Runtime.Execution_context_id.t option;
[@key "executionContextId"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = { names : string list [@key "names"] } [@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Query_objects = struct
let name = "Runtime.queryObjects"
type params = {
prototype_object_id : Cdp_base.Runtime.Remote_object_id.t; [@key "prototypeObjectId"]
object_group : string option; [@key "objectGroup"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = { objects : remote_object [@key "objects"] } [@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Release_object = struct
let name = "Runtime.releaseObject"
type params = { object_id : Cdp_base.Runtime.Remote_object_id.t [@key "objectId"] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Release_object_group = struct
let name = "Runtime.releaseObjectGroup"
type params = { object_group : string [@key "objectGroup"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Run_if_waiting_for_debugger = struct
let name = "Runtime.runIfWaitingForDebugger"
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
module Run_script = struct
let name = "Runtime.runScript"
type params = {
script_id : Cdp_base.Runtime.Script_id.t; [@key "scriptId"]
execution_context_id : Cdp_base.Runtime.Execution_context_id.t option;
[@key "executionContextId"] [@option] [@json.drop_default]
object_group : string option; [@key "objectGroup"] [@option] [@json.drop_default]
silent : bool option; [@key "silent"] [@option] [@json.drop_default]
include_command_line_api : bool option; [@key "includeCommandLineAPI"] [@option] [@json.drop_default]
return_by_value : bool option; [@key "returnByValue"] [@option] [@json.drop_default]
generate_preview : bool option; [@key "generatePreview"] [@option] [@json.drop_default]
await_promise : bool option; [@key "awaitPromise"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = {
result : remote_object; [@key "result"]
exception_details : exception_details option; [@key "exceptionDetails"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_async_call_stack_depth = struct
let name = "Runtime.setAsyncCallStackDepth"
type params = { max_depth : int [@key "maxDepth"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Set_custom_object_formatter_enabled = struct
let name = "Runtime.setCustomObjectFormatterEnabled"
type params = { enabled : bool [@key "enabled"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Set_max_call_stack_size_to_capture = struct
let name = "Runtime.setMaxCallStackSizeToCapture"
type params = { size : int [@key "size"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Terminate_execution = struct
let name = "Runtime.terminateExecution"
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command : result Cdp_command.t = { Cdp_command.name; params = None; parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Add_binding = struct
let name = "Runtime.addBinding"
type params = {
name : string; [@key "name"]
execution_context_id : Cdp_base.Runtime.Execution_context_id.t option;
[@key "executionContextId"] [@option] [@json.drop_default]
execution_context_name : string option; [@key "executionContextName"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Remove_binding = struct
let name = "Runtime.removeBinding"
type params = { name : string [@key "name"] } [@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = unit [@@deriving show, eq]
let result_of_json (_ignored_payload : Cdp_json.t) : result = ()
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
module Get_exception_details = struct
let name = "Runtime.getExceptionDetails"
type params = { error_object_id : Cdp_base.Runtime.Remote_object_id.t [@key "errorObjectId"] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
type result = {
exception_details : exception_details option; [@key "exceptionDetails"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq]
let command params : result Cdp_command.t =
{ Cdp_command.name; params = Some (params_to_json params); parse = result_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Binding_called = struct
let name = "Runtime.bindingCalled"
type params = {
name : string; [@key "name"]
payload : string; [@key "payload"]
execution_context_id : Cdp_base.Runtime.Execution_context_id.t; [@key "executionContextId"]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
let event : params Cdp_event.t = { Cdp_event.name; parse = params_of_json }
end
[@@alert experimental "experimental in CDP, may change with Chrome"]
module Console_api_called = struct
let name = "Runtime.consoleAPICalled"
type type_ =
| Log [@json.name "log"]
| Debug [@json.name "debug"]
| Info [@json.name "info"]
| Error_ [@json.name "error"]
| Warning [@json.name "warning"]
| Dir [@json.name "dir"]
| Dirxml [@json.name "dirxml"]
| Table [@json.name "table"]
| Trace [@json.name "trace"]
| Clear [@json.name "clear"]
| StartGroup [@json.name "startGroup"]
| StartGroupCollapsed [@json.name "startGroupCollapsed"]
| EndGroup [@json.name "endGroup"]
| Assert [@json.name "assert"]
| Profile [@json.name "profile"]
| ProfileEnd [@json.name "profileEnd"]
| Count [@json.name "count"]
| TimeEnd [@json.name "timeEnd"]
| Other of Cdp_json.unknown [@json.catch_all]
[@@compact_variants] [@@deriving json, show, eq]
type params = {
type_ : type_; [@key "type"]
args : remote_object list; [@key "args"]
execution_context_id : Cdp_base.Runtime.Execution_context_id.t; [@key "executionContextId"]
timestamp : Cdp_base.Runtime.Timestamp.t; [@key "timestamp"]
stack_trace : stack_trace option; [@key "stackTrace"] [@option] [@json.drop_default]
context : string option; [@key "context"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
let event : params Cdp_event.t = { Cdp_event.name; parse = params_of_json }
end
module Exception_revoked = struct
let name = "Runtime.exceptionRevoked"
type params = {
reason : string; [@key "reason"]
exception_id : int; [@key "exceptionId"]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
let event : params Cdp_event.t = { Cdp_event.name; parse = params_of_json }
end
module Exception_thrown = struct
let name = "Runtime.exceptionThrown"
type params = {
timestamp : Cdp_base.Runtime.Timestamp.t; [@key "timestamp"]
exception_details : exception_details; [@key "exceptionDetails"]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
let event : params Cdp_event.t = { Cdp_event.name; parse = params_of_json }
end
module Execution_context_created = struct
let name = "Runtime.executionContextCreated"
type params = { context : execution_context_description [@key "context"] }
[@@allow_extra_fields] [@@deriving json, show, eq, make]
let event : params Cdp_event.t = { Cdp_event.name; parse = params_of_json }
end
module Execution_context_destroyed = struct
let name = "Runtime.executionContextDestroyed"
type params = {
execution_context_id : Cdp_base.Runtime.Execution_context_id.t; [@key "executionContextId"]
execution_context_unique_id : string; [@key "executionContextUniqueId"]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
let event : params Cdp_event.t = { Cdp_event.name; parse = params_of_json }
end
module Execution_contexts_cleared = struct
let name = "Runtime.executionContextsCleared"
type params = unit [@@deriving show, eq]
let params_of_json (_ignored_payload : Cdp_json.t) : params = ()
let event : params Cdp_event.t = { Cdp_event.name; parse = params_of_json }
end
module Inspect_requested = struct
let name = "Runtime.inspectRequested"
type params = {
object_ : remote_object; [@key "object"]
hints : Cdp_json.t; [@key "hints"]
execution_context_id : Cdp_base.Runtime.Execution_context_id.t option;
[@key "executionContextId"] [@option] [@json.drop_default]
}
[@@allow_extra_fields] [@@deriving json, show, eq, make]
let event : params Cdp_event.t = { Cdp_event.name; parse = params_of_json }
end