Roll inspector-protocol to 32cf5f2bf4dc20c73ead291e68d2e2f6b638cd57
Includes: - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/3014475 - https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/3006580 Bug: chromium:1187004, chromium:1187003, chromium:1187006, chromium:1187007 Change-Id: I6afbeb13d6c1f61a9fd7c890068f173b47beb252 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3013351 Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org> Cr-Commit-Position: refs/heads/master@{#75661}
This commit is contained in:
parent
27a1581e40
commit
8cbb823ec1
2
third_party/inspector_protocol/README.v8
vendored
2
third_party/inspector_protocol/README.v8
vendored
@ -2,7 +2,7 @@ Name: inspector protocol
|
|||||||
Short Name: inspector_protocol
|
Short Name: inspector_protocol
|
||||||
URL: https://chromium.googlesource.com/deps/inspector_protocol/
|
URL: https://chromium.googlesource.com/deps/inspector_protocol/
|
||||||
Version: 0
|
Version: 0
|
||||||
Revision: 35e8d2d89cb017d72cf905362672de77c978e1e6
|
Revision: 32cf5f2bf4dc20c73ead291e68d2e2f6b638cd57
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: LICENSE
|
License File: LICENSE
|
||||||
Security Critical: no
|
Security Critical: no
|
||||||
|
@ -33,51 +33,32 @@ std::unique_ptr<protocol::Value> toProtocolValue(
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
if (value->is_none())
|
if (value->is_none())
|
||||||
return protocol::Value::null();
|
return protocol::Value::null();
|
||||||
if (value->is_bool()) {
|
if (value->is_bool())
|
||||||
bool inner;
|
return protocol::FundamentalValue::create(value->GetBool());
|
||||||
value->GetAsBoolean(&inner);
|
if (value->is_int())
|
||||||
return protocol::FundamentalValue::create(inner);
|
return protocol::FundamentalValue::create(value->GetInt());
|
||||||
}
|
if (value->is_double())
|
||||||
if (value->is_int()) {
|
return protocol::FundamentalValue::create(value->GetDouble());
|
||||||
int inner;
|
if (value->is_string())
|
||||||
value->GetAsInteger(&inner);
|
return protocol::StringValue::create(value->GetString());
|
||||||
return protocol::FundamentalValue::create(inner);
|
|
||||||
}
|
|
||||||
if (value->is_double()) {
|
|
||||||
double inner;
|
|
||||||
value->GetAsDouble(&inner);
|
|
||||||
return protocol::FundamentalValue::create(inner);
|
|
||||||
}
|
|
||||||
if (value->is_string()) {
|
|
||||||
std::string inner;
|
|
||||||
value->GetAsString(&inner);
|
|
||||||
return protocol::StringValue::create(inner);
|
|
||||||
}
|
|
||||||
if (value->is_list()) {
|
if (value->is_list()) {
|
||||||
const base::ListValue* list = nullptr;
|
|
||||||
value->GetAsList(&list);
|
|
||||||
std::unique_ptr<protocol::ListValue> result = protocol::ListValue::create();
|
std::unique_ptr<protocol::ListValue> result = protocol::ListValue::create();
|
||||||
for (size_t i = 0; i < list->GetSize(); i++) {
|
for (const base::Value& item : value->GetList()) {
|
||||||
const base::Value* item = nullptr;
|
|
||||||
list->Get(i, &item);
|
|
||||||
std::unique_ptr<protocol::Value> converted =
|
std::unique_ptr<protocol::Value> converted =
|
||||||
toProtocolValue(item, depth - 1);
|
toProtocolValue(&item, depth - 1);
|
||||||
if (converted)
|
if (converted)
|
||||||
result->pushValue(std::move(converted));
|
result->pushValue(std::move(converted));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (value->is_dict()) {
|
if (value->is_dict()) {
|
||||||
const base::DictionaryValue* dictionary = nullptr;
|
|
||||||
value->GetAsDictionary(&dictionary);
|
|
||||||
std::unique_ptr<protocol::DictionaryValue> result =
|
std::unique_ptr<protocol::DictionaryValue> result =
|
||||||
protocol::DictionaryValue::create();
|
protocol::DictionaryValue::create();
|
||||||
for (base::DictionaryValue::Iterator it(*dictionary);
|
for (const auto& it : value->DictItems()) {
|
||||||
!it.IsAtEnd(); it.Advance()) {
|
|
||||||
std::unique_ptr<protocol::Value> converted =
|
std::unique_ptr<protocol::Value> converted =
|
||||||
toProtocolValue(&it.value(), depth - 1);
|
toProtocolValue(&it.second, depth - 1);
|
||||||
if (converted)
|
if (converted)
|
||||||
result->setValue(it.key(), std::move(converted));
|
result->setValue(it.first, std::move(converted));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -111,24 +92,26 @@ std::unique_ptr<base::Value> toBaseValue(Value* value, int depth) {
|
|||||||
}
|
}
|
||||||
if (value->type() == Value::TypeArray) {
|
if (value->type() == Value::TypeArray) {
|
||||||
ListValue* list = ListValue::cast(value);
|
ListValue* list = ListValue::cast(value);
|
||||||
std::unique_ptr<base::ListValue> result(new base::ListValue());
|
std::unique_ptr<base::Value> result(new base::Value(
|
||||||
|
base::Value::Type::LIST));
|
||||||
for (size_t i = 0; i < list->size(); i++) {
|
for (size_t i = 0; i < list->size(); i++) {
|
||||||
std::unique_ptr<base::Value> converted =
|
std::unique_ptr<base::Value> converted =
|
||||||
toBaseValue(list->at(i), depth - 1);
|
toBaseValue(list->at(i), depth - 1);
|
||||||
if (converted)
|
if (converted)
|
||||||
result->Append(std::move(converted));
|
result->Append(std::move(*converted));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (value->type() == Value::TypeObject) {
|
if (value->type() == Value::TypeObject) {
|
||||||
DictionaryValue* dict = DictionaryValue::cast(value);
|
DictionaryValue* dict = DictionaryValue::cast(value);
|
||||||
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
|
std::unique_ptr<base::Value> result(new base::Value(
|
||||||
|
base::Value::Type::DICTIONARY));
|
||||||
for (size_t i = 0; i < dict->size(); i++) {
|
for (size_t i = 0; i < dict->size(); i++) {
|
||||||
DictionaryValue::Entry entry = dict->at(i);
|
DictionaryValue::Entry entry = dict->at(i);
|
||||||
std::unique_ptr<base::Value> converted =
|
std::unique_ptr<base::Value> converted =
|
||||||
toBaseValue(entry.second, depth - 1);
|
toBaseValue(entry.second, depth - 1);
|
||||||
if (converted)
|
if (converted)
|
||||||
result->SetWithoutPathExpansion(entry.first, std::move(converted));
|
result->SetKey(entry.first, std::move(*converted));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user