-
Notifications
You must be signed in to change notification settings - Fork 81
/
js_protocol.pdl
1806 lines (1647 loc) · 67 KB
/
js_protocol.pdl
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
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
version
major 1
minor 3
# This domain is deprecated - use Runtime or Log instead.
deprecated domain Console
depends on Runtime
# Console message.
type ConsoleMessage extends object
properties
# Message source.
enum source
xml
javascript
network
console-api
storage
appcache
rendering
security
other
deprecation
worker
# Message severity.
enum level
log
warning
error
debug
info
# Message text.
string text
# URL of the message origin.
optional string url
# Line number in the resource that generated this message (1-based).
optional integer line
# Column number in the resource that generated this message (1-based).
optional integer column
# Does nothing.
command clearMessages
# Disables console domain, prevents further console messages from being reported to the client.
command disable
# Enables console domain, sends the messages collected so far to the client by means of the
# `messageAdded` notification.
command enable
# Issued when new console message is added.
event messageAdded
parameters
# Console message that has been added.
ConsoleMessage message
# Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing
# breakpoints, stepping through execution, exploring stack traces, etc.
domain Debugger
depends on Runtime
# Breakpoint identifier.
type BreakpointId extends string
# Call frame identifier.
type CallFrameId extends string
# Location in the source code.
type Location extends object
properties
# Script identifier as reported in the `Debugger.scriptParsed`.
Runtime.ScriptId scriptId
# Line number in the script (0-based).
integer lineNumber
# Column number in the script (0-based).
optional integer columnNumber
# Location in the source code.
experimental type ScriptPosition extends object
properties
integer lineNumber
integer columnNumber
# Location range within one script.
experimental type LocationRange extends object
properties
Runtime.ScriptId scriptId
ScriptPosition start
ScriptPosition end
# JavaScript call frame. Array of call frames form the call stack.
type CallFrame extends object
properties
# Call frame identifier. This identifier is only valid while the virtual machine is paused.
CallFrameId callFrameId
# Name of the JavaScript function called on this call frame.
string functionName
# Location in the source code.
optional Location functionLocation
# Location in the source code.
Location location
# JavaScript script name or url.
# Deprecated in favor of using the `location.scriptId` to resolve the URL via a previously
# sent `Debugger.scriptParsed` event.
deprecated string url
# Scope chain for this call frame.
array of Scope scopeChain
# `this` object for this call frame.
Runtime.RemoteObject this
# The value being returned, if the function is at return point.
optional Runtime.RemoteObject returnValue
# Valid only while the VM is paused and indicates whether this frame
# can be restarted or not. Note that a `true` value here does not
# guarantee that Debugger#restartFrame with this CallFrameId will be
# successful, but it is very likely.
experimental optional boolean canBeRestarted
# Scope description.
type Scope extends object
properties
# Scope type.
enum type
global
local
with
closure
catch
block
script
eval
module
wasm-expression-stack
# Object representing the scope. For `global` and `with` scopes it represents the actual
# object; for the rest of the scopes, it is artificial transient object enumerating scope
# variables as its properties.
Runtime.RemoteObject object
optional string name
# Location in the source code where scope starts
optional Location startLocation
# Location in the source code where scope ends
optional Location endLocation
# Search match for resource.
type SearchMatch extends object
properties
# Line number in resource content.
number lineNumber
# Line with match content.
string lineContent
type BreakLocation extends object
properties
# Script identifier as reported in the `Debugger.scriptParsed`.
Runtime.ScriptId scriptId
# Line number in the script (0-based).
integer lineNumber
# Column number in the script (0-based).
optional integer columnNumber
optional enum type
debuggerStatement
call
return
# Continues execution until specific location is reached.
command continueToLocation
parameters
# Location to continue to.
Location location
optional enum targetCallFrames
any
current
# Disables debugger for given page.
command disable
# Enables debugger for the given page. Clients should not assume that the debugging has been
# enabled until the result for this command is received.
command enable
parameters
# The maximum size in bytes of collected scripts (not referenced by other heap objects)
# the debugger can hold. Puts no limit if parameter is omitted.
experimental optional number maxScriptsCacheSize
returns
# Unique identifier of the debugger.
experimental Runtime.UniqueDebuggerId debuggerId
# Evaluates expression on a given call frame.
command evaluateOnCallFrame
parameters
# Call frame identifier to evaluate on.
CallFrameId callFrameId
# Expression to evaluate.
string expression
# String object group name to put result into (allows rapid releasing resulting object handles
# using `releaseObjectGroup`).
optional string objectGroup
# Specifies whether command line API should be available to the evaluated expression, defaults
# to false.
optional boolean includeCommandLineAPI
# In silent mode exceptions thrown during evaluation are not reported and do not pause
# execution. Overrides `setPauseOnException` state.
optional boolean silent
# Whether the result is expected to be a JSON object that should be sent by value.
optional boolean returnByValue
# Whether preview should be generated for the result.
experimental optional boolean generatePreview
# Whether to throw an exception if side effect cannot be ruled out during evaluation.
optional boolean throwOnSideEffect
# Terminate execution after timing out (number of milliseconds).
experimental optional Runtime.TimeDelta timeout
returns
# Object wrapper for the evaluation result.
Runtime.RemoteObject result
# Exception details.
optional Runtime.ExceptionDetails exceptionDetails
# Returns possible locations for breakpoint. scriptId in start and end range locations should be
# the same.
command getPossibleBreakpoints
parameters
# Start of range to search possible breakpoint locations in.
Location start
# End of range to search possible breakpoint locations in (excluding). When not specified, end
# of scripts is used as end of range.
optional Location end
# Only consider locations which are in the same (non-nested) function as start.
optional boolean restrictToFunction
returns
# List of the possible breakpoint locations.
array of BreakLocation locations
# Returns source for the script with given id.
command getScriptSource
parameters
# Id of the script to get source for.
Runtime.ScriptId scriptId
returns
# Script source (empty in case of Wasm bytecode).
string scriptSource
# Wasm bytecode.
optional binary bytecode
experimental type WasmDisassemblyChunk extends object
properties
# The next chunk of disassembled lines.
array of string lines
# The bytecode offsets describing the start of each line.
array of integer bytecodeOffsets
experimental command disassembleWasmModule
parameters
# Id of the script to disassemble
Runtime.ScriptId scriptId
returns
# For large modules, return a stream from which additional chunks of
# disassembly can be read successively.
optional string streamId
# The total number of lines in the disassembly text.
integer totalNumberOfLines
# The offsets of all function bodies, in the format [start1, end1,
# start2, end2, ...] where all ends are exclusive.
array of integer functionBodyOffsets
# The first chunk of disassembly.
WasmDisassemblyChunk chunk
# Disassemble the next chunk of lines for the module corresponding to the
# stream. If disassembly is complete, this API will invalidate the streamId
# and return an empty chunk. Any subsequent calls for the now invalid stream
# will return errors.
experimental command nextWasmDisassemblyChunk
parameters
string streamId
returns
# The next chunk of disassembly.
WasmDisassemblyChunk chunk
# This command is deprecated. Use getScriptSource instead.
deprecated command getWasmBytecode
parameters
# Id of the Wasm script to get source for.
Runtime.ScriptId scriptId
returns
# Script source.
binary bytecode
# Returns stack trace with given `stackTraceId`.
experimental command getStackTrace
parameters
Runtime.StackTraceId stackTraceId
returns
Runtime.StackTrace stackTrace
# Stops on the next JavaScript statement.
command pause
experimental deprecated command pauseOnAsyncCall
parameters
# Debugger will pause when async call with given stack trace is started.
Runtime.StackTraceId parentStackTraceId
# Removes JavaScript breakpoint.
command removeBreakpoint
parameters
BreakpointId breakpointId
# Restarts particular call frame from the beginning. The old, deprecated
# behavior of `restartFrame` is to stay paused and allow further CDP commands
# after a restart was scheduled. This can cause problems with restarting, so
# we now continue execution immediatly after it has been scheduled until we
# reach the beginning of the restarted frame.
#
# To stay back-wards compatible, `restartFrame` now expects a `mode`
# parameter to be present. If the `mode` parameter is missing, `restartFrame`
# errors out.
#
# The various return values are deprecated and `callFrames` is always empty.
# Use the call frames from the `Debugger#paused` events instead, that fires
# once V8 pauses at the beginning of the restarted function.
command restartFrame
parameters
# Call frame identifier to evaluate on.
CallFrameId callFrameId
# The `mode` parameter must be present and set to 'StepInto', otherwise
# `restartFrame` will error out.
experimental optional enum mode
# Pause at the beginning of the restarted function
StepInto
returns
# New stack trace.
deprecated array of CallFrame callFrames
# Async stack trace, if any.
deprecated optional Runtime.StackTrace asyncStackTrace
# Async stack trace, if any.
deprecated optional Runtime.StackTraceId asyncStackTraceId
# Resumes JavaScript execution.
command resume
parameters
# Set to true to terminate execution upon resuming execution. In contrast
# to Runtime.terminateExecution, this will allows to execute further
# JavaScript (i.e. via evaluation) until execution of the paused code
# is actually resumed, at which point termination is triggered.
# If execution is currently not paused, this parameter has no effect.
optional boolean terminateOnResume
# Searches for given string in script content.
command searchInContent
parameters
# Id of the script to search in.
Runtime.ScriptId scriptId
# String to search for.
string query
# If true, search is case sensitive.
optional boolean caseSensitive
# If true, treats string parameter as regex.
optional boolean isRegex
returns
# List of search matches.
array of SearchMatch result
# Enables or disables async call stacks tracking.
command setAsyncCallStackDepth
parameters
# Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async
# call stacks (default).
integer maxDepth
# Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in
# scripts with url matching one of the patterns. VM will try to leave blackboxed script by
# performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
experimental command setBlackboxPatterns
parameters
# Array of regexps that will be used to check script url for blackbox state.
array of string patterns
# Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted
# scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
# Positions array contains positions where blackbox state is changed. First interval isn't
# blackboxed. Array should be sorted.
experimental command setBlackboxedRanges
parameters
# Id of the script.
Runtime.ScriptId scriptId
array of ScriptPosition positions
# Sets JavaScript breakpoint at a given location.
command setBreakpoint
parameters
# Location to set breakpoint in.
Location location
# Expression to use as a breakpoint condition. When specified, debugger will only stop on the
# breakpoint if this expression evaluates to true.
optional string condition
returns
# Id of the created breakpoint for further reference.
BreakpointId breakpointId
# Location this breakpoint resolved into.
Location actualLocation
# Sets instrumentation breakpoint.
command setInstrumentationBreakpoint
parameters
# Instrumentation name.
enum instrumentation
beforeScriptExecution
beforeScriptWithSourceMapExecution
returns
# Id of the created breakpoint for further reference.
BreakpointId breakpointId
# Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this
# command is issued, all existing parsed scripts will have breakpoints resolved and returned in
# `locations` property. Further matching script parsing will result in subsequent
# `breakpointResolved` events issued. This logical breakpoint will survive page reloads.
command setBreakpointByUrl
parameters
# Line number to set breakpoint at.
integer lineNumber
# URL of the resources to set breakpoint on.
optional string url
# Regex pattern for the URLs of the resources to set breakpoints on. Either `url` or
# `urlRegex` must be specified.
optional string urlRegex
# Script hash of the resources to set breakpoint on.
optional string scriptHash
# Offset in the line to set breakpoint at.
optional integer columnNumber
# Expression to use as a breakpoint condition. When specified, debugger will only stop on the
# breakpoint if this expression evaluates to true.
optional string condition
returns
# Id of the created breakpoint for further reference.
BreakpointId breakpointId
# List of the locations this breakpoint resolved into upon addition.
array of Location locations
# Sets JavaScript breakpoint before each call to the given function.
# If another function was created from the same source as a given one,
# calling it will also trigger the breakpoint.
experimental command setBreakpointOnFunctionCall
parameters
# Function object id.
Runtime.RemoteObjectId objectId
# Expression to use as a breakpoint condition. When specified, debugger will
# stop on the breakpoint if this expression evaluates to true.
optional string condition
returns
# Id of the created breakpoint for further reference.
BreakpointId breakpointId
# Activates / deactivates all breakpoints on the page.
command setBreakpointsActive
parameters
# New value for breakpoints active state.
boolean active
# Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions,
# or caught exceptions, no exceptions. Initial pause on exceptions state is `none`.
command setPauseOnExceptions
parameters
# Pause on exceptions mode.
enum state
none
caught
uncaught
all
# Changes return value in top frame. Available only at return break position.
experimental command setReturnValue
parameters
# New return value.
Runtime.CallArgument newValue
# Edits JavaScript source live.
#
# In general, functions that are currently on the stack can not be edited with
# a single exception: If the edited function is the top-most stack frame and
# that is the only activation of that function on the stack. In this case
# the live edit will be successful and a `Debugger.restartFrame` for the
# top-most function is automatically triggered.
command setScriptSource
parameters
# Id of the script to edit.
Runtime.ScriptId scriptId
# New content of the script.
string scriptSource
# If true the change will not actually be applied. Dry run may be used to get result
# description without actually modifying the code.
optional boolean dryRun
# If true, then `scriptSource` is allowed to change the function on top of the stack
# as long as the top-most stack frame is the only activation of that function.
experimental optional boolean allowTopFrameEditing
returns
# New stack trace in case editing has happened while VM was stopped.
deprecated optional array of CallFrame callFrames
# Whether current call stack was modified after applying the changes.
deprecated optional boolean stackChanged
# Async stack trace, if any.
deprecated optional Runtime.StackTrace asyncStackTrace
# Async stack trace, if any.
deprecated optional Runtime.StackTraceId asyncStackTraceId
# Whether the operation was successful or not. Only `Ok` denotes a
# successful live edit while the other enum variants denote why
# the live edit failed.
experimental enum status
Ok
CompileError
BlockedByActiveGenerator
BlockedByActiveFunction
BlockedByTopLevelEsModuleChange
# Exception details if any. Only present when `status` is `CompileError`.
optional Runtime.ExceptionDetails exceptionDetails
# Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
command setSkipAllPauses
parameters
# New value for skip pauses state.
boolean skip
# Changes value of variable in a callframe. Object-based scopes are not supported and must be
# mutated manually.
command setVariableValue
parameters
# 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'
# scope types are allowed. Other scopes could be manipulated manually.
integer scopeNumber
# Variable name.
string variableName
# New variable value.
Runtime.CallArgument newValue
# Id of callframe that holds variable.
CallFrameId callFrameId
# Steps into the function call.
command stepInto
parameters
# Debugger will pause on the execution of the first async task which was scheduled
# before next pause.
experimental optional boolean breakOnAsyncCall
# The skipList specifies location ranges that should be skipped on step into.
experimental optional array of LocationRange skipList
# Steps out of the function call.
command stepOut
# Steps over the statement.
command stepOver
parameters
# The skipList specifies location ranges that should be skipped on step over.
experimental optional array of LocationRange skipList
# Fired when breakpoint is resolved to an actual script and location.
event breakpointResolved
parameters
# Breakpoint unique identifier.
BreakpointId breakpointId
# Actual breakpoint location.
Location location
# Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
event paused
parameters
# Call stack the virtual machine stopped on.
array of CallFrame callFrames
# Pause reason.
enum reason
ambiguous
assert
CSPViolation
debugCommand
DOM
EventListener
exception
instrumentation
OOM
other
promiseRejection
XHR
step
# Object containing break-specific auxiliary properties.
optional object data
# Hit breakpoints IDs
optional array of string hitBreakpoints
# Async stack trace, if any.
optional Runtime.StackTrace asyncStackTrace
# Async stack trace, if any.
experimental optional Runtime.StackTraceId asyncStackTraceId
# Never present, will be removed.
experimental deprecated optional Runtime.StackTraceId asyncCallStackTraceId
# Fired when the virtual machine resumed execution.
event resumed
# Enum of possible script languages.
type ScriptLanguage extends string
enum
JavaScript
WebAssembly
# Debug symbols available for a wasm script.
type DebugSymbols extends object
properties
# Type of the debug symbols.
enum type
None
SourceMap
EmbeddedDWARF
ExternalDWARF
# URL of the external symbol source.
optional string externalURL
# Fired when virtual machine fails to parse the script.
event scriptFailedToParse
parameters
# Identifier of the script parsed.
Runtime.ScriptId scriptId
# URL or name of the script parsed (if any).
string url
# Line offset of the script within the resource with given URL (for script tags).
integer startLine
# Column offset of the script within the resource with given URL.
integer startColumn
# Last line of the script.
integer endLine
# Length of the last line of the script.
integer endColumn
# Specifies script creation context.
Runtime.ExecutionContextId executionContextId
# Content hash of the script, SHA-256.
string hash
# Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}
optional object executionContextAuxData
# URL of source map associated with script (if any).
optional string sourceMapURL
# True, if this script has sourceURL.
optional boolean hasSourceURL
# True, if this script is ES6 module.
optional boolean isModule
# This script length.
optional integer length
# JavaScript top stack frame of where the script parsed event was triggered if available.
experimental optional Runtime.StackTrace stackTrace
# If the scriptLanguage is WebAssembly, the code section offset in the module.
experimental optional integer codeOffset
# The language of the script.
experimental optional Debugger.ScriptLanguage scriptLanguage
# The name the embedder supplied for this script.
experimental optional string embedderName
# Fired when virtual machine parses script. This event is also fired for all known and uncollected
# scripts upon enabling debugger.
event scriptParsed
parameters
# Identifier of the script parsed.
Runtime.ScriptId scriptId
# URL or name of the script parsed (if any).
string url
# Line offset of the script within the resource with given URL (for script tags).
integer startLine
# Column offset of the script within the resource with given URL.
integer startColumn
# Last line of the script.
integer endLine
# Length of the last line of the script.
integer endColumn
# Specifies script creation context.
Runtime.ExecutionContextId executionContextId
# Content hash of the script, SHA-256.
string hash
# Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}
optional object executionContextAuxData
# True, if this script is generated as a result of the live edit operation.
experimental optional boolean isLiveEdit
# URL of source map associated with script (if any).
optional string sourceMapURL
# True, if this script has sourceURL.
optional boolean hasSourceURL
# True, if this script is ES6 module.
optional boolean isModule
# This script length.
optional integer length
# JavaScript top stack frame of where the script parsed event was triggered if available.
experimental optional Runtime.StackTrace stackTrace
# If the scriptLanguage is WebAssembly, the code section offset in the module.
experimental optional integer codeOffset
# The language of the script.
experimental optional Debugger.ScriptLanguage scriptLanguage
# If the scriptLanguage is WebASsembly, the source of debug symbols for the module.
experimental optional Debugger.DebugSymbols debugSymbols
# The name the embedder supplied for this script.
experimental optional string embedderName
experimental domain HeapProfiler
depends on Runtime
# Heap snapshot object id.
type HeapSnapshotObjectId extends string
# Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.
type SamplingHeapProfileNode extends object
properties
# Function location.
Runtime.CallFrame callFrame
# Allocations size in bytes for the node excluding children.
number selfSize
# Node id. Ids are unique across all profiles collected between startSampling and stopSampling.
integer id
# Child nodes.
array of SamplingHeapProfileNode children
# A single sample from a sampling profile.
type SamplingHeapProfileSample extends object
properties
# Allocation size in bytes attributed to the sample.
number size
# Id of the corresponding profile tree node.
integer nodeId
# Time-ordered sample ordinal number. It is unique across all profiles retrieved
# between startSampling and stopSampling.
number ordinal
# Sampling profile.
type SamplingHeapProfile extends object
properties
SamplingHeapProfileNode head
array of SamplingHeapProfileSample samples
# Enables console to refer to the node with given id via $x (see Command Line API for more details
# $x functions).
command addInspectedHeapObject
parameters
# Heap snapshot object id to be accessible by means of $x command line API.
HeapSnapshotObjectId heapObjectId
command collectGarbage
command disable
command enable
command getHeapObjectId
parameters
# Identifier of the object to get heap object id for.
Runtime.RemoteObjectId objectId
returns
# Id of the heap snapshot object corresponding to the passed remote object id.
HeapSnapshotObjectId heapSnapshotObjectId
command getObjectByHeapObjectId
parameters
HeapSnapshotObjectId objectId
# Symbolic group name that can be used to release multiple objects.
optional string objectGroup
returns
# Evaluation result.
Runtime.RemoteObject result
command getSamplingProfile
returns
# Return the sampling profile being collected.
SamplingHeapProfile profile
command startSampling
parameters
# Average sample interval in bytes. Poisson distribution is used for the intervals. The
# default value is 32768 bytes.
optional number samplingInterval
# By default, the sampling heap profiler reports only objects which are
# still alive when the profile is returned via getSamplingProfile or
# stopSampling, which is useful for determining what functions contribute
# the most to steady-state memory usage. This flag instructs the sampling
# heap profiler to also include information about objects discarded by
# major GC, which will show which functions cause large temporary memory
# usage or long GC pauses.
optional boolean includeObjectsCollectedByMajorGC
# By default, the sampling heap profiler reports only objects which are
# still alive when the profile is returned via getSamplingProfile or
# stopSampling, which is useful for determining what functions contribute
# the most to steady-state memory usage. This flag instructs the sampling
# heap profiler to also include information about objects discarded by
# minor GC, which is useful when tuning a latency-sensitive application
# for minimal GC activity.
optional boolean includeObjectsCollectedByMinorGC
command startTrackingHeapObjects
parameters
optional boolean trackAllocations
command stopSampling
returns
# Recorded sampling heap profile.
SamplingHeapProfile profile
command stopTrackingHeapObjects
parameters
# If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken
# when the tracking is stopped.
optional boolean reportProgress
# Deprecated in favor of `exposeInternals`.
deprecated optional boolean treatGlobalObjectsAsRoots
# If true, numerical values are included in the snapshot
optional boolean captureNumericValue
# If true, exposes internals of the snapshot.
experimental optional boolean exposeInternals
command takeHeapSnapshot
parameters
# If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
optional boolean reportProgress
# If true, a raw snapshot without artificial roots will be generated.
# Deprecated in favor of `exposeInternals`.
deprecated optional boolean treatGlobalObjectsAsRoots
# If true, numerical values are included in the snapshot
optional boolean captureNumericValue
# If true, exposes internals of the snapshot.
experimental optional boolean exposeInternals
event addHeapSnapshotChunk
parameters
string chunk
# If heap objects tracking has been started then backend may send update for one or more fragments
event heapStatsUpdate
parameters
# An array of triplets. Each triplet describes a fragment. The first integer is the fragment
# index, the second integer is a total count of objects for the fragment, the third integer is
# a total size of the objects for the fragment.
array of integer statsUpdate
# If heap objects tracking has been started then backend regularly sends a current value for last
# seen object id and corresponding timestamp. If the were changes in the heap since last event
# then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
event lastSeenObjectId
parameters
integer lastSeenObjectId
number timestamp
event reportHeapSnapshotProgress
parameters
integer done
integer total
optional boolean finished
event resetProfiles
domain Profiler
depends on Runtime
depends on Debugger
# Profile node. Holds callsite information, execution statistics and child nodes.
type ProfileNode extends object
properties
# Unique id of the node.
integer id
# Function location.
Runtime.CallFrame callFrame
# Number of samples where this node was on top of the call stack.
optional integer hitCount
# Child node ids.
optional array of integer children
# The reason of being not optimized. The function may be deoptimized or marked as don't
# optimize.
optional string deoptReason
# An array of source position ticks.
optional array of PositionTickInfo positionTicks
# Profile.
type Profile extends object
properties
# The list of profile nodes. First item is the root node.
array of ProfileNode nodes
# Profiling start timestamp in microseconds.
number startTime
# Profiling end timestamp in microseconds.
number endTime
# Ids of samples top nodes.
optional array of integer samples
# Time intervals between adjacent samples in microseconds. The first delta is relative to the
# profile startTime.
optional array of integer timeDeltas
# Specifies a number of samples attributed to a certain source position.
type PositionTickInfo extends object
properties
# Source line number (1-based).
integer line
# Number of samples attributed to the source line.
integer ticks
# Coverage data for a source range.
type CoverageRange extends object
properties
# JavaScript script source offset for the range start.
integer startOffset
# JavaScript script source offset for the range end.
integer endOffset
# Collected execution count of the source range.
integer count
# Coverage data for a JavaScript function.
type FunctionCoverage extends object
properties
# JavaScript function name.
string functionName
# Source ranges inside the function with coverage data.
array of CoverageRange ranges
# Whether coverage data for this function has block granularity.
boolean isBlockCoverage
# Coverage data for a JavaScript script.
type ScriptCoverage extends object
properties
# JavaScript script id.
Runtime.ScriptId scriptId
# JavaScript script name or url.
string url
# Functions contained in the script that has coverage data.
array of FunctionCoverage functions
command disable
command enable
# Collect coverage data for the current isolate. The coverage data may be incomplete due to
# garbage collection.
command getBestEffortCoverage
returns
# Coverage data for the current isolate.
array of ScriptCoverage result
# Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
command setSamplingInterval
parameters
# New sampling interval in microseconds.
integer interval
command start
# Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code
# coverage may be incomplete. Enabling prevents running optimized code and resets execution
# counters.
command startPreciseCoverage
parameters
# Collect accurate call counts beyond simple 'covered' or 'not covered'.
optional boolean callCount
# Collect block-based coverage.
optional boolean detailed
# Allow the backend to send updates on its own initiative
optional boolean allowTriggeredUpdates
returns
# Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
number timestamp
command stop
returns
# Recorded profile.
Profile profile
# Disable precise code coverage. Disabling releases unnecessary execution count records and allows
# executing optimized code.
command stopPreciseCoverage
# Collect coverage data for the current isolate, and resets execution counters. Precise code
# coverage needs to have started.
command takePreciseCoverage
returns
# Coverage data for the current isolate.
array of ScriptCoverage result
# Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
number timestamp
event consoleProfileFinished
parameters
string id
# Location of console.profileEnd().
Debugger.Location location
Profile profile
# Profile title passed as an argument to console.profile().
optional string title
# Sent when new profile recording is started using console.profile() call.
event consoleProfileStarted
parameters
string id
# Location of console.profile().
Debugger.Location location
# Profile title passed as an argument to console.profile().
optional string title
# Reports coverage delta since the last poll (either from an event like this, or from
# `takePreciseCoverage` for the current isolate. May only be sent if precise code
# coverage has been started. This event can be trigged by the embedder to, for example,
# trigger collection of coverage data immediately at a certain point in time.
experimental event preciseCoverageDeltaUpdate
parameters
# Monotonically increasing time (in seconds) when the coverage update was taken in the backend.