summaryrefslogtreecommitdiff
path: root/deps/v8/src/inspector
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/inspector')
-rw-r--r--deps/v8/src/inspector/BUILD.gn15
-rw-r--r--deps/v8/src/inspector/DEPS3
-rw-r--r--deps/v8/src/inspector/OWNERS8
-rw-r--r--deps/v8/src/inspector/injected-script.cc42
-rw-r--r--deps/v8/src/inspector/inspector_protocol_config.json10
-rw-r--r--deps/v8/src/inspector/js_protocol-1.2.json997
-rw-r--r--deps/v8/src/inspector/js_protocol-1.3.json1205
-rw-r--r--deps/v8/src/inspector/js_protocol.pdl1492
-rw-r--r--deps/v8/src/inspector/string-16.cc17
-rw-r--r--deps/v8/src/inspector/string-16.h15
-rw-r--r--deps/v8/src/inspector/string-util.cc6
-rw-r--r--deps/v8/src/inspector/string-util.h25
-rw-r--r--deps/v8/src/inspector/v8-console-message.cc21
-rw-r--r--deps/v8/src/inspector/v8-console.cc10
-rw-r--r--deps/v8/src/inspector/v8-debugger-agent-impl.cc54
-rw-r--r--deps/v8/src/inspector/v8-debugger-script.cc4
-rw-r--r--deps/v8/src/inspector/v8-debugger.cc3
-rw-r--r--deps/v8/src/inspector/v8-heap-profiler-agent-impl.cc31
-rw-r--r--deps/v8/src/inspector/v8-inspector-session-impl.cc93
-rw-r--r--deps/v8/src/inspector/v8-inspector-session-impl.h3
-rw-r--r--deps/v8/src/inspector/v8-profiler-agent-impl.cc92
-rw-r--r--deps/v8/src/inspector/v8-runtime-agent-impl.cc15
-rw-r--r--deps/v8/src/inspector/v8-schema-agent-impl.cc9
-rw-r--r--deps/v8/src/inspector/v8-stack-trace-impl.cc15
-rw-r--r--deps/v8/src/inspector/v8-stack-trace-impl.h2
-rw-r--r--deps/v8/src/inspector/v8-string-conversions.cc7
-rw-r--r--deps/v8/src/inspector/value-mirror.cc86
27 files changed, 316 insertions, 3964 deletions
diff --git a/deps/v8/src/inspector/BUILD.gn b/deps/v8/src/inspector/BUILD.gn
index 863940ef4b..d39e12c733 100644
--- a/deps/v8/src/inspector/BUILD.gn
+++ b/deps/v8/src/inspector/BUILD.gn
@@ -32,7 +32,7 @@ action("protocol_compatibility") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
script = "$_inspector_protocol/check_protocol_compatibility.py"
inputs = [
- "js_protocol.pdl",
+ v8_inspector_js_protocol,
]
_stamp = "$target_gen_dir/js_protocol.stamp"
outputs = [
@@ -41,7 +41,7 @@ action("protocol_compatibility") {
args = [
"--stamp",
rebase_path(_stamp, root_build_dir),
- rebase_path("js_protocol.pdl", root_build_dir),
+ rebase_path(v8_inspector_js_protocol, root_build_dir),
]
}
@@ -53,10 +53,10 @@ inspector_protocol_generate("protocol_generated_sources") {
inspector_protocol_dir = _inspector_protocol
out_dir = target_gen_dir
- config_file = "inspector_protocol_config.json"
+ config_file = v8_path_prefix + "/src/inspector/inspector_protocol_config.json"
inputs = [
- "js_protocol.pdl",
- "inspector_protocol_config.json",
+ v8_inspector_js_protocol,
+ config_file,
]
outputs = _protocol_generated
}
@@ -65,7 +65,9 @@ config("inspector_config") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
configs = [ "../../:internal_config" ]
- include_dirs = [ "../../include" ]
+ include_dirs = [
+ "../../include",
+ ]
}
v8_header_set("inspector_test_headers") {
@@ -96,6 +98,7 @@ v8_source_set("inspector") {
":inspector_string_conversions",
"../..:v8_version",
"../../third_party/inspector_protocol:encoding",
+ "../../third_party/inspector_protocol:bindings",
]
public_deps = [
diff --git a/deps/v8/src/inspector/DEPS b/deps/v8/src/inspector/DEPS
index 5122d5d997..e5fa06fd54 100644
--- a/deps/v8/src/inspector/DEPS
+++ b/deps/v8/src/inspector/DEPS
@@ -5,11 +5,12 @@ include_rules = [
"+src/base/compiler-specific.h",
"+src/base/logging.h",
"+src/base/macros.h",
+ "+src/base/memory.h",
"+src/base/platform/platform.h",
"+src/base/platform/mutex.h",
"+src/base/safe_conversions.h",
+ "+src/base/template-utils.h",
"+src/base/v8-fallthrough.h",
- "+src/common/v8memory.h",
"+src/numbers/conversions.h",
"+src/inspector",
"+src/tracing",
diff --git a/deps/v8/src/inspector/OWNERS b/deps/v8/src/inspector/OWNERS
index 55f8ac7875..a979205084 100644
--- a/deps/v8/src/inspector/OWNERS
+++ b/deps/v8/src/inspector/OWNERS
@@ -1,5 +1,3 @@
-set noparent
-
alph@chromium.org
caseq@chromium.org
dgozman@chromium.org
@@ -7,12 +5,6 @@ kozyatinskiy@chromium.org
pfeldman@chromium.org
yangguo@chromium.org
-# Changes to remote debugging protocol require devtools review to
-# ensure backwards compatibility and commitment to maintain.
-per-file js_protocol.pdl=set noparent
-per-file js_protocol.pdl=dgozman@chromium.org
-per-file js_protocol.pdl=pfeldman@chromium.org
-
per-file PRESUBMIT.py=file://INFRA_OWNERS
# COMPONENT: Platform>DevTools>JavaScript
diff --git a/deps/v8/src/inspector/injected-script.cc b/deps/v8/src/inspector/injected-script.cc
index e660a61aeb..1edd559e4e 100644
--- a/deps/v8/src/inspector/injected-script.cc
+++ b/deps/v8/src/inspector/injected-script.cc
@@ -284,7 +284,7 @@ Response InjectedScript::getProperties(
int sessionId = m_sessionId;
v8::TryCatch tryCatch(isolate);
- *properties = Array<PropertyDescriptor>::create();
+ *properties = v8::base::make_unique<Array<PropertyDescriptor>>();
std::vector<PropertyMirror> mirrors;
PropertyAccumulator accumulator(&mirrors);
if (!ValueMirror::getProperties(context, object, ownProperties,
@@ -351,7 +351,7 @@ Response InjectedScript::getProperties(
descriptor->setValue(std::move(remoteObject));
descriptor->setWasThrown(true);
}
- (*properties)->addItem(std::move(descriptor));
+ (*properties)->emplace_back(std::move(descriptor));
}
return Response::OK();
}
@@ -362,8 +362,10 @@ Response InjectedScript::getInternalAndPrivateProperties(
internalProperties,
std::unique_ptr<protocol::Array<PrivatePropertyDescriptor>>*
privateProperties) {
- *internalProperties = protocol::Array<InternalPropertyDescriptor>::create();
- *privateProperties = protocol::Array<PrivatePropertyDescriptor>::create();
+ *internalProperties =
+ v8::base::make_unique<Array<InternalPropertyDescriptor>>();
+ *privateProperties =
+ v8::base::make_unique<Array<PrivatePropertyDescriptor>>();
if (!value->IsObject()) return Response::OK();
@@ -384,10 +386,10 @@ Response InjectedScript::getInternalAndPrivateProperties(
groupName, remoteObject.get());
if (!response.isSuccess()) return response;
(*internalProperties)
- ->addItem(InternalPropertyDescriptor::create()
- .setName(internalProperty.name)
- .setValue(std::move(remoteObject))
- .build());
+ ->emplace_back(InternalPropertyDescriptor::create()
+ .setName(internalProperty.name)
+ .setValue(std::move(remoteObject))
+ .build());
}
std::vector<PrivatePropertyMirror> privatePropertyWrappers =
ValueMirror::getPrivateProperties(m_context->context(), value_obj);
@@ -401,10 +403,10 @@ Response InjectedScript::getInternalAndPrivateProperties(
groupName, remoteObject.get());
if (!response.isSuccess()) return response;
(*privateProperties)
- ->addItem(PrivatePropertyDescriptor::create()
- .setName(privateProperty.name)
- .setValue(std::move(remoteObject))
- .build());
+ ->emplace_back(PrivatePropertyDescriptor::create()
+ .setName(privateProperty.name)
+ .setValue(std::move(remoteObject))
+ .build());
}
return Response::OK();
}
@@ -487,7 +489,6 @@ std::unique_ptr<protocol::Runtime::RemoteObject> InjectedScript::wrapTable(
&limit, &limit, &preview);
if (!preview) return nullptr;
- Array<PropertyPreview>* columns = preview->getProperties();
std::unordered_set<String16> selectedColumns;
v8::Local<v8::Array> v8Columns;
if (maybeColumns.ToLocal(&v8Columns)) {
@@ -500,18 +501,17 @@ std::unique_ptr<protocol::Runtime::RemoteObject> InjectedScript::wrapTable(
}
}
if (!selectedColumns.empty()) {
- for (size_t i = 0; i < columns->length(); ++i) {
- ObjectPreview* columnPreview = columns->get(i)->getValuePreview(nullptr);
+ for (const std::unique_ptr<PropertyPreview>& column :
+ *preview->getProperties()) {
+ ObjectPreview* columnPreview = column->getValuePreview(nullptr);
if (!columnPreview) continue;
- std::unique_ptr<Array<PropertyPreview>> filtered =
- Array<PropertyPreview>::create();
- Array<PropertyPreview>* columns = columnPreview->getProperties();
- for (size_t j = 0; j < columns->length(); ++j) {
- PropertyPreview* property = columns->get(j);
+ auto filtered = v8::base::make_unique<Array<PropertyPreview>>();
+ for (const std::unique_ptr<PropertyPreview>& property :
+ *columnPreview->getProperties()) {
if (selectedColumns.find(property->getName()) !=
selectedColumns.end()) {
- filtered->addItem(property->clone());
+ filtered->emplace_back(property->clone());
}
}
columnPreview->setProperties(std::move(filtered));
diff --git a/deps/v8/src/inspector/inspector_protocol_config.json b/deps/v8/src/inspector/inspector_protocol_config.json
index c4aa29ce99..684940c885 100644
--- a/deps/v8/src/inspector/inspector_protocol_config.json
+++ b/deps/v8/src/inspector/inspector_protocol_config.json
@@ -1,6 +1,6 @@
{
"protocol": {
- "path": "js_protocol.pdl",
+ "path": "../../include/js_protocol.pdl",
"package": "src/inspector/protocol",
"output": "protocol",
"namespace": ["v8_inspector", "protocol"],
@@ -44,5 +44,13 @@
"package": "src/inspector/protocol",
"output": "protocol",
"string_header": "src/inspector/string-util.h"
+ },
+
+ "encoding_lib": {
+ "namespace": "v8_inspector_protocol_encoding"
+ },
+
+ "bindings_lib": {
+ "namespace": "v8_inspector_protocol_bindings"
}
}
diff --git a/deps/v8/src/inspector/js_protocol-1.2.json b/deps/v8/src/inspector/js_protocol-1.2.json
deleted file mode 100644
index aff6806222..0000000000
--- a/deps/v8/src/inspector/js_protocol-1.2.json
+++ /dev/null
@@ -1,997 +0,0 @@
-{
- "version": { "major": "1", "minor": "2" },
- "domains": [
- {
- "domain": "Schema",
- "description": "Provides information about the protocol schema.",
- "types": [
- {
- "id": "Domain",
- "type": "object",
- "description": "Description of the protocol domain.",
- "exported": true,
- "properties": [
- { "name": "name", "type": "string", "description": "Domain name." },
- { "name": "version", "type": "string", "description": "Domain version." }
- ]
- }
- ],
- "commands": [
- {
- "name": "getDomains",
- "description": "Returns supported domains.",
- "handlers": ["browser", "renderer"],
- "returns": [
- { "name": "domains", "type": "array", "items": { "$ref": "Domain" }, "description": "List of supported domains." }
- ]
- }
- ]
- },
- {
- "domain": "Runtime",
- "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.",
- "types": [
- {
- "id": "ScriptId",
- "type": "string",
- "description": "Unique script identifier."
- },
- {
- "id": "RemoteObjectId",
- "type": "string",
- "description": "Unique object identifier."
- },
- {
- "id": "UnserializableValue",
- "type": "string",
- "enum": ["Infinity", "NaN", "-Infinity", "-0"],
- "description": "Primitive value which cannot be JSON-stringified."
- },
- {
- "id": "RemoteObject",
- "type": "object",
- "description": "Mirror object referencing original JavaScript object.",
- "exported": true,
- "properties": [
- { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
- { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "iterator", "generator", "error", "proxy", "promise", "typedarray"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
- { "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for <code>object</code> type values only." },
- { "name": "value", "type": "any", "optional": true, "description": "Remote object value in case of primitive values or JSON values (if it was requested)." },
- { "name": "unserializableValue", "$ref": "UnserializableValue", "optional": true, "description": "Primitive value which can not be JSON-stringified does not have <code>value</code>, but gets this property." },
- { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
- { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." },
- { "name": "preview", "$ref": "ObjectPreview", "optional": true, "description": "Preview containing abbreviated property values. Specified for <code>object</code> type values only.", "experimental": true },
- { "name": "customPreview", "$ref": "CustomPreview", "optional": true, "experimental": true}
- ]
- },
- {
- "id": "CustomPreview",
- "type": "object",
- "experimental": true,
- "properties": [
- { "name": "header", "type": "string"},
- { "name": "hasBody", "type": "boolean"},
- { "name": "formatterObjectId", "$ref": "RemoteObjectId"},
- { "name": "bindRemoteObjectFunctionId", "$ref": "RemoteObjectId" },
- { "name": "configObjectId", "$ref": "RemoteObjectId", "optional": true }
- ]
- },
- {
- "id": "ObjectPreview",
- "type": "object",
- "experimental": true,
- "description": "Object containing abbreviated remote object value.",
- "properties": [
- { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
- { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "iterator", "generator", "error"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
- { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
- { "name": "overflow", "type": "boolean", "description": "True iff some of the properties or entries of the original object did not fit." },
- { "name": "properties", "type": "array", "items": { "$ref": "PropertyPreview" }, "description": "List of the properties." },
- { "name": "entries", "type": "array", "items": { "$ref": "EntryPreview" }, "optional": true, "description": "List of the entries. Specified for <code>map</code> and <code>set</code> subtype values only." }
- ]
- },
- {
- "id": "PropertyPreview",
- "type": "object",
- "experimental": true,
- "properties": [
- { "name": "name", "type": "string", "description": "Property name." },
- { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol", "accessor"], "description": "Object type. Accessor means that the property itself is an accessor property." },
- { "name": "value", "type": "string", "optional": true, "description": "User-friendly property value string." },
- { "name": "valuePreview", "$ref": "ObjectPreview", "optional": true, "description": "Nested value preview." },
- { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "iterator", "generator", "error"], "description": "Object subtype hint. Specified for <code>object</code> type values only." }
- ]
- },
- {
- "id": "EntryPreview",
- "type": "object",
- "experimental": true,
- "properties": [
- { "name": "key", "$ref": "ObjectPreview", "optional": true, "description": "Preview of the key. Specified for map-like collection entries." },
- { "name": "value", "$ref": "ObjectPreview", "description": "Preview of the value." }
- ]
- },
- {
- "id": "PropertyDescriptor",
- "type": "object",
- "description": "Object property descriptor.",
- "properties": [
- { "name": "name", "type": "string", "description": "Property name or symbol description." },
- { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." },
- { "name": "writable", "type": "boolean", "optional": true, "description": "True if the value associated with the property may be changed (data descriptors only)." },
- { "name": "get", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only)." },
- { "name": "set", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only)." },
- { "name": "configurable", "type": "boolean", "description": "True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." },
- { "name": "enumerable", "type": "boolean", "description": "True if this property shows up during enumeration of the properties on the corresponding object." },
- { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." },
- { "name": "isOwn", "optional": true, "type": "boolean", "description": "True if the property is owned for the object." },
- { "name": "symbol", "$ref": "RemoteObject", "optional": true, "description": "Property symbol object, if the property is of the <code>symbol</code> type." }
- ]
- },
- {
- "id": "InternalPropertyDescriptor",
- "type": "object",
- "description": "Object internal property descriptor. This property isn't normally visible in JavaScript code.",
- "properties": [
- { "name": "name", "type": "string", "description": "Conventional property name." },
- { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." }
- ]
- },
- {
- "id": "CallArgument",
- "type": "object",
- "description": "Represents function call argument. Either remote object id <code>objectId</code>, primitive <code>value</code>, unserializable primitive value or neither of (for undefined) them should be specified.",
- "properties": [
- { "name": "value", "type": "any", "optional": true, "description": "Primitive value." },
- { "name": "unserializableValue", "$ref": "UnserializableValue", "optional": true, "description": "Primitive value which can not be JSON-stringified." },
- { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Remote object handle." }
- ]
- },
- {
- "id": "ExecutionContextId",
- "type": "integer",
- "description": "Id of an execution context."
- },
- {
- "id": "ExecutionContextDescription",
- "type": "object",
- "description": "Description of an isolated world.",
- "properties": [
- { "name": "id", "$ref": "ExecutionContextId", "description": "Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed." },
- { "name": "origin", "type": "string", "description": "Execution context origin." },
- { "name": "name", "type": "string", "description": "Human readable name describing given context." },
- { "name": "auxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." }
- ]
- },
- {
- "id": "ExceptionDetails",
- "type": "object",
- "description": "Detailed information about exception (or error) that was thrown during script compilation or execution.",
- "properties": [
- { "name": "exceptionId", "type": "integer", "description": "Exception id." },
- { "name": "text", "type": "string", "description": "Exception text, which should be used together with exception object when available." },
- { "name": "lineNumber", "type": "integer", "description": "Line number of the exception location (0-based)." },
- { "name": "columnNumber", "type": "integer", "description": "Column number of the exception location (0-based)." },
- { "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Script ID of the exception location." },
- { "name": "url", "type": "string", "optional": true, "description": "URL of the exception location, to be used when the script was not reported." },
- { "name": "stackTrace", "$ref": "StackTrace", "optional": true, "description": "JavaScript stack trace if available." },
- { "name": "exception", "$ref": "RemoteObject", "optional": true, "description": "Exception object if available." },
- { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Identifier of the context where exception happened." }
- ]
- },
- {
- "id": "Timestamp",
- "type": "number",
- "description": "Number of milliseconds since epoch."
- },
- {
- "id": "CallFrame",
- "type": "object",
- "description": "Stack entry for runtime errors and assertions.",
- "properties": [
- { "name": "functionName", "type": "string", "description": "JavaScript function name." },
- { "name": "scriptId", "$ref": "ScriptId", "description": "JavaScript script id." },
- { "name": "url", "type": "string", "description": "JavaScript script name or url." },
- { "name": "lineNumber", "type": "integer", "description": "JavaScript script line number (0-based)." },
- { "name": "columnNumber", "type": "integer", "description": "JavaScript script column number (0-based)." }
- ]
- },
- {
- "id": "StackTrace",
- "type": "object",
- "description": "Call frames for assertions or error messages.",
- "exported": true,
- "properties": [
- { "name": "description", "type": "string", "optional": true, "description": "String label of this stack trace. For async traces this may be a name of the function that initiated the async call." },
- { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "JavaScript function name." },
- { "name": "parent", "$ref": "StackTrace", "optional": true, "description": "Asynchronous JavaScript stack trace that preceded this stack, if available." }
- ]
- }
- ],
- "commands": [
- {
- "name": "evaluate",
- "async": true,
- "parameters": [
- { "name": "expression", "type": "string", "description": "Expression to evaluate." },
- { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
- { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
- { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
- { "name": "contextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." },
- { "name": "userGesture", "type": "boolean", "optional": true, "experimental": true, "description": "Whether execution should be treated as initiated by user in the UI." },
- { "name": "awaitPromise", "type": "boolean", "optional":true, "description": "Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error." }
- ],
- "returns": [
- { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Evaluates expression on global object."
- },
- {
- "name": "awaitPromise",
- "async": true,
- "parameters": [
- { "name": "promiseObjectId", "$ref": "RemoteObjectId", "description": "Identifier of the promise." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." }
- ],
- "returns": [
- { "name": "result", "$ref": "RemoteObject", "description": "Promise result. Will contain rejected value if promise was rejected." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details if stack strace is available."}
- ],
- "description": "Add handler to promise with given promise object id."
- },
- {
- "name": "callFunctionOn",
- "async": true,
- "parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to call function on." },
- { "name": "functionDeclaration", "type": "string", "description": "Declaration of the function to call." },
- { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument", "description": "Call argument." }, "optional": true, "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target object." },
- { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." },
- { "name": "userGesture", "type": "boolean", "optional": true, "experimental": true, "description": "Whether execution should be treated as initiated by user in the UI." },
- { "name": "awaitPromise", "type": "boolean", "optional":true, "description": "Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error." }
- ],
- "returns": [
- { "name": "result", "$ref": "RemoteObject", "description": "Call result." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Calls function with given declaration on the given object. Object group of the result is inherited from the target object."
- },
- {
- "name": "getProperties",
- "parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." },
- { "name": "ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the element itself, not to its prototype chain." },
- { "name": "accessorPropertiesOnly", "optional": true, "type": "boolean", "description": "If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.", "experimental": true },
- { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the results." }
- ],
- "returns": [
- { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor" }, "description": "Object properties." },
- { "name": "internalProperties", "optional": true, "type": "array", "items": { "$ref": "InternalPropertyDescriptor" }, "description": "Internal object properties (only of the element itself)." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Returns properties of a given object. Object group of the result is inherited from the target object."
- },
- {
- "name": "releaseObject",
- "parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to release." }
- ],
- "description": "Releases remote object with given id."
- },
- {
- "name": "releaseObjectGroup",
- "parameters": [
- { "name": "objectGroup", "type": "string", "description": "Symbolic object group name." }
- ],
- "description": "Releases all remote objects that belong to a given group."
- },
- {
- "name": "runIfWaitingForDebugger",
- "description": "Tells inspected instance to run if it was waiting for debugger to attach."
- },
- {
- "name": "enable",
- "description": "Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context."
- },
- {
- "name": "disable",
- "description": "Disables reporting of execution contexts creation."
- },
- {
- "name": "discardConsoleEntries",
- "description": "Discards collected exceptions and console API calls."
- },
- {
- "name": "setCustomObjectFormatterEnabled",
- "parameters": [
- {
- "name": "enabled",
- "type": "boolean"
- }
- ],
- "experimental": true
- },
- {
- "name": "compileScript",
- "parameters": [
- { "name": "expression", "type": "string", "description": "Expression to compile." },
- { "name": "sourceURL", "type": "string", "description": "Source url to be set for the script." },
- { "name": "persistScript", "type": "boolean", "description": "Specifies whether the compiled script should be persisted." },
- { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page." }
- ],
- "returns": [
- { "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Id of the script." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Compiles expression."
- },
- {
- "name": "runScript",
- "async": true,
- "parameters": [
- { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to run." },
- { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page." },
- { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
- { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
- { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." },
- { "name": "awaitPromise", "type": "boolean", "optional": true, "description": "Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error." }
- ],
- "returns": [
- { "name": "result", "$ref": "RemoteObject", "description": "Run result." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Runs script with given id in a given context."
- }
- ],
- "events": [
- {
- "name": "executionContextCreated",
- "parameters": [
- { "name": "context", "$ref": "ExecutionContextDescription", "description": "A newly created execution contex." }
- ],
- "description": "Issued when new execution context is created."
- },
- {
- "name": "executionContextDestroyed",
- "parameters": [
- { "name": "executionContextId", "$ref": "ExecutionContextId", "description": "Id of the destroyed context" }
- ],
- "description": "Issued when execution context is destroyed."
- },
- {
- "name": "executionContextsCleared",
- "description": "Issued when all executionContexts were cleared in browser"
- },
- {
- "name": "exceptionThrown",
- "description": "Issued when exception was thrown and unhandled.",
- "parameters": [
- { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp of the exception." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails" }
- ]
- },
- {
- "name": "exceptionRevoked",
- "description": "Issued when unhandled exception was revoked.",
- "parameters": [
- { "name": "reason", "type": "string", "description": "Reason describing why exception was revoked." },
- { "name": "exceptionId", "type": "integer", "description": "The id of revoked exception, as reported in <code>exceptionUnhandled</code>." }
- ]
- },
- {
- "name": "consoleAPICalled",
- "description": "Issued when console API was called.",
- "parameters": [
- { "name": "type", "type": "string", "enum": ["log", "debug", "info", "error", "warning", "dir", "dirxml", "table", "trace", "clear", "startGroup", "startGroupCollapsed", "endGroup", "assert", "profile", "profileEnd"], "description": "Type of the call." },
- { "name": "args", "type": "array", "items": { "$ref": "RemoteObject" }, "description": "Call arguments." },
- { "name": "executionContextId", "$ref": "ExecutionContextId", "description": "Identifier of the context where the call was made." },
- { "name": "timestamp", "$ref": "Timestamp", "description": "Call timestamp." },
- { "name": "stackTrace", "$ref": "StackTrace", "optional": true, "description": "Stack trace captured when the call was made." }
- ]
- },
- {
- "name": "inspectRequested",
- "description": "Issued when object should be inspected (for example, as a result of inspect() command line API call).",
- "parameters": [
- { "name": "object", "$ref": "RemoteObject" },
- { "name": "hints", "type": "object" }
- ]
- }
- ]
- },
- {
- "domain": "Debugger",
- "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.",
- "dependencies": ["Runtime"],
- "types": [
- {
- "id": "BreakpointId",
- "type": "string",
- "description": "Breakpoint identifier."
- },
- {
- "id": "CallFrameId",
- "type": "string",
- "description": "Call frame identifier."
- },
- {
- "id": "Location",
- "type": "object",
- "properties": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Script identifier as reported in the <code>Debugger.scriptParsed</code>." },
- { "name": "lineNumber", "type": "integer", "description": "Line number in the script (0-based)." },
- { "name": "columnNumber", "type": "integer", "optional": true, "description": "Column number in the script (0-based)." }
- ],
- "description": "Location in the source code."
- },
- {
- "id": "ScriptPosition",
- "experimental": true,
- "type": "object",
- "properties": [
- { "name": "lineNumber", "type": "integer" },
- { "name": "columnNumber", "type": "integer" }
- ],
- "description": "Location in the source code."
- },
- {
- "id": "CallFrame",
- "type": "object",
- "properties": [
- { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused." },
- { "name": "functionName", "type": "string", "description": "Name of the JavaScript function called on this call frame." },
- { "name": "functionLocation", "$ref": "Location", "optional": true, "experimental": true, "description": "Location in the source code." },
- { "name": "location", "$ref": "Location", "description": "Location in the source code." },
- { "name": "scopeChain", "type": "array", "items": { "$ref": "Scope" }, "description": "Scope chain for this call frame." },
- { "name": "this", "$ref": "Runtime.RemoteObject", "description": "<code>this</code> object for this call frame." },
- { "name": "returnValue", "$ref": "Runtime.RemoteObject", "optional": true, "description": "The value being returned, if the function is at return point." }
- ],
- "description": "JavaScript call frame. Array of call frames form the call stack."
- },
- {
- "id": "Scope",
- "type": "object",
- "properties": [
- { "name": "type", "type": "string", "enum": ["global", "local", "with", "closure", "catch", "block", "script"], "description": "Scope type." },
- { "name": "object", "$ref": "Runtime.RemoteObject", "description": "Object representing the scope. For <code>global</code> and <code>with</code> scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties." },
- { "name": "name", "type": "string", "optional": true },
- { "name": "startLocation", "$ref": "Location", "optional": true, "description": "Location in the source code where scope starts" },
- { "name": "endLocation", "$ref": "Location", "optional": true, "description": "Location in the source code where scope ends" }
- ],
- "description": "Scope description."
- },
- {
- "id": "SearchMatch",
- "type": "object",
- "description": "Search match for resource.",
- "exported": true,
- "properties": [
- { "name": "lineNumber", "type": "number", "description": "Line number in resource content." },
- { "name": "lineContent", "type": "string", "description": "Line with match content." }
- ],
- "experimental": true
- }
- ],
- "commands": [
- {
- "name": "enable",
- "description": "Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received."
- },
- {
- "name": "disable",
- "description": "Disables debugger for given page."
- },
- {
- "name": "setBreakpointsActive",
- "parameters": [
- { "name": "active", "type": "boolean", "description": "New value for breakpoints active state." }
- ],
- "description": "Activates / deactivates all breakpoints on the page."
- },
- {
- "name": "setSkipAllPauses",
- "parameters": [
- { "name": "skip", "type": "boolean", "description": "New value for skip pauses state." }
- ],
- "description": "Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc)."
- },
- {
- "name": "setBreakpointByUrl",
- "parameters": [
- { "name": "lineNumber", "type": "integer", "description": "Line number to set breakpoint at." },
- { "name": "url", "type": "string", "optional": true, "description": "URL of the resources to set breakpoint on." },
- { "name": "urlRegex", "type": "string", "optional": true, "description": "Regex pattern for the URLs of the resources to set breakpoints on. Either <code>url</code> or <code>urlRegex</code> must be specified." },
- { "name": "columnNumber", "type": "integer", "optional": true, "description": "Offset in the line to set breakpoint at." },
- { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." }
- ],
- "returns": [
- { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
- { "name": "locations", "type": "array", "items": { "$ref": "Location" }, "description": "List of the locations this breakpoint resolved into upon addition." }
- ],
- "description": "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 <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads."
- },
- {
- "name": "setBreakpoint",
- "parameters": [
- { "name": "location", "$ref": "Location", "description": "Location to set breakpoint in." },
- { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." }
- ],
- "returns": [
- { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
- { "name": "actualLocation", "$ref": "Location", "description": "Location this breakpoint resolved into." }
- ],
- "description": "Sets JavaScript breakpoint at a given location."
- },
- {
- "name": "removeBreakpoint",
- "parameters": [
- { "name": "breakpointId", "$ref": "BreakpointId" }
- ],
- "description": "Removes JavaScript breakpoint."
- },
- {
- "name": "continueToLocation",
- "parameters": [
- { "name": "location", "$ref": "Location", "description": "Location to continue to." }
- ],
- "description": "Continues execution until specific location is reached."
- },
- {
- "name": "stepOver",
- "description": "Steps over the statement."
- },
- {
- "name": "stepInto",
- "description": "Steps into the function call."
- },
- {
- "name": "stepOut",
- "description": "Steps out of the function call."
- },
- {
- "name": "pause",
- "description": "Stops on the next JavaScript statement."
- },
- {
- "name": "resume",
- "description": "Resumes JavaScript execution."
- },
- {
- "name": "searchInContent",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to search in." },
- { "name": "query", "type": "string", "description": "String to search for." },
- { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },
- { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." }
- ],
- "returns": [
- { "name": "result", "type": "array", "items": { "$ref": "SearchMatch" }, "description": "List of search matches." }
- ],
- "experimental": true,
- "description": "Searches for given string in script content."
- },
- {
- "name": "setScriptSource",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to edit." },
- { "name": "scriptSource", "type": "string", "description": "New content of the script." },
- { "name": "dryRun", "type": "boolean", "optional": true, "description": " If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code." }
- ],
- "returns": [
- { "name": "callFrames", "type": "array", "optional": true, "items": { "$ref": "CallFrame" }, "description": "New stack trace in case editing has happened while VM was stopped." },
- { "name": "stackChanged", "type": "boolean", "optional": true, "description": "Whether current call stack was modified after applying the changes." },
- { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." },
- { "name": "exceptionDetails", "optional": true, "$ref": "Runtime.ExceptionDetails", "description": "Exception details if any." }
- ],
- "description": "Edits JavaScript source live."
- },
- {
- "name": "restartFrame",
- "parameters": [
- { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." }
- ],
- "returns": [
- { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "New stack trace." },
- { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." }
- ],
- "description": "Restarts particular call frame from the beginning."
- },
- {
- "name": "getScriptSource",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to get source for." }
- ],
- "returns": [
- { "name": "scriptSource", "type": "string", "description": "Script source." }
- ],
- "description": "Returns source for the script with given id."
- },
- {
- "name": "setPauseOnExceptions",
- "parameters": [
- { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." }
- ],
- "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>."
- },
- {
- "name": "evaluateOnCallFrame",
- "parameters": [
- { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." },
- { "name": "expression", "type": "string", "description": "Expression to evaluate." },
- { "name": "objectGroup", "type": "string", "optional": true, "description": "String object group name to put result into (allows rapid releasing resulting object handles using <code>releaseObjectGroup</code>)." },
- { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Specifies whether command line API should be available to the evaluated expression, defaults to false." },
- { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." }
- ],
- "returns": [
- { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Object wrapper for the evaluation result." },
- { "name": "exceptionDetails", "$ref": "Runtime.ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Evaluates expression on a given call frame."
- },
- {
- "name": "setVariableValue",
- "parameters": [
- { "name": "scopeNumber", "type": "integer", "description": "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." },
- { "name": "variableName", "type": "string", "description": "Variable name." },
- { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." },
- { "name": "callFrameId", "$ref": "CallFrameId", "description": "Id of callframe that holds variable." }
- ],
- "description": "Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually."
- },
- {
- "name": "setAsyncCallStackDepth",
- "parameters": [
- { "name": "maxDepth", "type": "integer", "description": "Maximum depth of async call stacks. Setting to <code>0</code> will effectively disable collecting async call stacks (default)." }
- ],
- "description": "Enables or disables async call stacks tracking."
- },
- {
- "name": "setBlackboxPatterns",
- "parameters": [
- { "name": "patterns", "type": "array", "items": { "type": "string" }, "description": "Array of regexps that will be used to check script url for blackbox state." }
- ],
- "experimental": true,
- "description": "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."
- },
- {
- "name": "setBlackboxedRanges",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script." },
- { "name": "positions", "type": "array", "items": { "$ref": "ScriptPosition" } }
- ],
- "experimental": true,
- "description": "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."
- }
- ],
- "events": [
- {
- "name": "scriptParsed",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Identifier of the script parsed." },
- { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." },
- { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." },
- { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." },
- { "name": "endLine", "type": "integer", "description": "Last line of the script." },
- { "name": "endColumn", "type": "integer", "description": "Length of the last line of the script." },
- { "name": "executionContextId", "$ref": "Runtime.ExecutionContextId", "description": "Specifies script creation context." },
- { "name": "hash", "type": "string", "description": "Content hash of the script."},
- { "name": "executionContextAuxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." },
- { "name": "isLiveEdit", "type": "boolean", "optional": true, "description": "True, if this script is generated as a result of the live edit operation.", "experimental": true },
- { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with script (if any)." },
- { "name": "hasSourceURL", "type": "boolean", "optional": true, "description": "True, if this script has sourceURL.", "experimental": true }
- ],
- "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger."
- },
- {
- "name": "scriptFailedToParse",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Identifier of the script parsed." },
- { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." },
- { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." },
- { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." },
- { "name": "endLine", "type": "integer", "description": "Last line of the script." },
- { "name": "endColumn", "type": "integer", "description": "Length of the last line of the script." },
- { "name": "executionContextId", "$ref": "Runtime.ExecutionContextId", "description": "Specifies script creation context." },
- { "name": "hash", "type": "string", "description": "Content hash of the script."},
- { "name": "executionContextAuxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." },
- { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with script (if any)." },
- { "name": "hasSourceURL", "type": "boolean", "optional": true, "description": "True, if this script has sourceURL.", "experimental": true }
- ],
- "description": "Fired when virtual machine fails to parse the script."
- },
- {
- "name": "breakpointResolved",
- "parameters": [
- { "name": "breakpointId", "$ref": "BreakpointId", "description": "Breakpoint unique identifier." },
- { "name": "location", "$ref": "Location", "description": "Actual breakpoint location." }
- ],
- "description": "Fired when breakpoint is resolved to an actual script and location."
- },
- {
- "name": "paused",
- "parameters": [
- { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." },
- { "name": "reason", "type": "string", "enum": [ "XHR", "DOM", "EventListener", "exception", "assert", "debugCommand", "promiseRejection", "other" ], "description": "Pause reason.", "exported": true },
- { "name": "data", "type": "object", "optional": true, "description": "Object containing break-specific auxiliary properties." },
- { "name": "hitBreakpoints", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Hit breakpoints IDs" },
- { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." }
- ],
- "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria."
- },
- {
- "name": "resumed",
- "description": "Fired when the virtual machine resumed execution."
- }
- ]
- },
- {
- "domain": "Console",
- "description": "This domain is deprecated - use Runtime or Log instead.",
- "dependencies": ["Runtime"],
- "deprecated": true,
- "types": [
- {
- "id": "ConsoleMessage",
- "type": "object",
- "description": "Console message.",
- "properties": [
- { "name": "source", "type": "string", "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "security", "other", "deprecation", "worker"], "description": "Message source." },
- { "name": "level", "type": "string", "enum": ["log", "warning", "error", "debug", "info"], "description": "Message severity." },
- { "name": "text", "type": "string", "description": "Message text." },
- { "name": "url", "type": "string", "optional": true, "description": "URL of the message origin." },
- { "name": "line", "type": "integer", "optional": true, "description": "Line number in the resource that generated this message (1-based)." },
- { "name": "column", "type": "integer", "optional": true, "description": "Column number in the resource that generated this message (1-based)." }
- ]
- }
- ],
- "commands": [
- {
- "name": "enable",
- "description": "Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification."
- },
- {
- "name": "disable",
- "description": "Disables console domain, prevents further console messages from being reported to the client."
- },
- {
- "name": "clearMessages",
- "description": "Does nothing."
- }
- ],
- "events": [
- {
- "name": "messageAdded",
- "parameters": [
- { "name": "message", "$ref": "ConsoleMessage", "description": "Console message that has been added." }
- ],
- "description": "Issued when new console message is added."
- }
- ]
- },
- {
- "domain": "Profiler",
- "dependencies": ["Runtime", "Debugger"],
- "types": [
- {
- "id": "ProfileNode",
- "type": "object",
- "description": "Profile node. Holds callsite information, execution statistics and child nodes.",
- "properties": [
- { "name": "id", "type": "integer", "description": "Unique id of the node." },
- { "name": "callFrame", "$ref": "Runtime.CallFrame", "description": "Function location." },
- { "name": "hitCount", "type": "integer", "optional": true, "experimental": true, "description": "Number of samples where this node was on top of the call stack." },
- { "name": "children", "type": "array", "items": { "type": "integer" }, "optional": true, "description": "Child node ids." },
- { "name": "deoptReason", "type": "string", "optional": true, "description": "The reason of being not optimized. The function may be deoptimized or marked as don't optimize."},
- { "name": "positionTicks", "type": "array", "items": { "$ref": "PositionTickInfo" }, "optional": true, "experimental": true, "description": "An array of source position ticks." }
- ]
- },
- {
- "id": "Profile",
- "type": "object",
- "description": "Profile.",
- "properties": [
- { "name": "nodes", "type": "array", "items": { "$ref": "ProfileNode" }, "description": "The list of profile nodes. First item is the root node." },
- { "name": "startTime", "type": "number", "description": "Profiling start timestamp in microseconds." },
- { "name": "endTime", "type": "number", "description": "Profiling end timestamp in microseconds." },
- { "name": "samples", "optional": true, "type": "array", "items": { "type": "integer" }, "description": "Ids of samples top nodes." },
- { "name": "timeDeltas", "optional": true, "type": "array", "items": { "type": "integer" }, "description": "Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime." }
- ]
- },
- {
- "id": "PositionTickInfo",
- "type": "object",
- "experimental": true,
- "description": "Specifies a number of samples attributed to a certain source position.",
- "properties": [
- { "name": "line", "type": "integer", "description": "Source line number (1-based)." },
- { "name": "ticks", "type": "integer", "description": "Number of samples attributed to the source line." }
- ]
- }
- ],
- "commands": [
- {
- "name": "enable"
- },
- {
- "name": "disable"
- },
- {
- "name": "setSamplingInterval",
- "parameters": [
- { "name": "interval", "type": "integer", "description": "New sampling interval in microseconds." }
- ],
- "description": "Changes CPU profiler sampling interval. Must be called before CPU profiles recording started."
- },
- {
- "name": "start"
- },
- {
- "name": "stop",
- "returns": [
- { "name": "profile", "$ref": "Profile", "description": "Recorded profile." }
- ]
- }
- ],
- "events": [
- {
- "name": "consoleProfileStarted",
- "parameters": [
- { "name": "id", "type": "string" },
- { "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profile()." },
- { "name": "title", "type": "string", "optional": true, "description": "Profile title passed as an argument to console.profile()." }
- ],
- "description": "Sent when new profile recodring is started using console.profile() call."
- },
- {
- "name": "consoleProfileFinished",
- "parameters": [
- { "name": "id", "type": "string" },
- { "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profileEnd()." },
- { "name": "profile", "$ref": "Profile" },
- { "name": "title", "type": "string", "optional": true, "description": "Profile title passed as an argument to console.profile()." }
- ]
- }
- ]
- },
- {
- "domain": "HeapProfiler",
- "dependencies": ["Runtime"],
- "experimental": true,
- "types": [
- {
- "id": "HeapSnapshotObjectId",
- "type": "string",
- "description": "Heap snapshot object id."
- },
- {
- "id": "SamplingHeapProfileNode",
- "type": "object",
- "description": "Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.",
- "properties": [
- { "name": "callFrame", "$ref": "Runtime.CallFrame", "description": "Function location." },
- { "name": "selfSize", "type": "number", "description": "Allocations size in bytes for the node excluding children." },
- { "name": "children", "type": "array", "items": { "$ref": "SamplingHeapProfileNode" }, "description": "Child nodes." }
- ]
- },
- {
- "id": "SamplingHeapProfile",
- "type": "object",
- "description": "Profile.",
- "properties": [
- { "name": "head", "$ref": "SamplingHeapProfileNode" }
- ]
- }
- ],
- "commands": [
- {
- "name": "enable"
- },
- {
- "name": "disable"
- },
- {
- "name": "startTrackingHeapObjects",
- "parameters": [
- { "name": "trackAllocations", "type": "boolean", "optional": true }
- ]
- },
- {
- "name": "stopTrackingHeapObjects",
- "parameters": [
- { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped." }
- ]
- },
- {
- "name": "takeHeapSnapshot",
- "parameters": [
- { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken." }
- ]
- },
- {
- "name": "collectGarbage"
- },
- {
- "name": "getObjectByHeapObjectId",
- "parameters": [
- { "name": "objectId", "$ref": "HeapSnapshotObjectId" },
- { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }
- ],
- "returns": [
- { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Evaluation result." }
- ]
- },
- {
- "name": "addInspectedHeapObject",
- "parameters": [
- { "name": "heapObjectId", "$ref": "HeapSnapshotObjectId", "description": "Heap snapshot object id to be accessible by means of $x command line API." }
- ],
- "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions)."
- },
- {
- "name": "getHeapObjectId",
- "parameters": [
- { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "description": "Identifier of the object to get heap object id for." }
- ],
- "returns": [
- { "name": "heapSnapshotObjectId", "$ref": "HeapSnapshotObjectId", "description": "Id of the heap snapshot object corresponding to the passed remote object id." }
- ]
- },
- {
- "name": "startSampling",
- "parameters": [
- { "name": "samplingInterval", "type": "number", "optional": true, "description": "Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes." }
- ]
- },
- {
- "name": "stopSampling",
- "returns": [
- { "name": "profile", "$ref": "SamplingHeapProfile", "description": "Recorded sampling heap profile." }
- ]
- }
- ],
- "events": [
- {
- "name": "addHeapSnapshotChunk",
- "parameters": [
- { "name": "chunk", "type": "string" }
- ]
- },
- {
- "name": "resetProfiles"
- },
- {
- "name": "reportHeapSnapshotProgress",
- "parameters": [
- { "name": "done", "type": "integer" },
- { "name": "total", "type": "integer" },
- { "name": "finished", "type": "boolean", "optional": true }
- ]
- },
- {
- "name": "lastSeenObjectId",
- "description": "If heap objects tracking has been started then backend regulary 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.",
- "parameters": [
- { "name": "lastSeenObjectId", "type": "integer" },
- { "name": "timestamp", "type": "number" }
- ]
- },
- {
- "name": "heapStatsUpdate",
- "description": "If heap objects tracking has been started then backend may send update for one or more fragments",
- "parameters": [
- { "name": "statsUpdate", "type": "array", "items": { "type": "integer" }, "description": "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."}
- ]
- }
- ]
- }]
-}
diff --git a/deps/v8/src/inspector/js_protocol-1.3.json b/deps/v8/src/inspector/js_protocol-1.3.json
deleted file mode 100644
index ea573d11a6..0000000000
--- a/deps/v8/src/inspector/js_protocol-1.3.json
+++ /dev/null
@@ -1,1205 +0,0 @@
-{
- "version": { "major": "1", "minor": "3" },
- "domains": [
- {
- "domain": "Schema",
- "description": "This domain is deprecated.",
- "deprecated": true,
- "types": [
- {
- "id": "Domain",
- "type": "object",
- "description": "Description of the protocol domain.",
- "properties": [
- { "name": "name", "type": "string", "description": "Domain name." },
- { "name": "version", "type": "string", "description": "Domain version." }
- ]
- }
- ],
- "commands": [
- {
- "name": "getDomains",
- "description": "Returns supported domains.",
- "handlers": ["browser", "renderer"],
- "returns": [
- { "name": "domains", "type": "array", "items": { "$ref": "Domain" }, "description": "List of supported domains." }
- ]
- }
- ]
- },
- {
- "domain": "Runtime",
- "description": "Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.",
- "types": [
- {
- "id": "ScriptId",
- "type": "string",
- "description": "Unique script identifier."
- },
- {
- "id": "RemoteObjectId",
- "type": "string",
- "description": "Unique object identifier."
- },
- {
- "id": "UnserializableValue",
- "type": "string",
- "enum": ["Infinity", "NaN", "-Infinity", "-0"],
- "description": "Primitive value which cannot be JSON-stringified."
- },
- {
- "id": "RemoteObject",
- "type": "object",
- "description": "Mirror object referencing original JavaScript object.",
- "properties": [
- { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
- { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "weakmap", "weakset", "iterator", "generator", "error", "proxy", "promise", "typedarray"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
- { "name": "className", "type": "string", "optional": true, "description": "Object class (constructor) name. Specified for <code>object</code> type values only." },
- { "name": "value", "type": "any", "optional": true, "description": "Remote object value in case of primitive values or JSON values (if it was requested)." },
- { "name": "unserializableValue", "$ref": "UnserializableValue", "optional": true, "description": "Primitive value which can not be JSON-stringified does not have <code>value</code>, but gets this property." },
- { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
- { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Unique object identifier (for non-primitive values)." },
- { "name": "preview", "$ref": "ObjectPreview", "optional": true, "description": "Preview containing abbreviated property values. Specified for <code>object</code> type values only.", "experimental": true },
- { "name": "customPreview", "$ref": "CustomPreview", "optional": true, "experimental": true}
- ]
- },
- {
- "id": "CustomPreview",
- "type": "object",
- "experimental": true,
- "properties": [
- { "name": "header", "type": "string"},
- { "name": "hasBody", "type": "boolean"},
- { "name": "formatterObjectId", "$ref": "RemoteObjectId"},
- { "name": "bindRemoteObjectFunctionId", "$ref": "RemoteObjectId" },
- { "name": "configObjectId", "$ref": "RemoteObjectId", "optional": true }
- ]
- },
- {
- "id": "ObjectPreview",
- "type": "object",
- "experimental": true,
- "description": "Object containing abbreviated remote object value.",
- "properties": [
- { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol"], "description": "Object type." },
- { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "weakmap", "weakset", "iterator", "generator", "error"], "description": "Object subtype hint. Specified for <code>object</code> type values only." },
- { "name": "description", "type": "string", "optional": true, "description": "String representation of the object." },
- { "name": "overflow", "type": "boolean", "description": "True iff some of the properties or entries of the original object did not fit." },
- { "name": "properties", "type": "array", "items": { "$ref": "PropertyPreview" }, "description": "List of the properties." },
- { "name": "entries", "type": "array", "items": { "$ref": "EntryPreview" }, "optional": true, "description": "List of the entries. Specified for <code>map</code> and <code>set</code> subtype values only." }
- ]
- },
- {
- "id": "PropertyPreview",
- "type": "object",
- "experimental": true,
- "properties": [
- { "name": "name", "type": "string", "description": "Property name." },
- { "name": "type", "type": "string", "enum": ["object", "function", "undefined", "string", "number", "boolean", "symbol", "accessor"], "description": "Object type. Accessor means that the property itself is an accessor property." },
- { "name": "value", "type": "string", "optional": true, "description": "User-friendly property value string." },
- { "name": "valuePreview", "$ref": "ObjectPreview", "optional": true, "description": "Nested value preview." },
- { "name": "subtype", "type": "string", "optional": true, "enum": ["array", "null", "node", "regexp", "date", "map", "set", "weakmap", "weakset", "iterator", "generator", "error"], "description": "Object subtype hint. Specified for <code>object</code> type values only." }
- ]
- },
- {
- "id": "EntryPreview",
- "type": "object",
- "experimental": true,
- "properties": [
- { "name": "key", "$ref": "ObjectPreview", "optional": true, "description": "Preview of the key. Specified for map-like collection entries." },
- { "name": "value", "$ref": "ObjectPreview", "description": "Preview of the value." }
- ]
- },
- {
- "id": "PropertyDescriptor",
- "type": "object",
- "description": "Object property descriptor.",
- "properties": [
- { "name": "name", "type": "string", "description": "Property name or symbol description." },
- { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." },
- { "name": "writable", "type": "boolean", "optional": true, "description": "True if the value associated with the property may be changed (data descriptors only)." },
- { "name": "get", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only)." },
- { "name": "set", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only)." },
- { "name": "configurable", "type": "boolean", "description": "True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." },
- { "name": "enumerable", "type": "boolean", "description": "True if this property shows up during enumeration of the properties on the corresponding object." },
- { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." },
- { "name": "isOwn", "optional": true, "type": "boolean", "description": "True if the property is owned for the object." },
- { "name": "symbol", "$ref": "RemoteObject", "optional": true, "description": "Property symbol object, if the property is of the <code>symbol</code> type." }
- ]
- },
- {
- "id": "InternalPropertyDescriptor",
- "type": "object",
- "description": "Object internal property descriptor. This property isn't normally visible in JavaScript code.",
- "properties": [
- { "name": "name", "type": "string", "description": "Conventional property name." },
- { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." }
- ]
- },
- {
- "id": "CallArgument",
- "type": "object",
- "description": "Represents function call argument. Either remote object id <code>objectId</code>, primitive <code>value</code>, unserializable primitive value or neither of (for undefined) them should be specified.",
- "properties": [
- { "name": "value", "type": "any", "optional": true, "description": "Primitive value or serializable javascript object." },
- { "name": "unserializableValue", "$ref": "UnserializableValue", "optional": true, "description": "Primitive value which can not be JSON-stringified." },
- { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Remote object handle." }
- ]
- },
- {
- "id": "ExecutionContextId",
- "type": "integer",
- "description": "Id of an execution context."
- },
- {
- "id": "ExecutionContextDescription",
- "type": "object",
- "description": "Description of an isolated world.",
- "properties": [
- { "name": "id", "$ref": "ExecutionContextId", "description": "Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed." },
- { "name": "origin", "type": "string", "description": "Execution context origin." },
- { "name": "name", "type": "string", "description": "Human readable name describing given context." },
- { "name": "auxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." }
- ]
- },
- {
- "id": "ExceptionDetails",
- "type": "object",
- "description": "Detailed information about exception (or error) that was thrown during script compilation or execution.",
- "properties": [
- { "name": "exceptionId", "type": "integer", "description": "Exception id." },
- { "name": "text", "type": "string", "description": "Exception text, which should be used together with exception object when available." },
- { "name": "lineNumber", "type": "integer", "description": "Line number of the exception location (0-based)." },
- { "name": "columnNumber", "type": "integer", "description": "Column number of the exception location (0-based)." },
- { "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Script ID of the exception location." },
- { "name": "url", "type": "string", "optional": true, "description": "URL of the exception location, to be used when the script was not reported." },
- { "name": "stackTrace", "$ref": "StackTrace", "optional": true, "description": "JavaScript stack trace if available." },
- { "name": "exception", "$ref": "RemoteObject", "optional": true, "description": "Exception object if available." },
- { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Identifier of the context where exception happened." }
- ]
- },
- {
- "id": "Timestamp",
- "type": "number",
- "description": "Number of milliseconds since epoch."
- },
- {
- "id": "CallFrame",
- "type": "object",
- "description": "Stack entry for runtime errors and assertions.",
- "properties": [
- { "name": "functionName", "type": "string", "description": "JavaScript function name." },
- { "name": "scriptId", "$ref": "ScriptId", "description": "JavaScript script id." },
- { "name": "url", "type": "string", "description": "JavaScript script name or url." },
- { "name": "lineNumber", "type": "integer", "description": "JavaScript script line number (0-based)." },
- { "name": "columnNumber", "type": "integer", "description": "JavaScript script column number (0-based)." }
- ]
- },
- {
- "id": "StackTrace",
- "type": "object",
- "description": "Call frames for assertions or error messages.",
- "properties": [
- { "name": "description", "type": "string", "optional": true, "description": "String label of this stack trace. For async traces this may be a name of the function that initiated the async call." },
- { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "JavaScript function name." },
- { "name": "parent", "$ref": "StackTrace", "optional": true, "description": "Asynchronous JavaScript stack trace that preceded this stack, if available." },
- { "name": "parentId", "$ref": "StackTraceId", "optional": true, "experimental": true, "description": "Asynchronous JavaScript stack trace that preceded this stack, if available." }
- ]
- },
- {
- "id": "UniqueDebuggerId",
- "type": "string",
- "description": "Unique identifier of current debugger.",
- "experimental": true
- },
- {
- "id": "StackTraceId",
- "type": "object",
- "description": "If <code>debuggerId</code> is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See <code>Runtime.StackTrace</code> and <code>Debugger.paused</code> for usages.",
- "properties": [
- { "name": "id", "type": "string" },
- { "name": "debuggerId", "$ref": "UniqueDebuggerId", "optional": true }
- ],
- "experimental": true
- }
- ],
- "commands": [
- {
- "name": "evaluate",
- "parameters": [
- { "name": "expression", "type": "string", "description": "Expression to evaluate." },
- { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
- { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
- { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
- { "name": "contextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." },
- { "name": "userGesture", "type": "boolean", "optional": true, "description": "Whether execution should be treated as initiated by user in the UI." },
- { "name": "awaitPromise", "type": "boolean", "optional":true, "description": "Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved." }
- ],
- "returns": [
- { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Evaluates expression on global object."
- },
- {
- "name": "awaitPromise",
- "parameters": [
- { "name": "promiseObjectId", "$ref": "RemoteObjectId", "description": "Identifier of the promise." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." }
- ],
- "returns": [
- { "name": "result", "$ref": "RemoteObject", "description": "Promise result. Will contain rejected value if promise was rejected." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details if stack strace is available."}
- ],
- "description": "Add handler to promise with given promise object id."
- },
- {
- "name": "callFunctionOn",
- "parameters": [
- { "name": "functionDeclaration", "type": "string", "description": "Declaration of the function to call." },
- { "name": "objectId", "$ref": "RemoteObjectId", "optional": true, "description": "Identifier of the object to call function on. Either objectId or executionContextId should be specified." },
- { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument", "description": "Call argument." }, "optional": true, "description": "Call arguments. All call arguments must belong to the same JavaScript world as the target object." },
- { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." },
- { "name": "userGesture", "type": "boolean", "optional": true, "description": "Whether execution should be treated as initiated by user in the UI." },
- { "name": "awaitPromise", "type": "boolean", "optional":true, "description": "Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved." },
- { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified." },
- { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object." }
- ],
- "returns": [
- { "name": "result", "$ref": "RemoteObject", "description": "Call result." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Calls function with given declaration on the given object. Object group of the result is inherited from the target object."
- },
- {
- "name": "getProperties",
- "parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." },
- { "name": "ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the element itself, not to its prototype chain." },
- { "name": "accessorPropertiesOnly", "optional": true, "type": "boolean", "description": "If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.", "experimental": true },
- { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the results." }
- ],
- "returns": [
- { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor" }, "description": "Object properties." },
- { "name": "internalProperties", "optional": true, "type": "array", "items": { "$ref": "InternalPropertyDescriptor" }, "description": "Internal object properties (only of the element itself)." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Returns properties of a given object. Object group of the result is inherited from the target object."
- },
- {
- "name": "releaseObject",
- "parameters": [
- { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to release." }
- ],
- "description": "Releases remote object with given id."
- },
- {
- "name": "releaseObjectGroup",
- "parameters": [
- { "name": "objectGroup", "type": "string", "description": "Symbolic object group name." }
- ],
- "description": "Releases all remote objects that belong to a given group."
- },
- {
- "name": "runIfWaitingForDebugger",
- "description": "Tells inspected instance to run if it was waiting for debugger to attach."
- },
- {
- "name": "enable",
- "description": "Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context."
- },
- {
- "name": "disable",
- "description": "Disables reporting of execution contexts creation."
- },
- {
- "name": "discardConsoleEntries",
- "description": "Discards collected exceptions and console API calls."
- },
- {
- "name": "setCustomObjectFormatterEnabled",
- "parameters": [
- {
- "name": "enabled",
- "type": "boolean"
- }
- ],
- "experimental": true
- },
- {
- "name": "compileScript",
- "parameters": [
- { "name": "expression", "type": "string", "description": "Expression to compile." },
- { "name": "sourceURL", "type": "string", "description": "Source url to be set for the script." },
- { "name": "persistScript", "type": "boolean", "description": "Specifies whether the compiled script should be persisted." },
- { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page." }
- ],
- "returns": [
- { "name": "scriptId", "$ref": "ScriptId", "optional": true, "description": "Id of the script." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Compiles expression."
- },
- {
- "name": "runScript",
- "parameters": [
- { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to run." },
- { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page." },
- { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
- { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
- { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object which should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "description": "Whether preview should be generated for the result." },
- { "name": "awaitPromise", "type": "boolean", "optional": true, "description": "Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved." }
- ],
- "returns": [
- { "name": "result", "$ref": "RemoteObject", "description": "Run result." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Runs script with given id in a given context."
- },
- {
- "name": "queryObjects",
- "parameters": [
- { "name": "prototypeObjectId", "$ref": "RemoteObjectId", "description": "Identifier of the prototype to return objects for." }
- ],
- "returns": [
- { "name": "objects", "$ref": "RemoteObject", "description": "Array with objects." }
- ]
- },
- {
- "name": "globalLexicalScopeNames",
- "parameters": [
- { "name": "executionContextId", "$ref": "ExecutionContextId", "optional": true, "description": "Specifies in which execution context to lookup global scope variables." }
- ],
- "returns": [
- { "name": "names", "type": "array", "items": { "type": "string" } }
- ],
- "description": "Returns all let, const and class variables from global scope."
- }
- ],
- "events": [
- {
- "name": "executionContextCreated",
- "parameters": [
- { "name": "context", "$ref": "ExecutionContextDescription", "description": "A newly created execution context." }
- ],
- "description": "Issued when new execution context is created."
- },
- {
- "name": "executionContextDestroyed",
- "parameters": [
- { "name": "executionContextId", "$ref": "ExecutionContextId", "description": "Id of the destroyed context" }
- ],
- "description": "Issued when execution context is destroyed."
- },
- {
- "name": "executionContextsCleared",
- "description": "Issued when all executionContexts were cleared in browser"
- },
- {
- "name": "exceptionThrown",
- "description": "Issued when exception was thrown and unhandled.",
- "parameters": [
- { "name": "timestamp", "$ref": "Timestamp", "description": "Timestamp of the exception." },
- { "name": "exceptionDetails", "$ref": "ExceptionDetails" }
- ]
- },
- {
- "name": "exceptionRevoked",
- "description": "Issued when unhandled exception was revoked.",
- "parameters": [
- { "name": "reason", "type": "string", "description": "Reason describing why exception was revoked." },
- { "name": "exceptionId", "type": "integer", "description": "The id of revoked exception, as reported in <code>exceptionThrown</code>." }
- ]
- },
- {
- "name": "consoleAPICalled",
- "description": "Issued when console API was called.",
- "parameters": [
- { "name": "type", "type": "string", "enum": ["log", "debug", "info", "error", "warning", "dir", "dirxml", "table", "trace", "clear", "startGroup", "startGroupCollapsed", "endGroup", "assert", "profile", "profileEnd", "count", "timeEnd"], "description": "Type of the call." },
- { "name": "args", "type": "array", "items": { "$ref": "RemoteObject" }, "description": "Call arguments." },
- { "name": "executionContextId", "$ref": "ExecutionContextId", "description": "Identifier of the context where the call was made." },
- { "name": "timestamp", "$ref": "Timestamp", "description": "Call timestamp." },
- { "name": "stackTrace", "$ref": "StackTrace", "optional": true, "description": "Stack trace captured when the call was made." },
- { "name": "context", "type": "string", "optional": true, "experimental": true, "description": "Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context." }
- ]
- },
- {
- "name": "inspectRequested",
- "description": "Issued when object should be inspected (for example, as a result of inspect() command line API call).",
- "parameters": [
- { "name": "object", "$ref": "RemoteObject" },
- { "name": "hints", "type": "object" }
- ]
- }
- ]
- },
- {
- "domain": "Debugger",
- "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.",
- "dependencies": ["Runtime"],
- "types": [
- {
- "id": "BreakpointId",
- "type": "string",
- "description": "Breakpoint identifier."
- },
- {
- "id": "CallFrameId",
- "type": "string",
- "description": "Call frame identifier."
- },
- {
- "id": "Location",
- "type": "object",
- "properties": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Script identifier as reported in the <code>Debugger.scriptParsed</code>." },
- { "name": "lineNumber", "type": "integer", "description": "Line number in the script (0-based)." },
- { "name": "columnNumber", "type": "integer", "optional": true, "description": "Column number in the script (0-based)." }
- ],
- "description": "Location in the source code."
- },
- {
- "id": "ScriptPosition",
- "experimental": true,
- "type": "object",
- "properties": [
- { "name": "lineNumber", "type": "integer" },
- { "name": "columnNumber", "type": "integer" }
- ],
- "description": "Location in the source code."
- },
- {
- "id": "CallFrame",
- "type": "object",
- "properties": [
- { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused." },
- { "name": "functionName", "type": "string", "description": "Name of the JavaScript function called on this call frame." },
- { "name": "functionLocation", "$ref": "Location", "optional": true, "description": "Location in the source code." },
- { "name": "location", "$ref": "Location", "description": "Location in the source code." },
- { "name": "url", "type": "string", "description": "JavaScript script name or url." },
- { "name": "scopeChain", "type": "array", "items": { "$ref": "Scope" }, "description": "Scope chain for this call frame." },
- { "name": "this", "$ref": "Runtime.RemoteObject", "description": "<code>this</code> object for this call frame." },
- { "name": "returnValue", "$ref": "Runtime.RemoteObject", "optional": true, "description": "The value being returned, if the function is at return point." }
- ],
- "description": "JavaScript call frame. Array of call frames form the call stack."
- },
- {
- "id": "Scope",
- "type": "object",
- "properties": [
- { "name": "type", "type": "string", "enum": ["global", "local", "with", "closure", "catch", "block", "script", "eval", "module"], "description": "Scope type." },
- { "name": "object", "$ref": "Runtime.RemoteObject", "description": "Object representing the scope. For <code>global</code> and <code>with</code> scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties." },
- { "name": "name", "type": "string", "optional": true },
- { "name": "startLocation", "$ref": "Location", "optional": true, "description": "Location in the source code where scope starts" },
- { "name": "endLocation", "$ref": "Location", "optional": true, "description": "Location in the source code where scope ends" }
- ],
- "description": "Scope description."
- },
- {
- "id": "SearchMatch",
- "type": "object",
- "description": "Search match for resource.",
- "properties": [
- { "name": "lineNumber", "type": "number", "description": "Line number in resource content." },
- { "name": "lineContent", "type": "string", "description": "Line with match content." }
- ]
- },
- {
- "id": "BreakLocation",
- "type": "object",
- "properties": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Script identifier as reported in the <code>Debugger.scriptParsed</code>." },
- { "name": "lineNumber", "type": "integer", "description": "Line number in the script (0-based)." },
- { "name": "columnNumber", "type": "integer", "optional": true, "description": "Column number in the script (0-based)." },
- { "name": "type", "type": "string", "enum": [ "debuggerStatement", "call", "return" ], "optional": true }
- ]
- }
- ],
- "commands": [
- {
- "name": "enable",
- "returns": [
- { "name": "debuggerId", "$ref": "Runtime.UniqueDebuggerId", "experimental": true, "description": "Unique identifier of the debugger." }
- ],
- "description": "Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received."
- },
- {
- "name": "disable",
- "description": "Disables debugger for given page."
- },
- {
- "name": "setBreakpointsActive",
- "parameters": [
- { "name": "active", "type": "boolean", "description": "New value for breakpoints active state." }
- ],
- "description": "Activates / deactivates all breakpoints on the page."
- },
- {
- "name": "setSkipAllPauses",
- "parameters": [
- { "name": "skip", "type": "boolean", "description": "New value for skip pauses state." }
- ],
- "description": "Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc)."
- },
- {
- "name": "setBreakpointByUrl",
- "parameters": [
- { "name": "lineNumber", "type": "integer", "description": "Line number to set breakpoint at." },
- { "name": "url", "type": "string", "optional": true, "description": "URL of the resources to set breakpoint on." },
- { "name": "urlRegex", "type": "string", "optional": true, "description": "Regex pattern for the URLs of the resources to set breakpoints on. Either <code>url</code> or <code>urlRegex</code> must be specified." },
- { "name": "scriptHash", "type": "string", "optional": true, "description": "Script hash of the resources to set breakpoint on." },
- { "name": "columnNumber", "type": "integer", "optional": true, "description": "Offset in the line to set breakpoint at." },
- { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." }
- ],
- "returns": [
- { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
- { "name": "locations", "type": "array", "items": { "$ref": "Location" }, "description": "List of the locations this breakpoint resolved into upon addition." }
- ],
- "description": "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 <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads."
- },
- {
- "name": "setBreakpoint",
- "parameters": [
- { "name": "location", "$ref": "Location", "description": "Location to set breakpoint in." },
- { "name": "condition", "type": "string", "optional": true, "description": "Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true." }
- ],
- "returns": [
- { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
- { "name": "actualLocation", "$ref": "Location", "description": "Location this breakpoint resolved into." }
- ],
- "description": "Sets JavaScript breakpoint at a given location."
- },
- {
- "name": "removeBreakpoint",
- "parameters": [
- { "name": "breakpointId", "$ref": "BreakpointId" }
- ],
- "description": "Removes JavaScript breakpoint."
- },
- {
- "name": "getPossibleBreakpoints",
- "parameters": [
- { "name": "start", "$ref": "Location", "description": "Start of range to search possible breakpoint locations in." },
- { "name": "end", "$ref": "Location", "optional": true, "description": "End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range." },
- { "name": "restrictToFunction", "type": "boolean", "optional": true, "description": "Only consider locations which are in the same (non-nested) function as start." }
- ],
- "returns": [
- { "name": "locations", "type": "array", "items": { "$ref": "BreakLocation" }, "description": "List of the possible breakpoint locations." }
- ],
- "description": "Returns possible locations for breakpoint. scriptId in start and end range locations should be the same."
- },
- {
- "name": "continueToLocation",
- "parameters": [
- { "name": "location", "$ref": "Location", "description": "Location to continue to." },
- { "name": "targetCallFrames", "type": "string", "enum": ["any", "current"], "optional": true }
- ],
- "description": "Continues execution until specific location is reached."
- },
- {
- "name": "pauseOnAsyncCall",
- "parameters": [
- { "name": "parentStackTraceId", "$ref": "Runtime.StackTraceId", "description": "Debugger will pause when async call with given stack trace is started." }
- ],
- "experimental": true
- },
- {
- "name": "stepOver",
- "description": "Steps over the statement."
- },
- {
- "name": "stepInto",
- "parameters": [
- { "name": "breakOnAsyncCall", "type": "boolean", "optional": true, "experimental": true, "description": "Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause." }
- ],
- "description": "Steps into the function call."
- },
- {
- "name": "stepOut",
- "description": "Steps out of the function call."
- },
- {
- "name": "pause",
- "description": "Stops on the next JavaScript statement."
- },
- {
- "name": "scheduleStepIntoAsync",
- "description": "This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called.",
- "experimental": true
- },
- {
- "name": "resume",
- "description": "Resumes JavaScript execution."
- },
- {
- "name": "getStackTrace",
- "parameters": [
- { "name": "stackTraceId", "$ref": "Runtime.StackTraceId" }
- ],
- "returns": [
- { "name": "stackTrace", "$ref": "Runtime.StackTrace" }
- ],
- "description": "Returns stack trace with given <code>stackTraceId</code>.",
- "experimental": true
- },
- {
- "name": "searchInContent",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to search in." },
- { "name": "query", "type": "string", "description": "String to search for." },
- { "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },
- { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." }
- ],
- "returns": [
- { "name": "result", "type": "array", "items": { "$ref": "SearchMatch" }, "description": "List of search matches." }
- ],
- "description": "Searches for given string in script content."
- },
- {
- "name": "setScriptSource",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to edit." },
- { "name": "scriptSource", "type": "string", "description": "New content of the script." },
- { "name": "dryRun", "type": "boolean", "optional": true, "description": " If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code." }
- ],
- "returns": [
- { "name": "callFrames", "type": "array", "optional": true, "items": { "$ref": "CallFrame" }, "description": "New stack trace in case editing has happened while VM was stopped." },
- { "name": "stackChanged", "type": "boolean", "optional": true, "description": "Whether current call stack was modified after applying the changes." },
- { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." },
- { "name": "asyncStackTraceId", "$ref": "Runtime.StackTraceId", "optional": true, "experimental": true, "description": "Async stack trace, if any." },
- { "name": "exceptionDetails", "optional": true, "$ref": "Runtime.ExceptionDetails", "description": "Exception details if any." }
- ],
- "description": "Edits JavaScript source live."
- },
- {
- "name": "restartFrame",
- "parameters": [
- { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." }
- ],
- "returns": [
- { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "New stack trace." },
- { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." },
- { "name": "asyncStackTraceId", "$ref": "Runtime.StackTraceId", "optional": true, "experimental": true, "description": "Async stack trace, if any." }
- ],
- "description": "Restarts particular call frame from the beginning."
- },
- {
- "name": "getScriptSource",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script to get source for." }
- ],
- "returns": [
- { "name": "scriptSource", "type": "string", "description": "Script source." }
- ],
- "description": "Returns source for the script with given id."
- },
- {
- "name": "setPauseOnExceptions",
- "parameters": [
- { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." }
- ],
- "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>."
- },
- {
- "name": "evaluateOnCallFrame",
- "parameters": [
- { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." },
- { "name": "expression", "type": "string", "description": "Expression to evaluate." },
- { "name": "objectGroup", "type": "string", "optional": true, "description": "String object group name to put result into (allows rapid releasing resulting object handles using <code>releaseObjectGroup</code>)." },
- { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Specifies whether command line API should be available to the evaluated expression, defaults to false." },
- { "name": "silent", "type": "boolean", "optional": true, "description": "In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state." },
- { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." },
- { "name": "generatePreview", "type": "boolean", "optional": true, "experimental": true, "description": "Whether preview should be generated for the result." },
- { "name": "throwOnSideEffect", "type": "boolean", "optional": true, "description": "Whether to throw an exception if side effect cannot be ruled out during evaluation." }
- ],
- "returns": [
- { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Object wrapper for the evaluation result." },
- { "name": "exceptionDetails", "$ref": "Runtime.ExceptionDetails", "optional": true, "description": "Exception details."}
- ],
- "description": "Evaluates expression on a given call frame."
- },
- {
- "name": "setVariableValue",
- "parameters": [
- { "name": "scopeNumber", "type": "integer", "description": "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." },
- { "name": "variableName", "type": "string", "description": "Variable name." },
- { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New variable value." },
- { "name": "callFrameId", "$ref": "CallFrameId", "description": "Id of callframe that holds variable." }
- ],
- "description": "Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually."
- },
- {
- "name": "setReturnValue",
- "parameters": [
- { "name": "newValue", "$ref": "Runtime.CallArgument", "description": "New return value." }
- ],
- "experimental": true,
- "description": "Changes return value in top frame. Available only at return break position."
- },
- {
- "name": "setAsyncCallStackDepth",
- "parameters": [
- { "name": "maxDepth", "type": "integer", "description": "Maximum depth of async call stacks. Setting to <code>0</code> will effectively disable collecting async call stacks (default)." }
- ],
- "description": "Enables or disables async call stacks tracking."
- },
- {
- "name": "setBlackboxPatterns",
- "parameters": [
- { "name": "patterns", "type": "array", "items": { "type": "string" }, "description": "Array of regexps that will be used to check script url for blackbox state." }
- ],
- "experimental": true,
- "description": "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."
- },
- {
- "name": "setBlackboxedRanges",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Id of the script." },
- { "name": "positions", "type": "array", "items": { "$ref": "ScriptPosition" } }
- ],
- "experimental": true,
- "description": "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."
- }
- ],
- "events": [
- {
- "name": "scriptParsed",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Identifier of the script parsed." },
- { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." },
- { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." },
- { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." },
- { "name": "endLine", "type": "integer", "description": "Last line of the script." },
- { "name": "endColumn", "type": "integer", "description": "Length of the last line of the script." },
- { "name": "executionContextId", "$ref": "Runtime.ExecutionContextId", "description": "Specifies script creation context." },
- { "name": "hash", "type": "string", "description": "Content hash of the script."},
- { "name": "executionContextAuxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." },
- { "name": "isLiveEdit", "type": "boolean", "optional": true, "description": "True, if this script is generated as a result of the live edit operation.", "experimental": true },
- { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with script (if any)." },
- { "name": "hasSourceURL", "type": "boolean", "optional": true, "description": "True, if this script has sourceURL." },
- { "name": "isModule", "type": "boolean", "optional": true, "description": "True, if this script is ES6 module." },
- { "name": "length", "type": "integer", "optional": true, "description": "This script length." },
- { "name": "stackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "JavaScript top stack frame of where the script parsed event was triggered if available.", "experimental": true }
- ],
- "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger."
- },
- {
- "name": "scriptFailedToParse",
- "parameters": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "Identifier of the script parsed." },
- { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." },
- { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." },
- { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." },
- { "name": "endLine", "type": "integer", "description": "Last line of the script." },
- { "name": "endColumn", "type": "integer", "description": "Length of the last line of the script." },
- { "name": "executionContextId", "$ref": "Runtime.ExecutionContextId", "description": "Specifies script creation context." },
- { "name": "hash", "type": "string", "description": "Content hash of the script."},
- { "name": "executionContextAuxData", "type": "object", "optional": true, "description": "Embedder-specific auxiliary data." },
- { "name": "sourceMapURL", "type": "string", "optional": true, "description": "URL of source map associated with script (if any)." },
- { "name": "hasSourceURL", "type": "boolean", "optional": true, "description": "True, if this script has sourceURL." },
- { "name": "isModule", "type": "boolean", "optional": true, "description": "True, if this script is ES6 module." },
- { "name": "length", "type": "integer", "optional": true, "description": "This script length." },
- { "name": "stackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "JavaScript top stack frame of where the script parsed event was triggered if available.", "experimental": true }
- ],
- "description": "Fired when virtual machine fails to parse the script."
- },
- {
- "name": "breakpointResolved",
- "parameters": [
- { "name": "breakpointId", "$ref": "BreakpointId", "description": "Breakpoint unique identifier." },
- { "name": "location", "$ref": "Location", "description": "Actual breakpoint location." }
- ],
- "description": "Fired when breakpoint is resolved to an actual script and location."
- },
- {
- "name": "paused",
- "parameters": [
- { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." },
- { "name": "reason", "type": "string", "enum": [ "XHR", "DOM", "EventListener", "exception", "assert", "debugCommand", "promiseRejection", "OOM", "other", "ambiguous" ], "description": "Pause reason." },
- { "name": "data", "type": "object", "optional": true, "description": "Object containing break-specific auxiliary properties." },
- { "name": "hitBreakpoints", "type": "array", "optional": true, "items": { "type": "string" }, "description": "Hit breakpoints IDs" },
- { "name": "asyncStackTrace", "$ref": "Runtime.StackTrace", "optional": true, "description": "Async stack trace, if any." },
- { "name": "asyncStackTraceId", "$ref": "Runtime.StackTraceId", "optional": true, "experimental": true, "description": "Async stack trace, if any." },
- { "name": "asyncCallStackTraceId", "$ref": "Runtime.StackTraceId", "optional": true, "experimental": true, "description": "Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after <code>Debugger.stepInto</code> call with <code>breakOnAsynCall</code> flag." }
- ],
- "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria."
- },
- {
- "name": "resumed",
- "description": "Fired when the virtual machine resumed execution."
- }
- ]
- },
- {
- "domain": "Console",
- "description": "This domain is deprecated - use Runtime or Log instead.",
- "dependencies": ["Runtime"],
- "deprecated": true,
- "types": [
- {
- "id": "ConsoleMessage",
- "type": "object",
- "description": "Console message.",
- "properties": [
- { "name": "source", "type": "string", "enum": ["xml", "javascript", "network", "console-api", "storage", "appcache", "rendering", "security", "other", "deprecation", "worker"], "description": "Message source." },
- { "name": "level", "type": "string", "enum": ["log", "warning", "error", "debug", "info"], "description": "Message severity." },
- { "name": "text", "type": "string", "description": "Message text." },
- { "name": "url", "type": "string", "optional": true, "description": "URL of the message origin." },
- { "name": "line", "type": "integer", "optional": true, "description": "Line number in the resource that generated this message (1-based)." },
- { "name": "column", "type": "integer", "optional": true, "description": "Column number in the resource that generated this message (1-based)." }
- ]
- }
- ],
- "commands": [
- {
- "name": "enable",
- "description": "Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification."
- },
- {
- "name": "disable",
- "description": "Disables console domain, prevents further console messages from being reported to the client."
- },
- {
- "name": "clearMessages",
- "description": "Does nothing."
- }
- ],
- "events": [
- {
- "name": "messageAdded",
- "parameters": [
- { "name": "message", "$ref": "ConsoleMessage", "description": "Console message that has been added." }
- ],
- "description": "Issued when new console message is added."
- }
- ]
- },
- {
- "domain": "Profiler",
- "dependencies": ["Runtime", "Debugger"],
- "types": [
- {
- "id": "ProfileNode",
- "type": "object",
- "description": "Profile node. Holds callsite information, execution statistics and child nodes.",
- "properties": [
- { "name": "id", "type": "integer", "description": "Unique id of the node." },
- { "name": "callFrame", "$ref": "Runtime.CallFrame", "description": "Function location." },
- { "name": "hitCount", "type": "integer", "optional": true, "description": "Number of samples where this node was on top of the call stack." },
- { "name": "children", "type": "array", "items": { "type": "integer" }, "optional": true, "description": "Child node ids." },
- { "name": "deoptReason", "type": "string", "optional": true, "description": "The reason of being not optimized. The function may be deoptimized or marked as don't optimize."},
- { "name": "positionTicks", "type": "array", "items": { "$ref": "PositionTickInfo" }, "optional": true, "description": "An array of source position ticks." }
- ]
- },
- {
- "id": "Profile",
- "type": "object",
- "description": "Profile.",
- "properties": [
- { "name": "nodes", "type": "array", "items": { "$ref": "ProfileNode" }, "description": "The list of profile nodes. First item is the root node." },
- { "name": "startTime", "type": "number", "description": "Profiling start timestamp in microseconds." },
- { "name": "endTime", "type": "number", "description": "Profiling end timestamp in microseconds." },
- { "name": "samples", "optional": true, "type": "array", "items": { "type": "integer" }, "description": "Ids of samples top nodes." },
- { "name": "timeDeltas", "optional": true, "type": "array", "items": { "type": "integer" }, "description": "Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime." }
- ]
- },
- {
- "id": "PositionTickInfo",
- "type": "object",
- "description": "Specifies a number of samples attributed to a certain source position.",
- "properties": [
- { "name": "line", "type": "integer", "description": "Source line number (1-based)." },
- { "name": "ticks", "type": "integer", "description": "Number of samples attributed to the source line." }
- ]
- },
- { "id": "CoverageRange",
- "type": "object",
- "description": "Coverage data for a source range.",
- "properties": [
- { "name": "startOffset", "type": "integer", "description": "JavaScript script source offset for the range start." },
- { "name": "endOffset", "type": "integer", "description": "JavaScript script source offset for the range end." },
- { "name": "count", "type": "integer", "description": "Collected execution count of the source range." }
- ]
- },
- { "id": "FunctionCoverage",
- "type": "object",
- "description": "Coverage data for a JavaScript function.",
- "properties": [
- { "name": "functionName", "type": "string", "description": "JavaScript function name." },
- { "name": "ranges", "type": "array", "items": { "$ref": "CoverageRange" }, "description": "Source ranges inside the function with coverage data." },
- { "name": "isBlockCoverage", "type": "boolean", "description": "Whether coverage data for this function has block granularity." }
- ]
- },
- {
- "id": "ScriptCoverage",
- "type": "object",
- "description": "Coverage data for a JavaScript script.",
- "properties": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "JavaScript script id." },
- { "name": "url", "type": "string", "description": "JavaScript script name or url." },
- { "name": "functions", "type": "array", "items": { "$ref": "FunctionCoverage" }, "description": "Functions contained in the script that has coverage data." }
- ]
- },
- { "id": "TypeObject",
- "type": "object",
- "description": "Describes a type collected during runtime.",
- "properties": [
- { "name": "name", "type": "string", "description": "Name of a type collected with type profiling." }
- ],
- "experimental": true
- },
- { "id": "TypeProfileEntry",
- "type": "object",
- "description": "Source offset and types for a parameter or return value.",
- "properties": [
- { "name": "offset", "type": "integer", "description": "Source offset of the parameter or end of function for return values." },
- { "name": "types", "type": "array", "items": {"$ref": "TypeObject"}, "description": "The types for this parameter or return value."}
- ],
- "experimental": true
- },
- {
- "id": "ScriptTypeProfile",
- "type": "object",
- "description": "Type profile data collected during runtime for a JavaScript script.",
- "properties": [
- { "name": "scriptId", "$ref": "Runtime.ScriptId", "description": "JavaScript script id." },
- { "name": "url", "type": "string", "description": "JavaScript script name or url." },
- { "name": "entries", "type": "array", "items": { "$ref": "TypeProfileEntry" }, "description": "Type profile entries for parameters and return values of the functions in the script." }
- ],
- "experimental": true
- }
- ],
- "commands": [
- {
- "name": "enable"
- },
- {
- "name": "disable"
- },
- {
- "name": "setSamplingInterval",
- "parameters": [
- { "name": "interval", "type": "integer", "description": "New sampling interval in microseconds." }
- ],
- "description": "Changes CPU profiler sampling interval. Must be called before CPU profiles recording started."
- },
- {
- "name": "start"
- },
- {
- "name": "stop",
- "returns": [
- { "name": "profile", "$ref": "Profile", "description": "Recorded profile." }
- ]
- },
- {
- "name": "startPreciseCoverage",
- "parameters": [
- { "name": "callCount", "type": "boolean", "optional": true, "description": "Collect accurate call counts beyond simple 'covered' or 'not covered'." },
- { "name": "detailed", "type": "boolean", "optional": true, "description": "Collect block-based coverage." }
- ],
- "description": "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."
- },
- {
- "name": "stopPreciseCoverage",
- "description": "Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code."
- },
- {
- "name": "takePreciseCoverage",
- "returns": [
- { "name": "result", "type": "array", "items": { "$ref": "ScriptCoverage" }, "description": "Coverage data for the current isolate." }
- ],
- "description": "Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started."
- },
- {
- "name": "getBestEffortCoverage",
- "returns": [
- { "name": "result", "type": "array", "items": { "$ref": "ScriptCoverage" }, "description": "Coverage data for the current isolate." }
- ],
- "description": "Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection."
- },
- {
- "name": "startTypeProfile",
- "description": "Enable type profile.",
- "experimental": true
- },
- {
- "name": "stopTypeProfile",
- "description": "Disable type profile. Disabling releases type profile data collected so far.",
- "experimental": true
- },
- {
- "name": "takeTypeProfile",
- "returns": [
- { "name": "result", "type": "array", "items": { "$ref": "ScriptTypeProfile" }, "description": "Type profile for all scripts since startTypeProfile() was turned on." }
- ],
- "description": "Collect type profile.",
- "experimental": true
- }
- ],
- "events": [
- {
- "name": "consoleProfileStarted",
- "parameters": [
- { "name": "id", "type": "string" },
- { "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profile()." },
- { "name": "title", "type": "string", "optional": true, "description": "Profile title passed as an argument to console.profile()." }
- ],
- "description": "Sent when new profile recording is started using console.profile() call."
- },
- {
- "name": "consoleProfileFinished",
- "parameters": [
- { "name": "id", "type": "string" },
- { "name": "location", "$ref": "Debugger.Location", "description": "Location of console.profileEnd()." },
- { "name": "profile", "$ref": "Profile" },
- { "name": "title", "type": "string", "optional": true, "description": "Profile title passed as an argument to console.profile()." }
- ]
- }
- ]
- },
- {
- "domain": "HeapProfiler",
- "dependencies": ["Runtime"],
- "experimental": true,
- "types": [
- {
- "id": "HeapSnapshotObjectId",
- "type": "string",
- "description": "Heap snapshot object id."
- },
- {
- "id": "SamplingHeapProfileNode",
- "type": "object",
- "description": "Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.",
- "properties": [
- { "name": "callFrame", "$ref": "Runtime.CallFrame", "description": "Function location." },
- { "name": "selfSize", "type": "number", "description": "Allocations size in bytes for the node excluding children." },
- { "name": "children", "type": "array", "items": { "$ref": "SamplingHeapProfileNode" }, "description": "Child nodes." }
- ]
- },
- {
- "id": "SamplingHeapProfile",
- "type": "object",
- "description": "Profile.",
- "properties": [
- { "name": "head", "$ref": "SamplingHeapProfileNode" }
- ]
- }
- ],
- "commands": [
- {
- "name": "enable"
- },
- {
- "name": "disable"
- },
- {
- "name": "startTrackingHeapObjects",
- "parameters": [
- { "name": "trackAllocations", "type": "boolean", "optional": true }
- ]
- },
- {
- "name": "stopTrackingHeapObjects",
- "parameters": [
- { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped." }
- ]
- },
- {
- "name": "takeHeapSnapshot",
- "parameters": [
- { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken." }
- ]
- },
- {
- "name": "collectGarbage"
- },
- {
- "name": "getObjectByHeapObjectId",
- "parameters": [
- { "name": "objectId", "$ref": "HeapSnapshotObjectId" },
- { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }
- ],
- "returns": [
- { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Evaluation result." }
- ]
- },
- {
- "name": "addInspectedHeapObject",
- "parameters": [
- { "name": "heapObjectId", "$ref": "HeapSnapshotObjectId", "description": "Heap snapshot object id to be accessible by means of $x command line API." }
- ],
- "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions)."
- },
- {
- "name": "getHeapObjectId",
- "parameters": [
- { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "description": "Identifier of the object to get heap object id for." }
- ],
- "returns": [
- { "name": "heapSnapshotObjectId", "$ref": "HeapSnapshotObjectId", "description": "Id of the heap snapshot object corresponding to the passed remote object id." }
- ]
- },
- {
- "name": "startSampling",
- "parameters": [
- { "name": "samplingInterval", "type": "number", "optional": true, "description": "Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes." }
- ]
- },
- {
- "name": "stopSampling",
- "returns": [
- { "name": "profile", "$ref": "SamplingHeapProfile", "description": "Recorded sampling heap profile." }
- ]
- },
- {
- "name": "getSamplingProfile",
- "returns": [
- { "name": "profile", "$ref": "SamplingHeapProfile", "description": "Return the sampling profile being collected." }
- ]
- }
- ],
- "events": [
- {
- "name": "addHeapSnapshotChunk",
- "parameters": [
- { "name": "chunk", "type": "string" }
- ]
- },
- {
- "name": "resetProfiles"
- },
- {
- "name": "reportHeapSnapshotProgress",
- "parameters": [
- { "name": "done", "type": "integer" },
- { "name": "total", "type": "integer" },
- { "name": "finished", "type": "boolean", "optional": true }
- ]
- },
- {
- "name": "lastSeenObjectId",
- "description": "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.",
- "parameters": [
- { "name": "lastSeenObjectId", "type": "integer" },
- { "name": "timestamp", "type": "number" }
- ]
- },
- {
- "name": "heapStatsUpdate",
- "description": "If heap objects tracking has been started then backend may send update for one or more fragments",
- "parameters": [
- { "name": "statsUpdate", "type": "array", "items": { "type": "integer" }, "description": "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."}
- ]
- }
- ]
- }]
-}
diff --git a/deps/v8/src/inspector/js_protocol.pdl b/deps/v8/src/inspector/js_protocol.pdl
deleted file mode 100644
index c4ff51b060..0000000000
--- a/deps/v8/src/inspector/js_protocol.pdl
+++ /dev/null
@@ -1,1492 +0,0 @@
-# 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
-
- # 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.
- 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
-
- # Scope description.
- type Scope extends object
- properties
- # Scope type.
- enum type
- global
- local
- with
- closure
- catch
- block
- script
- eval
- module
- # 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 paramter 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.
- string scriptSource
-
- # 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 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.
- command restartFrame
- parameters
- # Call frame identifier to evaluate on.
- CallFrameId callFrameId
- returns
- # New stack trace.
- array of CallFrame callFrames
- # Async stack trace, if any.
- optional Runtime.StackTrace asyncStackTrace
- # Async stack trace, if any.
- experimental optional Runtime.StackTraceId asyncStackTraceId
-
- # Resumes JavaScript execution.
- command resume
-
- # 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
- # no exceptions. Initial pause on exceptions state is `none`.
- command setPauseOnExceptions
- parameters
- # Pause on exceptions mode.
- enum state
- none
- 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.
- 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
- returns
- # New stack trace in case editing has happened while VM was stopped.
- optional array of CallFrame callFrames
- # Whether current call stack was modified after applying the changes.
- optional boolean stackChanged
- # Async stack trace, if any.
- optional Runtime.StackTrace asyncStackTrace
- # Async stack trace, if any.
- experimental optional Runtime.StackTraceId asyncStackTraceId
- # Exception details if any.
- 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 issue additional Debugger.paused notification if any async task is scheduled
- # before next pause.
- experimental optional boolean breakOnAsyncCall
-
- # Steps out of the function call.
- command stepOut
-
- # Steps over the statement.
- command stepOver
-
- # 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
- debugCommand
- DOM
- EventListener
- exception
- instrumentation
- OOM
- other
- promiseRejection
- XHR
- # 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
- # Just scheduled async call will have this stack trace as parent stack during async execution.
- # This field is available only after `Debugger.stepInto` call with `breakOnAsynCall` flag.
- experimental optional Runtime.StackTraceId asyncCallStackTraceId
-
- # Fired when the virtual machine resumed execution.
- event resumed
-
- # 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.
- string hash
- # Embedder-specific auxiliary data.
- 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
-
- # 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.
- string hash
- # Embedder-specific auxiliary data.
- 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
-
-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
-
- 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
-
- command takeHeapSnapshot
- parameters
- # If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
- optional boolean reportProgress
-
- 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
-
- # Describes a type collected during runtime.
- experimental type TypeObject extends object
- properties
- # Name of a type collected with type profiling.
- string name
-
- # Source offset and types for a parameter or return value.
- experimental type TypeProfileEntry extends object
- properties
- # Source offset of the parameter or end of function for return values.
- integer offset
- # The types for this parameter or return value.
- array of TypeObject types
-
- # Type profile data collected during runtime for a JavaScript script.
- experimental type ScriptTypeProfile extends object
- properties
- # JavaScript script id.
- Runtime.ScriptId scriptId
- # JavaScript script name or url.
- string url
- # Type profile entries for parameters and return values of the functions in the script.
- array of TypeProfileEntry entries
-
- 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
-
- # Enable type profile.
- experimental command startTypeProfile
-
- command stop
- returns
- # Recorded profile.
- Profile profile
-
- # Disable precise code coverage. Disabling releases unnecessary execution count records and allows
- # executing optimized code.
- command stopPreciseCoverage
-
- # Disable type profile. Disabling releases type profile data collected so far.
- experimental command stopTypeProfile
-
- # 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
-
- # Collect type profile.
- experimental command takeTypeProfile
- returns
- # Type profile for all scripts since startTypeProfile() was turned on.
- array of ScriptTypeProfile result
-
- 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
-
-# Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects.
-# Evaluation results are returned as mirror object that expose object type, string representation
-# and unique identifier that can be used for further object reference. Original objects are
-# maintained in memory unless they are either explicitly released or are released along with the
-# other objects in their object group.
-domain Runtime
-
- # Unique script identifier.
- type ScriptId extends string
-
- # Unique object identifier.
- type RemoteObjectId extends string
-
- # Primitive value which cannot be JSON-stringified. Includes values `-0`, `NaN`, `Infinity`,
- # `-Infinity`, and bigint literals.
- type UnserializableValue extends string
-
- # Mirror object referencing original JavaScript object.
- type RemoteObject extends object
- properties
- # Object type.
- enum type
- object
- function
- undefined
- string
- number
- boolean
- symbol
- bigint
- # Object subtype hint. Specified for `object` type values only.
- optional enum subtype
- array
- null
- node
- regexp
- date
- map
- set
- weakmap
- weakset
- iterator
- generator
- error
- proxy
- promise
- typedarray
- arraybuffer
- dataview
- # Object class (constructor) name. Specified for `object` type values only.
- optional string className
- # Remote object value in case of primitive values or JSON values (if it was requested).
- optional any value
- # Primitive value which can not be JSON-stringified does not have `value`, but gets this
- # property.
- optional UnserializableValue unserializableValue
- # String representation of the object.
- optional string description
- # Unique object identifier (for non-primitive values).
- optional RemoteObjectId objectId
- # Preview containing abbreviated property values. Specified for `object` type values only.
- experimental optional ObjectPreview preview
- experimental optional CustomPreview customPreview
-
- experimental type CustomPreview extends object
- properties
- # The JSON-stringified result of formatter.header(object, config) call.
- # It contains json ML array that represents RemoteObject.
- string header
- # If formatter returns true as a result of formatter.hasBody call then bodyGetterId will
- # contain RemoteObjectId for the function that returns result of formatter.body(object, config) call.
- # The result value is json ML array.
- optional RemoteObjectId bodyGetterId
-
- # Object containing abbreviated remote object value.
- experimental type ObjectPreview extends object
- properties
- # Object type.
- enum type
- object
- function
- undefined
- string
- number
- boolean
- symbol
- bigint
- # Object subtype hint. Specified for `object` type values only.
- optional enum subtype
- array
- null
- node
- regexp
- date
- map
- set
- weakmap
- weakset
- iterator
- generator
- error
- # String representation of the object.
- optional string description
- # True iff some of the properties or entries of the original object did not fit.
- boolean overflow
- # List of the properties.
- array of PropertyPreview properties
- # List of the entries. Specified for `map` and `set` subtype values only.
- optional array of EntryPreview entries
-
- experimental type PropertyPreview extends object
- properties
- # Property name.
- string name
- # Object type. Accessor means that the property itself is an accessor property.
- enum type
- object
- function
- undefined
- string
- number
- boolean
- symbol
- accessor
- bigint
- # User-friendly property value string.
- optional string value
- # Nested value preview.
- optional ObjectPreview valuePreview
- # Object subtype hint. Specified for `object` type values only.
- optional enum subtype
- array
- null
- node
- regexp
- date
- map
- set
- weakmap
- weakset
- iterator
- generator
- error
-
- experimental type EntryPreview extends object
- properties
- # Preview of the key. Specified for map-like collection entries.
- optional ObjectPreview key
- # Preview of the value.
- ObjectPreview value
-
- # Object property descriptor.
- type PropertyDescriptor extends object
- properties
- # Property name or symbol description.
- string name
- # The value associated with the property.
- optional RemoteObject value
- # True if the value associated with the property may be changed (data descriptors only).
- optional boolean writable
- # A function which serves as a getter for the property, or `undefined` if there is no getter
- # (accessor descriptors only).
- optional RemoteObject get
- # A function which serves as a setter for the property, or `undefined` if there is no setter
- # (accessor descriptors only).
- optional RemoteObject set
- # True if the type of this property descriptor may be changed and if the property may be
- # deleted from the corresponding object.
- boolean configurable
- # True if this property shows up during enumeration of the properties on the corresponding
- # object.
- boolean enumerable
- # True if the result was thrown during the evaluation.
- optional boolean wasThrown
- # True if the property is owned for the object.
- optional boolean isOwn
- # Property symbol object, if the property is of the `symbol` type.
- optional RemoteObject symbol
-
- # Object internal property descriptor. This property isn't normally visible in JavaScript code.
- type InternalPropertyDescriptor extends object
- properties
- # Conventional property name.
- string name
- # The value associated with the property.
- optional RemoteObject value
-
- # Object private field descriptor.
- experimental type PrivatePropertyDescriptor extends object
- properties
- # Private property name.
- string name
- # The value associated with the private property.
- RemoteObject value
-
- # Represents function call argument. Either remote object id `objectId`, primitive `value`,
- # unserializable primitive value or neither of (for undefined) them should be specified.
- type CallArgument extends object
- properties
- # Primitive value or serializable javascript object.
- optional any value
- # Primitive value which can not be JSON-stringified.
- optional UnserializableValue unserializableValue
- # Remote object handle.
- optional RemoteObjectId objectId
-
- # Id of an execution context.
- type ExecutionContextId extends integer
-
- # Description of an isolated world.
- type ExecutionContextDescription extends object
- properties
- # Unique id of the execution context. It can be used to specify in which execution context
- # script evaluation should be performed.
- ExecutionContextId id
- # Execution context origin.
- string origin
- # Human readable name describing given context.
- string name
- # Embedder-specific auxiliary data.
- optional object auxData
-
- # Detailed information about exception (or error) that was thrown during script compilation or
- # execution.
- type ExceptionDetails extends object
- properties
- # Exception id.
- integer exceptionId
- # Exception text, which should be used together with exception object when available.
- string text
- # Line number of the exception location (0-based).
- integer lineNumber
- # Column number of the exception location (0-based).
- integer columnNumber
- # Script ID of the exception location.
- optional ScriptId scriptId
- # URL of the exception location, to be used when the script was not reported.
- optional string url
- # JavaScript stack trace if available.
- optional StackTrace stackTrace
- # Exception object if available.
- optional RemoteObject exception
- # Identifier of the context where exception happened.
- optional ExecutionContextId executionContextId
-
- # Number of milliseconds since epoch.
- type Timestamp extends number
-
- # Number of milliseconds.
- type TimeDelta extends number
-
- # Stack entry for runtime errors and assertions.
- type CallFrame extends object
- properties
- # JavaScript function name.
- string functionName
- # JavaScript script id.
- ScriptId scriptId
- # JavaScript script name or url.
- string url
- # JavaScript script line number (0-based).
- integer lineNumber
- # JavaScript script column number (0-based).
- integer columnNumber
-
- # Call frames for assertions or error messages.
- type StackTrace extends object
- properties
- # String label of this stack trace. For async traces this may be a name of the function that
- # initiated the async call.
- optional string description
- # JavaScript function name.
- array of CallFrame callFrames
- # Asynchronous JavaScript stack trace that preceded this stack, if available.
- optional StackTrace parent
- # Asynchronous JavaScript stack trace that preceded this stack, if available.
- experimental optional StackTraceId parentId
-
- # Unique identifier of current debugger.
- experimental type UniqueDebuggerId extends string
-
- # If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This
- # allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages.
- experimental type StackTraceId extends object
- properties
- string id
- optional UniqueDebuggerId debuggerId
-
- # Add handler to promise with given promise object id.
- command awaitPromise
- parameters
- # Identifier of the promise.
- RemoteObjectId promiseObjectId
- # 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.
- optional boolean generatePreview
- returns
- # Promise result. Will contain rejected value if promise was rejected.
- RemoteObject result
- # Exception details if stack strace is available.
- optional ExceptionDetails exceptionDetails
-
- # Calls function with given declaration on the given object. Object group of the result is
- # inherited from the target object.
- command callFunctionOn
- parameters
- # Declaration of the function to call.
- string functionDeclaration
- # Identifier of the object to call function on. Either objectId or executionContextId should
- # be specified.
- optional RemoteObjectId objectId
- # Call arguments. All call arguments must belong to the same JavaScript world as the target
- # object.
- optional array of CallArgument arguments
- # 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 which should be sent by value.
- optional boolean returnByValue
- # Whether preview should be generated for the result.
- experimental optional boolean generatePreview
- # Whether execution should be treated as initiated by user in the UI.
- optional boolean userGesture
- # Whether execution should `await` for resulting value and return once awaited promise is
- # resolved.
- optional boolean awaitPromise
- # Specifies execution context which global object will be used to call function on. Either
- # executionContextId or objectId should be specified.
- optional ExecutionContextId executionContextId
- # Symbolic group name that can be used to release multiple objects. If objectGroup is not
- # specified and objectId is, objectGroup will be inherited from object.
- optional string objectGroup
- returns
- # Call result.
- RemoteObject result
- # Exception details.
- optional ExceptionDetails exceptionDetails
-
- # Compiles expression.
- command compileScript
- parameters
- # Expression to compile.
- string expression
- # Source url to be set for the script.
- string sourceURL
- # Specifies whether the compiled script should be persisted.
- boolean persistScript
- # Specifies in which execution context to perform script run. If the parameter is omitted the
- # evaluation will be performed in the context of the inspected page.
- optional ExecutionContextId executionContextId
- returns
- # Id of the script.
- optional ScriptId scriptId
- # Exception details.
- optional ExceptionDetails exceptionDetails
-
- # Disables reporting of execution contexts creation.
- command disable
-
- # Discards collected exceptions and console API calls.
- command discardConsoleEntries
-
- # Enables reporting of execution contexts creation by means of `executionContextCreated` event.
- # When the reporting gets enabled the event will be sent immediately for each existing execution
- # context.
- command enable
-
- # Evaluates expression on global object.
- command evaluate
- parameters
- # Expression to evaluate.
- string expression
- # Symbolic group name that can be used to release multiple objects.
- optional string objectGroup
- # Determines whether Command Line API should be available during the evaluation.
- optional boolean includeCommandLineAPI
- # In silent mode exceptions thrown during evaluation are not reported and do not pause
- # execution. Overrides `setPauseOnException` state.
- optional boolean silent
- # Specifies in which execution context to perform evaluation. If the parameter is omitted the
- # evaluation will be performed in the context of the inspected page.
- optional ExecutionContextId contextId
- # 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 execution should be treated as initiated by user in the UI.
- optional boolean userGesture
- # Whether execution should `await` for resulting value and return once awaited promise is
- # resolved.
- optional boolean awaitPromise
- # Whether to throw an exception if side effect cannot be ruled out during evaluation.
- experimental optional boolean throwOnSideEffect
- # Terminate execution after timing out (number of milliseconds).
- experimental optional TimeDelta timeout
- returns
- # Evaluation result.
- RemoteObject result
- # Exception details.
- optional ExceptionDetails exceptionDetails
-
- # Returns the isolate id.
- experimental command getIsolateId
- returns
- # The isolate id.
- string id
-
- # Returns the JavaScript heap usage.
- # It is the total usage of the corresponding isolate not scoped to a particular Runtime.
- experimental command getHeapUsage
- returns
- # Used heap size in bytes.
- number usedSize
- # Allocated heap size in bytes.
- number totalSize
-
- # Returns properties of a given object. Object group of the result is inherited from the target
- # object.
- command getProperties
- parameters
- # Identifier of the object to return properties for.
- RemoteObjectId objectId
- # If true, returns properties belonging only to the element itself, not to its prototype
- # chain.
- optional boolean ownProperties
- # If true, returns accessor properties (with getter/setter) only; internal properties are not
- # returned either.
- experimental optional boolean accessorPropertiesOnly
- # Whether preview should be generated for the results.
- experimental optional boolean generatePreview
- returns
- # Object properties.
- array of PropertyDescriptor result
- # Internal object properties (only of the element itself).
- optional array of InternalPropertyDescriptor internalProperties
- # Object private properties.
- experimental optional array of PrivatePropertyDescriptor privateProperties
- # Exception details.
- optional ExceptionDetails exceptionDetails
-
- # Returns all let, const and class variables from global scope.
- command globalLexicalScopeNames
- parameters
- # Specifies in which execution context to lookup global scope variables.
- optional ExecutionContextId executionContextId
- returns
- array of string names
-
- command queryObjects
- parameters
- # Identifier of the prototype to return objects for.
- RemoteObjectId prototypeObjectId
- # Symbolic group name that can be used to release the results.
- optional string objectGroup
- returns
- # Array with objects.
- RemoteObject objects
-
- # Releases remote object with given id.
- command releaseObject
- parameters
- # Identifier of the object to release.
- RemoteObjectId objectId
-
- # Releases all remote objects that belong to a given group.
- command releaseObjectGroup
- parameters
- # Symbolic object group name.
- string objectGroup
-
- # Tells inspected instance to run if it was waiting for debugger to attach.
- command runIfWaitingForDebugger
-
- # Runs script with given id in a given context.
- command runScript
- parameters
- # Id of the script to run.
- ScriptId scriptId
- # Specifies in which execution context to perform script run. If the parameter is omitted the
- # evaluation will be performed in the context of the inspected page.
- optional ExecutionContextId executionContextId
- # Symbolic group name that can be used to release multiple objects.
- optional string objectGroup
- # In silent mode exceptions thrown during evaluation are not reported and do not pause
- # execution. Overrides `setPauseOnException` state.
- optional boolean silent
- # Determines whether Command Line API should be available during the evaluation.
- optional boolean includeCommandLineAPI
- # Whether the result is expected to be a JSON object which should be sent by value.
- optional boolean returnByValue
- # Whether preview should be generated for the result.
- optional boolean generatePreview
- # Whether execution should `await` for resulting value and return once awaited promise is
- # resolved.
- optional boolean awaitPromise
- returns
- # Run result.
- RemoteObject result
- # Exception details.
- optional ExceptionDetails exceptionDetails
-
- # Enables or disables async call stacks tracking.
- command setAsyncCallStackDepth
- redirect Debugger
- parameters
- # Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async
- # call stacks (default).
- integer maxDepth
-
- experimental command setCustomObjectFormatterEnabled
- parameters
- boolean enabled
-
- experimental command setMaxCallStackSizeToCapture
- parameters
- integer size
-
- # Terminate current or next JavaScript execution.
- # Will cancel the termination when the outer-most script execution ends.
- experimental command terminateExecution
-
- # If executionContextId is empty, adds binding with the given name on the
- # global objects of all inspected contexts, including those created later,
- # bindings survive reloads.
- # If executionContextId is specified, adds binding only on global object of
- # given execution context.
- # Binding function takes exactly one argument, this argument should be string,
- # in case of any other input, function throws an exception.
- # Each binding function call produces Runtime.bindingCalled notification.
- experimental command addBinding
- parameters
- string name
- optional ExecutionContextId executionContextId
-
- # This method does not remove binding function from global object but
- # unsubscribes current runtime agent from Runtime.bindingCalled notifications.
- experimental command removeBinding
- parameters
- string name
-
- # Notification is issued every time when binding is called.
- experimental event bindingCalled
- parameters
- string name
- string payload
- # Identifier of the context where the call was made.
- ExecutionContextId executionContextId
-
- # Issued when console API was called.
- event consoleAPICalled
- parameters
- # Type of the call.
- enum type
- log
- debug
- info
- error
- warning
- dir
- dirxml
- table
- trace
- clear
- startGroup
- startGroupCollapsed
- endGroup
- assert
- profile
- profileEnd
- count
- timeEnd
- # Call arguments.
- array of RemoteObject args
- # Identifier of the context where the call was made.
- ExecutionContextId executionContextId
- # Call timestamp.
- Timestamp timestamp
- # Stack trace captured when the call was made. The async stack chain is automatically reported for
- # the following call types: `assert`, `error`, `trace`, `warning`. For other types the async call
- # chain can be retrieved using `Debugger.getStackTrace` and `stackTrace.parentId` field.
- optional StackTrace stackTrace
- # Console context descriptor for calls on non-default console context (not console.*):
- # 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call
- # on named context.
- experimental optional string context
-
- # Issued when unhandled exception was revoked.
- event exceptionRevoked
- parameters
- # Reason describing why exception was revoked.
- string reason
- # The id of revoked exception, as reported in `exceptionThrown`.
- integer exceptionId
-
- # Issued when exception was thrown and unhandled.
- event exceptionThrown
- parameters
- # Timestamp of the exception.
- Timestamp timestamp
- ExceptionDetails exceptionDetails
-
- # Issued when new execution context is created.
- event executionContextCreated
- parameters
- # A newly created execution context.
- ExecutionContextDescription context
-
- # Issued when execution context is destroyed.
- event executionContextDestroyed
- parameters
- # Id of the destroyed context
- ExecutionContextId executionContextId
-
- # Issued when all executionContexts were cleared in browser
- event executionContextsCleared
-
- # Issued when object should be inspected (for example, as a result of inspect() command line API
- # call).
- event inspectRequested
- parameters
- RemoteObject object
- object hints
-
-# This domain is deprecated.
-deprecated domain Schema
-
- # Description of the protocol domain.
- type Domain extends object
- properties
- # Domain name.
- string name
- # Domain version.
- string version
-
- # Returns supported domains.
- command getDomains
- returns
- # List of supported domains.
- array of Domain domains
diff --git a/deps/v8/src/inspector/string-16.cc b/deps/v8/src/inspector/string-16.cc
index acf0159f27..3a91169ac8 100644
--- a/deps/v8/src/inspector/string-16.cc
+++ b/deps/v8/src/inspector/string-16.cc
@@ -200,6 +200,23 @@ String16 String16::fromUTF8(const char* stringStart, size_t length) {
return String16(UTF8ToUTF16(stringStart, length));
}
+String16 String16::fromUTF16LE(const UChar* stringStart, size_t length) {
+#ifdef V8_TARGET_BIG_ENDIAN
+ // Need to flip the byte order on big endian machines.
+ String16Builder builder;
+ builder.reserveCapacity(length);
+ for (size_t i = 0; i < length; i++) {
+ const UChar utf16be_char =
+ stringStart[i] << 8 | (stringStart[i] >> 8 & 0x00FF);
+ builder.append(utf16be_char);
+ }
+ return builder.toString();
+#else
+ // No need to do anything on little endian machines.
+ return String16(stringStart, length);
+#endif // V8_TARGET_BIG_ENDIAN
+}
+
std::string String16::utf8() const {
return UTF16ToUTF8(m_impl.data(), m_impl.size());
}
diff --git a/deps/v8/src/inspector/string-16.h b/deps/v8/src/inspector/string-16.h
index 1b475a10a6..c1dd5cb929 100644
--- a/deps/v8/src/inspector/string-16.h
+++ b/deps/v8/src/inspector/string-16.h
@@ -26,7 +26,7 @@ class String16 {
String16(const String16&) V8_NOEXCEPT = default;
String16(String16&&) V8_NOEXCEPT = default;
String16(const UChar* characters, size_t size);
- String16(const UChar* characters); // NOLINT(runtime/explicit)
+ V8_EXPORT String16(const UChar* characters); // NOLINT(runtime/explicit)
String16(const char* characters); // NOLINT(runtime/explicit)
String16(const char* characters, size_t size);
explicit String16(const std::basic_string<UChar>& impl);
@@ -66,8 +66,13 @@ class String16 {
}
// Convenience methods.
- std::string utf8() const;
- static String16 fromUTF8(const char* stringStart, size_t length);
+ V8_EXPORT std::string utf8() const;
+ V8_EXPORT static String16 fromUTF8(const char* stringStart, size_t length);
+
+ // Instantiates a String16 in native endianness from UTF16 LE.
+ // On Big endian architectures, byte order needs to be flipped.
+ V8_EXPORT static String16 fromUTF16LE(const UChar* stringStart,
+ size_t length);
std::size_t hash() const {
if (!hash_code) {
@@ -91,6 +96,10 @@ class String16 {
inline String16 operator+(const String16& other) const {
return String16(m_impl + other.m_impl);
}
+ inline String16& operator+=(const String16& other) {
+ m_impl += other.m_impl;
+ return *this;
+ }
// Defined later, since it uses the String16Builder.
template <typename... T>
diff --git a/deps/v8/src/inspector/string-util.cc b/deps/v8/src/inspector/string-util.cc
index e81c04d66f..20c8951e2a 100644
--- a/deps/v8/src/inspector/string-util.cc
+++ b/deps/v8/src/inspector/string-util.cc
@@ -126,12 +126,6 @@ std::unique_ptr<protocol::Value> StringUtil::parseJSON(const String16& string) {
}
// static
-std::unique_ptr<protocol::Value> StringUtil::parseProtocolMessage(
- const ProtocolMessage& message) {
- return parseJSON(message.json);
-}
-
-// static
ProtocolMessage StringUtil::jsonToMessage(String message) {
ProtocolMessage result;
result.json = std::move(message);
diff --git a/deps/v8/src/inspector/string-util.h b/deps/v8/src/inspector/string-util.h
index a9ce4ff424..513f436136 100644
--- a/deps/v8/src/inspector/string-util.h
+++ b/deps/v8/src/inspector/string-util.h
@@ -45,26 +45,33 @@ class StringUtil {
return s.find(needle);
}
static const size_t kNotFound = String::kNotFound;
- static void builderAppend(StringBuilder& builder, const String& s) {
+ static void builderAppend(
+ StringBuilder& builder, // NOLINT(runtime/references)
+ const String& s) {
builder.append(s);
}
- static void builderAppend(StringBuilder& builder, UChar c) {
+ static void builderAppend(
+ StringBuilder& builder, // NOLINT(runtime/references)
+ UChar c) {
builder.append(c);
}
- static void builderAppend(StringBuilder& builder, const char* s, size_t len) {
+ static void builderAppend(
+ StringBuilder& builder, // NOLINT(runtime/references)
+ const char* s, size_t len) {
builder.append(s, len);
}
static void builderAppendQuotedString(StringBuilder&, const String&);
- static void builderReserve(StringBuilder& builder, size_t capacity) {
+ static void builderReserve(
+ StringBuilder& builder, // NOLINT(runtime/references)
+ size_t capacity) {
builder.reserveCapacity(capacity);
}
- static String builderToString(StringBuilder& builder) {
+ static String builderToString(
+ StringBuilder& builder) { // NOLINT(runtime/references)
return builder.toString();
}
static std::unique_ptr<protocol::Value> parseJSON(const String16& json);
static std::unique_ptr<protocol::Value> parseJSON(const StringView& json);
- static std::unique_ptr<protocol::Value> parseProtocolMessage(
- const ProtocolMessage&);
static ProtocolMessage jsonToMessage(String message);
static ProtocolMessage binaryToMessage(std::vector<uint8_t> message);
@@ -76,6 +83,10 @@ class StringUtil {
return String16(data, length);
}
+ static String fromUTF16LE(const uint16_t* data, size_t length) {
+ return String16::fromUTF16LE(data, length);
+ }
+
static const uint8_t* CharactersLatin1(const String& s) { return nullptr; }
static const uint8_t* CharactersUTF8(const String& s) { return nullptr; }
static const uint16_t* CharactersUTF16(const String& s) {
diff --git a/deps/v8/src/inspector/v8-console-message.cc b/deps/v8/src/inspector/v8-console-message.cc
index 4b7f181e35..458e4d4027 100644
--- a/deps/v8/src/inspector/v8-console-message.cc
+++ b/deps/v8/src/inspector/v8-console-message.cc
@@ -257,8 +257,8 @@ V8ConsoleMessage::wrapArguments(V8InspectorSessionImpl* session,
v8::HandleScope handles(isolate);
v8::Local<v8::Context> context = inspectedContext->context();
- std::unique_ptr<protocol::Array<protocol::Runtime::RemoteObject>> args =
- protocol::Array<protocol::Runtime::RemoteObject>::create();
+ auto args =
+ v8::base::make_unique<protocol::Array<protocol::Runtime::RemoteObject>>();
v8::Local<v8::Value> value = m_arguments[0]->Get(isolate);
if (value->IsObject() && m_type == ConsoleAPIType::kTable &&
@@ -282,7 +282,7 @@ V8ConsoleMessage::wrapArguments(V8InspectorSessionImpl* session,
inspectedContext = inspector->getContext(contextGroupId, contextId);
if (!inspectedContext) return nullptr;
if (wrapped) {
- args->addItem(std::move(wrapped));
+ args->emplace_back(std::move(wrapped));
} else {
args = nullptr;
}
@@ -297,7 +297,7 @@ V8ConsoleMessage::wrapArguments(V8InspectorSessionImpl* session,
args = nullptr;
break;
}
- args->addItem(std::move(wrapped));
+ args->emplace_back(std::move(wrapped));
}
}
return args;
@@ -341,14 +341,15 @@ void V8ConsoleMessage::reportToFrontend(protocol::Runtime::Frontend* frontend,
arguments = wrapArguments(session, generatePreview);
if (!inspector->hasConsoleMessageStorage(contextGroupId)) return;
if (!arguments) {
- arguments = protocol::Array<protocol::Runtime::RemoteObject>::create();
+ arguments = v8::base::make_unique<
+ protocol::Array<protocol::Runtime::RemoteObject>>();
if (!m_message.isEmpty()) {
std::unique_ptr<protocol::Runtime::RemoteObject> messageArg =
protocol::Runtime::RemoteObject::create()
.setType(protocol::Runtime::RemoteObject::TypeEnum::String)
.build();
messageArg->setValue(protocol::StringValue::create(m_message));
- arguments->addItem(std::move(messageArg));
+ arguments->emplace_back(std::move(messageArg));
}
}
Maybe<String16> consoleContext;
@@ -426,9 +427,11 @@ std::unique_ptr<V8ConsoleMessage> V8ConsoleMessage::createForConsoleAPI(
message->m_v8Size +=
v8::debug::EstimatedValueSize(isolate, arguments.at(i));
}
- if (arguments.size())
- message->m_message =
- V8ValueStringBuilder::toString(arguments[0], v8Context);
+ for (size_t i = 0, num_args = arguments.size(); i < num_args; ++i) {
+ if (i) message->m_message += String16(" ");
+ message->m_message +=
+ V8ValueStringBuilder::toString(arguments[i], v8Context);
+ }
v8::Isolate::MessageErrorLevel clientLevel = v8::Isolate::kMessageInfo;
if (type == ConsoleAPIType::kDebug || type == ConsoleAPIType::kCount ||
diff --git a/deps/v8/src/inspector/v8-console.cc b/deps/v8/src/inspector/v8-console.cc
index 37b1d5c7a9..0f476f2316 100644
--- a/deps/v8/src/inspector/v8-console.cc
+++ b/deps/v8/src/inspector/v8-console.cc
@@ -496,11 +496,11 @@ void V8Console::valuesCallback(const v8::FunctionCallbackInfo<v8::Value>& info,
info.GetReturnValue().Set(values);
}
-static void setFunctionBreakpoint(ConsoleHelper& helper, int sessionId,
- v8::Local<v8::Function> function,
- V8DebuggerAgentImpl::BreakpointSource source,
- v8::Local<v8::String> condition,
- bool enable) {
+static void setFunctionBreakpoint(
+ ConsoleHelper& helper, // NOLINT(runtime/references)
+ int sessionId, v8::Local<v8::Function> function,
+ V8DebuggerAgentImpl::BreakpointSource source,
+ v8::Local<v8::String> condition, bool enable) {
V8InspectorSessionImpl* session = helper.session(sessionId);
if (session == nullptr) return;
if (!session->debuggerAgent()->enabled()) return;
diff --git a/deps/v8/src/inspector/v8-debugger-agent-impl.cc b/deps/v8/src/inspector/v8-debugger-agent-impl.cc
index 3301838587..e5458823ea 100644
--- a/deps/v8/src/inspector/v8-debugger-agent-impl.cc
+++ b/deps/v8/src/inspector/v8-debugger-agent-impl.cc
@@ -262,7 +262,7 @@ String16 scopeType(v8::debug::ScopeIterator::ScopeType type) {
Response buildScopes(v8::Isolate* isolate, v8::debug::ScopeIterator* iterator,
InjectedScript* injectedScript,
std::unique_ptr<Array<Scope>>* scopes) {
- *scopes = Array<Scope>::create();
+ *scopes = v8::base::make_unique<Array<Scope>>();
if (!injectedScript) return Response::OK();
if (iterator->Done()) return Response::OK();
@@ -299,7 +299,7 @@ Response buildScopes(v8::Isolate* isolate, v8::debug::ScopeIterator* iterator,
.setColumnNumber(end.GetColumnNumber())
.build());
}
- (*scopes)->addItem(std::move(scope));
+ (*scopes)->emplace_back(std::move(scope));
}
return Response::OK();
}
@@ -472,7 +472,7 @@ Response V8DebuggerAgentImpl::setBreakpointByUrl(
Maybe<int> optionalColumnNumber, Maybe<String16> optionalCondition,
String16* outBreakpointId,
std::unique_ptr<protocol::Array<protocol::Debugger::Location>>* locations) {
- *locations = Array<protocol::Debugger::Location>::create();
+ *locations = v8::base::make_unique<Array<protocol::Debugger::Location>>();
int specified = (optionalURL.isJust() ? 1 : 0) +
(optionalURLRegex.isJust() ? 1 : 0) +
@@ -539,7 +539,7 @@ Response V8DebuggerAgentImpl::setBreakpointByUrl(
if (location && type != BreakpointType::kByUrlRegex) {
hint = breakpointHint(*script.second, lineNumber, columnNumber);
}
- if (location) (*locations)->addItem(std::move(location));
+ if (location) (*locations)->emplace_back(std::move(location));
}
breakpoints->setString(breakpointId, condition);
if (!hint.isEmpty()) {
@@ -708,7 +708,8 @@ Response V8DebuggerAgentImpl::getPossibleBreakpoints(
v8Start, v8End, restrictToFunction.fromMaybe(false), &v8Locations);
}
- *locations = protocol::Array<protocol::Debugger::BreakLocation>::create();
+ *locations = v8::base::make_unique<
+ protocol::Array<protocol::Debugger::BreakLocation>>();
for (size_t i = 0; i < v8Locations.size(); ++i) {
std::unique_ptr<protocol::Debugger::BreakLocation> breakLocation =
protocol::Debugger::BreakLocation::create()
@@ -719,7 +720,7 @@ Response V8DebuggerAgentImpl::getPossibleBreakpoints(
if (v8Locations[i].type() != v8::debug::kCommonBreakLocation) {
breakLocation->setType(breakLocationType(v8Locations[i].type()));
}
- (*locations)->addItem(std::move(breakLocation));
+ (*locations)->emplace_back(std::move(breakLocation));
}
return Response::OK();
}
@@ -871,13 +872,11 @@ Response V8DebuggerAgentImpl::searchInContent(
if (it == m_scripts.end())
return Response::Error("No script for id: " + scriptId);
- std::vector<std::unique_ptr<protocol::Debugger::SearchMatch>> matches =
- searchInTextByLinesImpl(m_session, it->second->source(0), query,
- optionalCaseSensitive.fromMaybe(false),
- optionalIsRegex.fromMaybe(false));
- *results = protocol::Array<protocol::Debugger::SearchMatch>::create();
- for (size_t i = 0; i < matches.size(); ++i)
- (*results)->addItem(std::move(matches[i]));
+ *results =
+ v8::base::make_unique<protocol::Array<protocol::Debugger::SearchMatch>>(
+ searchInTextByLinesImpl(m_session, it->second->source(0), query,
+ optionalCaseSensitive.fromMaybe(false),
+ optionalIsRegex.fromMaybe(false)));
return Response::OK();
}
@@ -1190,7 +1189,7 @@ Response V8DebuggerAgentImpl::setAsyncCallStackDepth(int depth) {
Response V8DebuggerAgentImpl::setBlackboxPatterns(
std::unique_ptr<protocol::Array<String16>> patterns) {
- if (!patterns->length()) {
+ if (patterns->empty()) {
m_blackboxPattern = nullptr;
resetBlackboxedStateCache();
m_state->remove(DebuggerAgentState::blackboxPattern);
@@ -1199,11 +1198,11 @@ Response V8DebuggerAgentImpl::setBlackboxPatterns(
String16Builder patternBuilder;
patternBuilder.append('(');
- for (size_t i = 0; i < patterns->length() - 1; ++i) {
- patternBuilder.append(patterns->get(i));
+ for (size_t i = 0; i < patterns->size() - 1; ++i) {
+ patternBuilder.append((*patterns)[i]);
patternBuilder.append("|");
}
- patternBuilder.append(patterns->get(patterns->length() - 1));
+ patternBuilder.append(patterns->back());
patternBuilder.append(')');
String16 pattern = patternBuilder.toString();
Response response = setBlackboxPattern(pattern);
@@ -1236,16 +1235,16 @@ Response V8DebuggerAgentImpl::setBlackboxedRanges(
if (it == m_scripts.end())
return Response::Error("No script with passed id.");
- if (!inPositions->length()) {
+ if (inPositions->empty()) {
m_blackboxedPositions.erase(scriptId);
it->second->resetBlackboxedStateCache();
return Response::OK();
}
std::vector<std::pair<int, int>> positions;
- positions.reserve(inPositions->length());
- for (size_t i = 0; i < inPositions->length(); ++i) {
- protocol::Debugger::ScriptPosition* position = inPositions->get(i);
+ positions.reserve(inPositions->size());
+ for (const std::unique_ptr<protocol::Debugger::ScriptPosition>& position :
+ *inPositions) {
if (position->getLineNumber() < 0)
return Response::Error("Position missing 'line' or 'line' < 0.");
if (position->getColumnNumber() < 0)
@@ -1271,11 +1270,11 @@ Response V8DebuggerAgentImpl::setBlackboxedRanges(
Response V8DebuggerAgentImpl::currentCallFrames(
std::unique_ptr<Array<CallFrame>>* result) {
if (!isPaused()) {
- *result = Array<CallFrame>::create();
+ *result = v8::base::make_unique<Array<CallFrame>>();
return Response::OK();
}
v8::HandleScope handles(m_isolate);
- *result = Array<CallFrame>::create();
+ *result = v8::base::make_unique<Array<CallFrame>>();
auto iterator = v8::debug::StackTraceIterator::Create(m_isolate);
int frameOrdinal = 0;
for (; !iterator->Done(); iterator->Advance(), frameOrdinal++) {
@@ -1354,7 +1353,7 @@ Response V8DebuggerAgentImpl::currentCallFrames(
if (!res.isSuccess()) return res;
frame->setReturnValue(std::move(value));
}
- (*result)->addItem(std::move(frame));
+ (*result)->emplace_back(std::move(frame));
}
return Response::OK();
}
@@ -1603,7 +1602,7 @@ void V8DebuggerAgentImpl::didPause(
}
}
- std::unique_ptr<Array<String16>> hitBreakpointIds = Array<String16>::create();
+ auto hitBreakpointIds = v8::base::make_unique<Array<String16>>();
for (const auto& id : hitBreakpoints) {
auto it = m_breakpointsOnScriptRun.find(id);
@@ -1619,7 +1618,7 @@ void V8DebuggerAgentImpl::didPause(
continue;
}
const String16& breakpointId = breakpointIterator->second;
- hitBreakpointIds->addItem(breakpointId);
+ hitBreakpointIds->emplace_back(breakpointId);
BreakpointType type;
parseBreakpointId(breakpointId, &type);
if (type != BreakpointType::kDebugCommand) continue;
@@ -1655,7 +1654,8 @@ void V8DebuggerAgentImpl::didPause(
std::unique_ptr<Array<CallFrame>> protocolCallFrames;
Response response = currentCallFrames(&protocolCallFrames);
- if (!response.isSuccess()) protocolCallFrames = Array<CallFrame>::create();
+ if (!response.isSuccess())
+ protocolCallFrames = v8::base::make_unique<Array<CallFrame>>();
m_frontend.paused(std::move(protocolCallFrames), breakReason,
std::move(breakAuxData), std::move(hitBreakpointIds),
diff --git a/deps/v8/src/inspector/v8-debugger-script.cc b/deps/v8/src/inspector/v8-debugger-script.cc
index fe7d570942..b83eafc96a 100644
--- a/deps/v8/src/inspector/v8-debugger-script.cc
+++ b/deps/v8/src/inspector/v8-debugger-script.cc
@@ -4,7 +4,7 @@
#include "src/inspector/v8-debugger-script.h"
-#include "src/common/v8memory.h"
+#include "src/base/memory.h"
#include "src/inspector/inspected-context.h"
#include "src/inspector/string-util.h"
#include "src/inspector/v8-debugger-agent-impl.h"
@@ -44,7 +44,7 @@ String16 calculateHash(v8::Isolate* isolate, v8::Local<v8::String> source) {
size_t sizeInBytes = sizeof(UChar) * written;
data = reinterpret_cast<const uint32_t*>(buffer.get());
for (size_t i = 0; i < sizeInBytes / 4; ++i) {
- uint32_t d = v8::internal::ReadUnalignedUInt32(
+ uint32_t d = v8::base::ReadUnalignedValue<uint32_t>(
reinterpret_cast<v8::internal::Address>(data + i));
#if V8_TARGET_LITTLE_ENDIAN
uint32_t v = d;
diff --git a/deps/v8/src/inspector/v8-debugger.cc b/deps/v8/src/inspector/v8-debugger.cc
index bc0c9d8cf6..5ddc375a80 100644
--- a/deps/v8/src/inspector/v8-debugger.cc
+++ b/deps/v8/src/inspector/v8-debugger.cc
@@ -24,7 +24,7 @@ static const int kMaxAsyncTaskStacks = 128 * 1024;
static const int kNoBreakpointId = 0;
template <typename Map>
-void cleanupExpiredWeakPointers(Map& map) {
+void cleanupExpiredWeakPointers(Map& map) { // NOLINT(runtime/references)
for (auto it = map.begin(); it != map.end();) {
if (it->second.expired()) {
it = map.erase(it);
@@ -42,6 +42,7 @@ class MatchPrototypePredicate : public v8::debug::QueryObjectPredicate {
: m_inspector(inspector), m_context(context), m_prototype(prototype) {}
bool Filter(v8::Local<v8::Object> object) override {
+ if (object->IsModuleNamespaceObject()) return false;
v8::Local<v8::Context> objectContext =
v8::debug::GetCreationContext(object);
if (objectContext != m_context) return false;
diff --git a/deps/v8/src/inspector/v8-heap-profiler-agent-impl.cc b/deps/v8/src/inspector/v8-heap-profiler-agent-impl.cc
index b1d60877fe..fcee8a6ef3 100644
--- a/deps/v8/src/inspector/v8-heap-profiler-agent-impl.cc
+++ b/deps/v8/src/inspector/v8-heap-profiler-agent-impl.cc
@@ -4,6 +4,7 @@
#include "src/inspector/v8-heap-profiler-agent-impl.h"
+#include "src/base/template-utils.h"
#include "src/inspector/injected-script.h"
#include "src/inspector/inspected-context.h"
#include "src/inspector/protocol/Protocol.h"
@@ -127,12 +128,11 @@ class HeapStatsStream final : public v8::OutputStream {
WriteResult WriteHeapStatsChunk(v8::HeapStatsUpdate* updateData,
int count) override {
DCHECK_GT(count, 0);
- std::unique_ptr<protocol::Array<int>> statsDiff =
- protocol::Array<int>::create();
+ auto statsDiff = v8::base::make_unique<protocol::Array<int>>();
for (int i = 0; i < count; ++i) {
- statsDiff->addItem(updateData[i].index);
- statsDiff->addItem(updateData[i].count);
- statsDiff->addItem(updateData[i].size);
+ statsDiff->emplace_back(updateData[i].index);
+ statsDiff->emplace_back(updateData[i].count);
+ statsDiff->emplace_back(updateData[i].size);
}
m_frontend->heapStatsUpdate(std::move(statsDiff));
return kContinue;
@@ -337,10 +337,10 @@ namespace {
std::unique_ptr<protocol::HeapProfiler::SamplingHeapProfileNode>
buildSampingHeapProfileNode(v8::Isolate* isolate,
const v8::AllocationProfile::Node* node) {
- auto children = protocol::Array<
- protocol::HeapProfiler::SamplingHeapProfileNode>::create();
+ auto children = v8::base::make_unique<
+ protocol::Array<protocol::HeapProfiler::SamplingHeapProfileNode>>();
for (const auto* child : node->children)
- children->addItem(buildSampingHeapProfileNode(isolate, child));
+ children->emplace_back(buildSampingHeapProfileNode(isolate, child));
size_t selfSize = 0;
for (const auto& allocation : node->allocations)
selfSize += allocation.size * allocation.count;
@@ -384,14 +384,15 @@ Response V8HeapProfilerAgentImpl::getSamplingProfile(
if (!v8Profile)
return Response::Error("V8 sampling heap profiler was not started.");
v8::AllocationProfile::Node* root = v8Profile->GetRootNode();
- auto samples = protocol::Array<
- protocol::HeapProfiler::SamplingHeapProfileSample>::create();
+ auto samples = v8::base::make_unique<
+ protocol::Array<protocol::HeapProfiler::SamplingHeapProfileSample>>();
for (const auto& sample : v8Profile->GetSamples()) {
- samples->addItem(protocol::HeapProfiler::SamplingHeapProfileSample::create()
- .setSize(sample.size * sample.count)
- .setNodeId(sample.node_id)
- .setOrdinal(static_cast<double>(sample.sample_id))
- .build());
+ samples->emplace_back(
+ protocol::HeapProfiler::SamplingHeapProfileSample::create()
+ .setSize(sample.size * sample.count)
+ .setNodeId(sample.node_id)
+ .setOrdinal(static_cast<double>(sample.sample_id))
+ .build());
}
*profile = protocol::HeapProfiler::SamplingHeapProfile::create()
.setHead(buildSampingHeapProfileNode(m_isolate, root))
diff --git a/deps/v8/src/inspector/v8-inspector-session-impl.cc b/deps/v8/src/inspector/v8-inspector-session-impl.cc
index 4242abb64a..fdfb41924c 100644
--- a/deps/v8/src/inspector/v8-inspector-session-impl.cc
+++ b/deps/v8/src/inspector/v8-inspector-session-impl.cc
@@ -161,53 +161,28 @@ protocol::DictionaryValue* V8InspectorSessionImpl::agentState(
return state;
}
-namespace {
-
-class MessageBuffer : public StringBuffer {
- public:
- static std::unique_ptr<MessageBuffer> create(
- std::unique_ptr<protocol::Serializable> message, bool binary) {
- return std::unique_ptr<MessageBuffer>(
- new MessageBuffer(std::move(message), binary));
- }
-
- const StringView& string() override {
- if (!m_serialized) {
- if (m_binary) {
- // Encode binary response as an 8bit string buffer.
- m_serialized.reset(
- new BinaryStringBuffer(m_message->serializeToBinary()));
- } else {
- m_serialized =
- StringBuffer::create(toStringView(m_message->serializeToJSON()));
- }
- m_message.reset(nullptr);
- }
- return m_serialized->string();
- }
-
- private:
- explicit MessageBuffer(std::unique_ptr<protocol::Serializable> message,
- bool binary)
- : m_message(std::move(message)), m_binary(binary) {}
-
- std::unique_ptr<protocol::Serializable> m_message;
- std::unique_ptr<StringBuffer> m_serialized;
- bool m_binary;
-};
-
-} // namespace
+std::unique_ptr<StringBuffer> V8InspectorSessionImpl::serializeForFrontend(
+ std::unique_ptr<protocol::Serializable> message) {
+ std::vector<uint8_t> cbor = message->serializeToBinary();
+ if (use_binary_protocol_)
+ return std::unique_ptr<StringBuffer>(
+ new BinaryStringBuffer(std::move(cbor)));
+ std::vector<uint8_t> json;
+ IPEStatus status = ConvertCBORToJSON(SpanFrom(cbor), &json);
+ DCHECK(status.ok());
+ USE(status);
+ String16 string16(reinterpret_cast<const char*>(json.data()), json.size());
+ return StringBufferImpl::adopt(string16);
+}
void V8InspectorSessionImpl::sendProtocolResponse(
int callId, std::unique_ptr<protocol::Serializable> message) {
- m_channel->sendResponse(
- callId, MessageBuffer::create(std::move(message), use_binary_protocol_));
+ m_channel->sendResponse(callId, serializeForFrontend(std::move(message)));
}
void V8InspectorSessionImpl::sendProtocolNotification(
std::unique_ptr<protocol::Serializable> message) {
- m_channel->sendNotification(
- MessageBuffer::create(std::move(message), use_binary_protocol_));
+ m_channel->sendNotification(serializeForFrontend(std::move(message)));
}
void V8InspectorSessionImpl::fallThrough(
@@ -357,20 +332,30 @@ void V8InspectorSessionImpl::reportAllContexts(V8RuntimeAgentImpl* agent) {
void V8InspectorSessionImpl::dispatchProtocolMessage(
const StringView& message) {
- bool binary_protocol = IsCBORMessage(message);
- if (binary_protocol) {
+ using ::v8_inspector_protocol_encoding::span;
+ using ::v8_inspector_protocol_encoding::SpanFrom;
+ span<uint8_t> cbor;
+ std::vector<uint8_t> converted_cbor;
+ if (IsCBORMessage(message)) {
use_binary_protocol_ = true;
m_state->setBoolean("use_binary_protocol", true);
- }
-
- int callId;
- std::unique_ptr<protocol::Value> parsed_message;
- if (binary_protocol) {
- parsed_message = protocol::Value::parseBinary(
- message.characters8(), static_cast<unsigned>(message.length()));
+ cbor = span<uint8_t>(message.characters8(), message.length());
} else {
- parsed_message = protocol::StringUtil::parseJSON(message);
+ if (message.is8Bit()) {
+ // We're ignoring the return value of these conversion functions
+ // intentionally. It means the |parsed_message| below will be nullptr.
+ ConvertJSONToCBOR(span<uint8_t>(message.characters8(), message.length()),
+ &converted_cbor);
+ } else {
+ ConvertJSONToCBOR(
+ span<uint16_t>(message.characters16(), message.length()),
+ &converted_cbor);
+ }
+ cbor = SpanFrom(converted_cbor);
}
+ int callId;
+ std::unique_ptr<protocol::Value> parsed_message =
+ protocol::Value::parseBinary(cbor.data(), cbor.size());
String16 method;
if (m_dispatcher.parseCommand(parsed_message.get(), &callId, &method)) {
// Pass empty string instead of the actual message to save on a conversion.
@@ -380,14 +365,6 @@ void V8InspectorSessionImpl::dispatchProtocolMessage(
}
}
-std::unique_ptr<StringBuffer> V8InspectorSessionImpl::stateJSON() {
- std::vector<uint8_t> json;
- IPEStatus status = ConvertCBORToJSON(SpanFrom(state()), &json);
- DCHECK(status.ok());
- USE(status);
- return v8::base::make_unique<BinaryStringBuffer>(std::move(json));
-}
-
std::vector<uint8_t> V8InspectorSessionImpl::state() {
std::vector<uint8_t> out;
m_state->writeBinary(&out);
diff --git a/deps/v8/src/inspector/v8-inspector-session-impl.h b/deps/v8/src/inspector/v8-inspector-session-impl.h
index ea1d29773c..7a976bcd40 100644
--- a/deps/v8/src/inspector/v8-inspector-session-impl.h
+++ b/deps/v8/src/inspector/v8-inspector-session-impl.h
@@ -64,7 +64,6 @@ class V8InspectorSessionImpl : public V8InspectorSession,
// V8InspectorSession implementation.
void dispatchProtocolMessage(const StringView& message) override;
- std::unique_ptr<StringBuffer> stateJSON() override;
std::vector<uint8_t> state() override;
std::vector<std::unique_ptr<protocol::Schema::API::Domain>> supportedDomains()
override;
@@ -106,6 +105,8 @@ class V8InspectorSessionImpl : public V8InspectorSession,
const protocol::ProtocolMessage& message) override;
void flushProtocolNotifications() override;
+ std::unique_ptr<StringBuffer> serializeForFrontend(
+ std::unique_ptr<protocol::Serializable> message);
int m_contextGroupId;
int m_sessionId;
V8InspectorImpl* m_inspector;
diff --git a/deps/v8/src/inspector/v8-profiler-agent-impl.cc b/deps/v8/src/inspector/v8-profiler-agent-impl.cc
index 15f93e39d7..3b02f7faa1 100644
--- a/deps/v8/src/inspector/v8-profiler-agent-impl.cc
+++ b/deps/v8/src/inspector/v8-profiler-agent-impl.cc
@@ -44,7 +44,8 @@ std::unique_ptr<protocol::Array<protocol::Profiler::PositionTickInfo>>
buildInspectorObjectForPositionTicks(const v8::CpuProfileNode* node) {
unsigned lineCount = node->GetHitLineCount();
if (!lineCount) return nullptr;
- auto array = protocol::Array<protocol::Profiler::PositionTickInfo>::create();
+ auto array = v8::base::make_unique<
+ protocol::Array<protocol::Profiler::PositionTickInfo>>();
std::vector<v8::CpuProfileNode::LineTick> entries(lineCount);
if (node->GetLineTicks(&entries[0], lineCount)) {
for (unsigned i = 0; i < lineCount; i++) {
@@ -53,7 +54,7 @@ buildInspectorObjectForPositionTicks(const v8::CpuProfileNode* node) {
.setLine(entries[i].line)
.setTicks(entries[i].hit_count)
.build();
- array->addItem(std::move(line));
+ array->emplace_back(std::move(line));
}
}
return array;
@@ -79,9 +80,9 @@ std::unique_ptr<protocol::Profiler::ProfileNode> buildInspectorObjectFor(
const int childrenCount = node->GetChildrenCount();
if (childrenCount) {
- auto children = protocol::Array<int>::create();
+ auto children = v8::base::make_unique<protocol::Array<int>>();
for (int i = 0; i < childrenCount; i++)
- children->addItem(node->GetChild(i)->GetNodeId());
+ children->emplace_back(node->GetChild(i)->GetNodeId());
result->setChildren(std::move(children));
}
@@ -97,21 +98,21 @@ std::unique_ptr<protocol::Profiler::ProfileNode> buildInspectorObjectFor(
std::unique_ptr<protocol::Array<int>> buildInspectorObjectForSamples(
v8::CpuProfile* v8profile) {
- auto array = protocol::Array<int>::create();
+ auto array = v8::base::make_unique<protocol::Array<int>>();
int count = v8profile->GetSamplesCount();
for (int i = 0; i < count; i++)
- array->addItem(v8profile->GetSample(i)->GetNodeId());
+ array->emplace_back(v8profile->GetSample(i)->GetNodeId());
return array;
}
std::unique_ptr<protocol::Array<int>> buildInspectorObjectForTimestamps(
v8::CpuProfile* v8profile) {
- auto array = protocol::Array<int>::create();
+ auto array = v8::base::make_unique<protocol::Array<int>>();
int count = v8profile->GetSamplesCount();
uint64_t lastTime = v8profile->GetStartTime();
for (int i = 0; i < count; i++) {
uint64_t ts = v8profile->GetSampleTimestamp(i);
- array->addItem(static_cast<int>(ts - lastTime));
+ array->emplace_back(static_cast<int>(ts - lastTime));
lastTime = ts;
}
return array;
@@ -120,7 +121,7 @@ std::unique_ptr<protocol::Array<int>> buildInspectorObjectForTimestamps(
void flattenNodesTree(V8InspectorImpl* inspector,
const v8::CpuProfileNode* node,
protocol::Array<protocol::Profiler::ProfileNode>* list) {
- list->addItem(buildInspectorObjectFor(inspector, node));
+ list->emplace_back(buildInspectorObjectFor(inspector, node));
const int childrenCount = node->GetChildrenCount();
for (int i = 0; i < childrenCount; i++)
flattenNodesTree(inspector, node->GetChild(i), list);
@@ -128,7 +129,8 @@ void flattenNodesTree(V8InspectorImpl* inspector,
std::unique_ptr<protocol::Profiler::Profile> createCPUProfile(
V8InspectorImpl* inspector, v8::CpuProfile* v8profile) {
- auto nodes = protocol::Array<protocol::Profiler::ProfileNode>::create();
+ auto nodes =
+ v8::base::make_unique<protocol::Array<protocol::Profiler::ProfileNode>>();
flattenNodesTree(inspector, v8profile->GetTopDownRoot(), nodes.get());
return protocol::Profiler::Profile::create()
.setNodes(std::move(nodes))
@@ -336,36 +338,35 @@ Response coverageToProtocol(
V8InspectorImpl* inspector, const v8::debug::Coverage& coverage,
std::unique_ptr<protocol::Array<protocol::Profiler::ScriptCoverage>>*
out_result) {
- std::unique_ptr<protocol::Array<protocol::Profiler::ScriptCoverage>> result =
- protocol::Array<protocol::Profiler::ScriptCoverage>::create();
+ auto result = v8::base::make_unique<
+ protocol::Array<protocol::Profiler::ScriptCoverage>>();
v8::Isolate* isolate = inspector->isolate();
for (size_t i = 0; i < coverage.ScriptCount(); i++) {
v8::debug::Coverage::ScriptData script_data = coverage.GetScriptData(i);
v8::Local<v8::debug::Script> script = script_data.GetScript();
- std::unique_ptr<protocol::Array<protocol::Profiler::FunctionCoverage>>
- functions =
- protocol::Array<protocol::Profiler::FunctionCoverage>::create();
+ auto functions = v8::base::make_unique<
+ protocol::Array<protocol::Profiler::FunctionCoverage>>();
for (size_t j = 0; j < script_data.FunctionCount(); j++) {
v8::debug::Coverage::FunctionData function_data =
script_data.GetFunctionData(j);
- std::unique_ptr<protocol::Array<protocol::Profiler::CoverageRange>>
- ranges = protocol::Array<protocol::Profiler::CoverageRange>::create();
+ auto ranges = v8::base::make_unique<
+ protocol::Array<protocol::Profiler::CoverageRange>>();
// Add function range.
- ranges->addItem(createCoverageRange(function_data.StartOffset(),
- function_data.EndOffset(),
- function_data.Count()));
+ ranges->emplace_back(createCoverageRange(function_data.StartOffset(),
+ function_data.EndOffset(),
+ function_data.Count()));
// Process inner blocks.
for (size_t k = 0; k < function_data.BlockCount(); k++) {
v8::debug::Coverage::BlockData block_data =
function_data.GetBlockData(k);
- ranges->addItem(createCoverageRange(block_data.StartOffset(),
- block_data.EndOffset(),
- block_data.Count()));
+ ranges->emplace_back(createCoverageRange(block_data.StartOffset(),
+ block_data.EndOffset(),
+ block_data.Count()));
}
- functions->addItem(
+ functions->emplace_back(
protocol::Profiler::FunctionCoverage::create()
.setFunctionName(toProtocolString(
isolate,
@@ -381,11 +382,11 @@ Response coverageToProtocol(
} else if (script->Name().ToLocal(&name) && name->Length()) {
url = resourceNameToUrl(inspector, name);
}
- result->addItem(protocol::Profiler::ScriptCoverage::create()
- .setScriptId(String16::fromInteger(script->Id()))
- .setUrl(url)
- .setFunctions(std::move(functions))
- .build());
+ result->emplace_back(protocol::Profiler::ScriptCoverage::create()
+ .setScriptId(String16::fromInteger(script->Id()))
+ .setUrl(url)
+ .setFunctions(std::move(functions))
+ .build());
}
*out_result = std::move(result);
return Response::OK();
@@ -417,31 +418,30 @@ namespace {
std::unique_ptr<protocol::Array<protocol::Profiler::ScriptTypeProfile>>
typeProfileToProtocol(V8InspectorImpl* inspector,
const v8::debug::TypeProfile& type_profile) {
- std::unique_ptr<protocol::Array<protocol::Profiler::ScriptTypeProfile>>
- result = protocol::Array<protocol::Profiler::ScriptTypeProfile>::create();
+ auto result = v8::base::make_unique<
+ protocol::Array<protocol::Profiler::ScriptTypeProfile>>();
v8::Isolate* isolate = inspector->isolate();
for (size_t i = 0; i < type_profile.ScriptCount(); i++) {
v8::debug::TypeProfile::ScriptData script_data =
type_profile.GetScriptData(i);
v8::Local<v8::debug::Script> script = script_data.GetScript();
- std::unique_ptr<protocol::Array<protocol::Profiler::TypeProfileEntry>>
- entries =
- protocol::Array<protocol::Profiler::TypeProfileEntry>::create();
+ auto entries = v8::base::make_unique<
+ protocol::Array<protocol::Profiler::TypeProfileEntry>>();
for (const auto& entry : script_data.Entries()) {
- std::unique_ptr<protocol::Array<protocol::Profiler::TypeObject>> types =
- protocol::Array<protocol::Profiler::TypeObject>::create();
+ auto types = v8::base::make_unique<
+ protocol::Array<protocol::Profiler::TypeObject>>();
for (const auto& type : entry.Types()) {
- types->addItem(
+ types->emplace_back(
protocol::Profiler::TypeObject::create()
.setName(toProtocolString(
isolate, type.FromMaybe(v8::Local<v8::String>())))
.build());
}
- entries->addItem(protocol::Profiler::TypeProfileEntry::create()
- .setOffset(entry.SourcePosition())
- .setTypes(std::move(types))
- .build());
+ entries->emplace_back(protocol::Profiler::TypeProfileEntry::create()
+ .setOffset(entry.SourcePosition())
+ .setTypes(std::move(types))
+ .build());
}
String16 url;
v8::Local<v8::String> name;
@@ -450,11 +450,11 @@ typeProfileToProtocol(V8InspectorImpl* inspector,
} else if (script->Name().ToLocal(&name) && name->Length()) {
url = resourceNameToUrl(inspector, name);
}
- result->addItem(protocol::Profiler::ScriptTypeProfile::create()
- .setScriptId(String16::fromInteger(script->Id()))
- .setUrl(url)
- .setEntries(std::move(entries))
- .build());
+ result->emplace_back(protocol::Profiler::ScriptTypeProfile::create()
+ .setScriptId(String16::fromInteger(script->Id()))
+ .setUrl(url)
+ .setEntries(std::move(entries))
+ .build());
}
return result;
}
diff --git a/deps/v8/src/inspector/v8-runtime-agent-impl.cc b/deps/v8/src/inspector/v8-runtime-agent-impl.cc
index 601f263c7a..fd2d35abd7 100644
--- a/deps/v8/src/inspector/v8-runtime-agent-impl.cc
+++ b/deps/v8/src/inspector/v8-runtime-agent-impl.cc
@@ -107,7 +107,8 @@ bool wrapEvaluateResultAsync(InjectedScript* injectedScript,
}
void innerCallFunctionOn(
- V8InspectorSessionImpl* session, InjectedScript::Scope& scope,
+ V8InspectorSessionImpl* session,
+ InjectedScript::Scope& scope, // NOLINT(runtime/references)
v8::Local<v8::Value> recv, const String16& expression,
Maybe<protocol::Array<protocol::Runtime::CallArgument>> optionalArguments,
bool silent, WrapMode wrapMode, bool userGesture, bool awaitPromise,
@@ -120,12 +121,12 @@ void innerCallFunctionOn(
if (optionalArguments.isJust()) {
protocol::Array<protocol::Runtime::CallArgument>* arguments =
optionalArguments.fromJust();
- argc = static_cast<int>(arguments->length());
+ argc = static_cast<int>(arguments->size());
argv.reset(new v8::Local<v8::Value>[argc]);
for (int i = 0; i < argc; ++i) {
v8::Local<v8::Value> argumentValue;
Response response = scope.injectedScript()->resolveCallArgument(
- arguments->get(i), &argumentValue);
+ (*arguments)[i].get(), &argumentValue);
if (!response.isSuccess()) {
callback->sendFailure(response);
return;
@@ -419,9 +420,9 @@ Response V8RuntimeAgentImpl::getProperties(
object, scope.objectGroupName(), &internalPropertiesProtocolArray,
&privatePropertiesProtocolArray);
if (!response.isSuccess()) return response;
- if (internalPropertiesProtocolArray->length())
+ if (!internalPropertiesProtocolArray->empty())
*internalProperties = std::move(internalPropertiesProtocolArray);
- if (privatePropertiesProtocolArray->length())
+ if (!privatePropertiesProtocolArray->empty())
*privateProperties = std::move(privatePropertiesProtocolArray);
return Response::OK();
}
@@ -612,9 +613,9 @@ Response V8RuntimeAgentImpl::globalLexicalScopeNames(
v8::PersistentValueVector<v8::String> names(m_inspector->isolate());
v8::debug::GlobalLexicalScopeNames(scope.context(), &names);
- *outNames = protocol::Array<String16>::create();
+ *outNames = v8::base::make_unique<protocol::Array<String16>>();
for (size_t i = 0; i < names.Size(); ++i) {
- (*outNames)->addItem(
+ (*outNames)->emplace_back(
toProtocolString(m_inspector->isolate(), names.Get(i)));
}
return Response::OK();
diff --git a/deps/v8/src/inspector/v8-schema-agent-impl.cc b/deps/v8/src/inspector/v8-schema-agent-impl.cc
index 07bbd35d97..808f59b0bf 100644
--- a/deps/v8/src/inspector/v8-schema-agent-impl.cc
+++ b/deps/v8/src/inspector/v8-schema-agent-impl.cc
@@ -4,6 +4,7 @@
#include "src/inspector/v8-schema-agent-impl.h"
+#include "src/base/template-utils.h"
#include "src/inspector/protocol/Protocol.h"
#include "src/inspector/v8-inspector-session-impl.h"
@@ -18,11 +19,9 @@ V8SchemaAgentImpl::~V8SchemaAgentImpl() = default;
Response V8SchemaAgentImpl::getDomains(
std::unique_ptr<protocol::Array<protocol::Schema::Domain>>* result) {
- std::vector<std::unique_ptr<protocol::Schema::Domain>> domains =
- m_session->supportedDomainsImpl();
- *result = protocol::Array<protocol::Schema::Domain>::create();
- for (size_t i = 0; i < domains.size(); ++i)
- (*result)->addItem(std::move(domains[i]));
+ *result = v8::base::make_unique<
+ std::vector<std::unique_ptr<protocol::Schema::Domain>>>(
+ m_session->supportedDomainsImpl());
return Response::OK();
}
diff --git a/deps/v8/src/inspector/v8-stack-trace-impl.cc b/deps/v8/src/inspector/v8-stack-trace-impl.cc
index 8bf16b4baf..e2be811069 100644
--- a/deps/v8/src/inspector/v8-stack-trace-impl.cc
+++ b/deps/v8/src/inspector/v8-stack-trace-impl.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "src/base/template-utils.h"
#include "src/inspector/v8-debugger.h"
#include "src/inspector/v8-inspector-impl.h"
#include "src/inspector/wasm-translation.h"
@@ -72,13 +73,13 @@ std::unique_ptr<protocol::Runtime::StackTrace> buildInspectorObjectCommon(
return asyncParent->buildInspectorObject(debugger, maxAsyncDepth);
}
- std::unique_ptr<protocol::Array<protocol::Runtime::CallFrame>>
- inspectorFrames = protocol::Array<protocol::Runtime::CallFrame>::create();
- for (size_t i = 0; i < frames.size(); i++) {
+ auto inspectorFrames =
+ v8::base::make_unique<protocol::Array<protocol::Runtime::CallFrame>>();
+ for (const std::shared_ptr<StackFrame>& frame : frames) {
V8InspectorClient* client = nullptr;
if (debugger && debugger->inspector())
client = debugger->inspector()->client();
- inspectorFrames->addItem(frames[i]->buildInspectorObject(client));
+ inspectorFrames->emplace_back(frame->buildInspectorObject(client));
}
std::unique_ptr<protocol::Runtime::StackTrace> stackTrace =
protocol::Runtime::StackTrace::create()
@@ -284,6 +285,12 @@ V8StackTraceImpl::buildInspectorObject() const {
return buildInspectorObjectImpl(nullptr);
}
+std::unique_ptr<protocol::Runtime::API::StackTrace>
+V8StackTraceImpl::buildInspectorObject(int maxAsyncDepth) const {
+ return buildInspectorObjectImpl(nullptr,
+ std::min(maxAsyncDepth, m_maxAsyncDepth));
+}
+
std::unique_ptr<StringBuffer> V8StackTraceImpl::toString() const {
String16Builder stackTrace;
for (size_t i = 0; i < m_frames.size(); ++i) {
diff --git a/deps/v8/src/inspector/v8-stack-trace-impl.h b/deps/v8/src/inspector/v8-stack-trace-impl.h
index 1142cfaa82..681b3c2aba 100644
--- a/deps/v8/src/inspector/v8-stack-trace-impl.h
+++ b/deps/v8/src/inspector/v8-stack-trace-impl.h
@@ -78,6 +78,8 @@ class V8StackTraceImpl : public V8StackTrace {
StringView topFunctionName() const override;
std::unique_ptr<protocol::Runtime::API::StackTrace> buildInspectorObject()
const override;
+ std::unique_ptr<protocol::Runtime::API::StackTrace> buildInspectorObject(
+ int maxAsyncDepth) const override;
std::unique_ptr<StringBuffer> toString() const override;
bool isEqualIgnoringTopFrame(V8StackTraceImpl* stackTrace) const;
diff --git a/deps/v8/src/inspector/v8-string-conversions.cc b/deps/v8/src/inspector/v8-string-conversions.cc
index 0c75e66b97..4ccf6351fb 100644
--- a/deps/v8/src/inspector/v8-string-conversions.cc
+++ b/deps/v8/src/inspector/v8-string-conversions.cc
@@ -228,7 +228,9 @@ static const UChar32 offsetsFromUTF8[6] = {0x00000000UL,
static_cast<UChar32>(0xFA082080UL),
static_cast<UChar32>(0x82082080UL)};
-static inline UChar32 readUTF8Sequence(const char*& sequence, size_t length) {
+static inline UChar32 readUTF8Sequence(
+ const char*& sequence, // NOLINT(runtime/references)
+ size_t length) {
UChar32 character = 0;
// The cases all fall through.
@@ -334,7 +336,8 @@ ConversionResult convertUTF8ToUTF16(const char** sourceStart,
// Helper to write a three-byte UTF-8 code point to the buffer, caller must
// check room is available.
-static inline void putUTF8Triple(char*& buffer, UChar ch) {
+static inline void putUTF8Triple(char*& buffer, // NOLINT(runtime/references)
+ UChar ch) {
*buffer++ = static_cast<char>(((ch >> 12) & 0x0F) | 0xE0);
*buffer++ = static_cast<char>(((ch >> 6) & 0x3F) | 0x80);
*buffer++ = static_cast<char>((ch & 0x3F) | 0x80);
diff --git a/deps/v8/src/inspector/value-mirror.cc b/deps/v8/src/inspector/value-mirror.cc
index 72eef3cd3f..3ab9085c44 100644
--- a/deps/v8/src/inspector/value-mirror.cc
+++ b/deps/v8/src/inspector/value-mirror.cc
@@ -351,7 +351,8 @@ class PrimitiveValueMirror final : public ValueMirror {
.setType(m_type)
.setDescription(descriptionForPrimitiveType(context, m_value))
.setOverflow(false)
- .setProperties(protocol::Array<PropertyPreview>::create())
+ .setProperties(
+ v8::base::make_unique<protocol::Array<PropertyPreview>>())
.build();
if (m_value->IsNull())
(*preview)->setSubtype(RemoteObject::SubtypeEnum::Null);
@@ -411,12 +412,14 @@ class NumberMirror final : public ValueMirror {
v8::Local<v8::Context> context, int* nameLimit, int* indexLimit,
std::unique_ptr<ObjectPreview>* preview) const override {
bool unserializable = false;
- *preview = ObjectPreview::create()
- .setType(RemoteObject::TypeEnum::Number)
- .setDescription(description(&unserializable))
- .setOverflow(false)
- .setProperties(protocol::Array<PropertyPreview>::create())
- .build();
+ *preview =
+ ObjectPreview::create()
+ .setType(RemoteObject::TypeEnum::Number)
+ .setDescription(description(&unserializable))
+ .setOverflow(false)
+ .setProperties(
+ v8::base::make_unique<protocol::Array<PropertyPreview>>())
+ .build();
}
private:
@@ -467,12 +470,14 @@ class BigIntMirror final : public ValueMirror {
int* indexLimit,
std::unique_ptr<protocol::Runtime::ObjectPreview>*
preview) const override {
- *preview = ObjectPreview::create()
- .setType(RemoteObject::TypeEnum::Bigint)
- .setDescription(descriptionForBigInt(context, m_value))
- .setOverflow(false)
- .setProperties(protocol::Array<PropertyPreview>::create())
- .build();
+ *preview =
+ ObjectPreview::create()
+ .setType(RemoteObject::TypeEnum::Bigint)
+ .setDescription(descriptionForBigInt(context, m_value))
+ .setOverflow(false)
+ .setProperties(
+ v8::base::make_unique<protocol::Array<PropertyPreview>>())
+ .build();
}
v8::Local<v8::Value> v8Value() const override { return m_value; }
@@ -625,12 +630,14 @@ class FunctionMirror final : public ValueMirror {
void buildEntryPreview(
v8::Local<v8::Context> context, int* nameLimit, int* indexLimit,
std::unique_ptr<ObjectPreview>* preview) const override {
- *preview = ObjectPreview::create()
- .setType(RemoteObject::TypeEnum::Function)
- .setDescription(descriptionForFunction(context, m_value))
- .setOverflow(false)
- .setProperties(protocol::Array<PropertyPreview>::create())
- .build();
+ *preview =
+ ObjectPreview::create()
+ .setType(RemoteObject::TypeEnum::Function)
+ .setDescription(descriptionForFunction(context, m_value))
+ .setOverflow(false)
+ .setProperties(
+ v8::base::make_unique<protocol::Array<PropertyPreview>>())
+ .build();
}
private:
@@ -824,7 +831,7 @@ void getPrivatePropertiesForPreview(
return;
}
--*nameLimit;
- privateProperties->addItem(std::move(propertyPreview));
+ privateProperties->emplace_back(std::move(propertyPreview));
}
}
@@ -911,8 +918,7 @@ class ObjectMirror final : public ValueMirror {
v8::Local<v8::Context> context, bool forEntry,
bool generatePreviewForTable, int* nameLimit, int* indexLimit,
std::unique_ptr<ObjectPreview>* result) const {
- std::unique_ptr<protocol::Array<PropertyPreview>> properties =
- protocol::Array<PropertyPreview>::create();
+ auto properties = v8::base::make_unique<protocol::Array<PropertyPreview>>();
std::unique_ptr<protocol::Array<EntryPreview>> entriesPreview;
bool overflow = false;
@@ -929,7 +935,7 @@ class ObjectMirror final : public ValueMirror {
internalProperties[i].value->buildPropertyPreview(
context, internalProperties[i].name, &propertyPreview);
if (propertyPreview) {
- properties->addItem(std::move(propertyPreview));
+ properties->emplace_back(std::move(propertyPreview));
}
}
@@ -959,7 +965,7 @@ class ObjectMirror final : public ValueMirror {
if (valuePreview) {
preview->setValuePreview(std::move(valuePreview));
}
- properties->addItem(std::move(preview));
+ properties->emplace_back(std::move(preview));
}
}
@@ -969,7 +975,8 @@ class ObjectMirror final : public ValueMirror {
if (forEntry) {
overflow = true;
} else {
- entriesPreview = protocol::Array<EntryPreview>::create();
+ entriesPreview =
+ v8::base::make_unique<protocol::Array<EntryPreview>>();
for (const auto& entry : entries) {
std::unique_ptr<ObjectPreview> valuePreview;
entry.value->buildEntryPreview(context, nameLimit, indexLimit,
@@ -986,7 +993,7 @@ class ObjectMirror final : public ValueMirror {
.setValue(std::move(valuePreview))
.build();
if (keyPreview) entryPreview->setKey(std::move(keyPreview));
- entriesPreview->addItem(std::move(entryPreview));
+ entriesPreview->emplace_back(std::move(entryPreview));
}
}
}
@@ -1145,19 +1152,28 @@ void addTypedArrayViews(v8::Local<v8::Context> context,
v8::Local<ArrayBuffer> buffer,
ValueMirror::PropertyAccumulator* accumulator) {
// TODO(alph): these should be internal properties.
- size_t length = buffer->ByteLength();
+ // TODO(v8:9308): Reconsider how large arrays are previewed.
+ const size_t byte_length = buffer->ByteLength();
+
+ size_t length = byte_length;
+ if (length > v8::TypedArray::kMaxLength) return;
+
addTypedArrayView<v8::Int8Array>(context, buffer, length, "[[Int8Array]]",
accumulator);
addTypedArrayView<v8::Uint8Array>(context, buffer, length, "[[Uint8Array]]",
accumulator);
- if (buffer->ByteLength() % 2 == 0) {
- addTypedArrayView<v8::Int16Array>(context, buffer, length / 2,
- "[[Int16Array]]", accumulator);
- }
- if (buffer->ByteLength() % 4 == 0) {
- addTypedArrayView<v8::Int32Array>(context, buffer, length / 4,
- "[[Int32Array]]", accumulator);
- }
+
+ length = byte_length / 2;
+ if (length > v8::TypedArray::kMaxLength || (byte_length % 2) != 0) return;
+
+ addTypedArrayView<v8::Int16Array>(context, buffer, length, "[[Int16Array]]",
+ accumulator);
+
+ length = byte_length / 4;
+ if (length > v8::TypedArray::kMaxLength || (byte_length % 4) != 0) return;
+
+ addTypedArrayView<v8::Int32Array>(context, buffer, length, "[[Int32Array]]",
+ accumulator);
}
} // anonymous namespace