backport debugger fix (#14481)
* chore: enable debugger api specs (#14475) * backport base::Value converters
This commit is contained in:
parent
08270e6817
commit
664371245a
5 changed files with 80 additions and 27 deletions
|
@ -30,6 +30,25 @@ v8::Local<v8::Value> Converter<base::DictionaryValue>::ToV8(
|
|||
return converter.ToV8Value(&val, isolate->GetCurrentContext());
|
||||
}
|
||||
|
||||
bool Converter<base::Value>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::Value* out) {
|
||||
atom::V8ValueConverter converter;
|
||||
std::unique_ptr<base::Value> value(
|
||||
converter.FromV8Value(val, isolate->GetCurrentContext()));
|
||||
if (value) {
|
||||
*out = value->Clone();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
v8::Local<v8::Value> Converter<base::Value>::ToV8(v8::Isolate* isolate,
|
||||
const base::Value& val) {
|
||||
atom::V8ValueConverter converter;
|
||||
return converter.ToV8Value(&val, isolate->GetCurrentContext());
|
||||
}
|
||||
|
||||
bool Converter<base::ListValue>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::ListValue* out) {
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
namespace base {
|
||||
class DictionaryValue;
|
||||
class ListValue;
|
||||
class Value;
|
||||
} // namespace base
|
||||
|
||||
namespace mate {
|
||||
|
@ -23,6 +24,15 @@ struct Converter<base::DictionaryValue> {
|
|||
const base::DictionaryValue& val);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<base::Value> {
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::Value* out);
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const base::Value& val);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<base::ListValue> {
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue