chore: modernize Value usage in converters (#34794)

* chore: modernize Value usage in converters

* Date is parsed as an empty object now
This commit is contained in:
Jeremy Rose 2022-07-05 08:25:18 -07:00 committed by GitHub
parent d28ed0da20
commit 0ee7f14190
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 203 additions and 829 deletions

View file

@ -5,23 +5,18 @@
#ifndef ELECTRON_SHELL_COMMON_GIN_CONVERTERS_VALUE_CONVERTER_H_
#define ELECTRON_SHELL_COMMON_GIN_CONVERTERS_VALUE_CONVERTER_H_
#include "base/values.h"
#include "gin/converter.h"
namespace base {
class DictionaryValue;
class ListValue;
class Value;
} // namespace base
namespace gin {
template <>
struct Converter<base::DictionaryValue> {
struct Converter<base::Value::Dict> {
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
base::DictionaryValue* out);
base::Value::Dict* out);
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const base::DictionaryValue& val);
const base::Value::Dict& val);
};
template <>
@ -34,12 +29,12 @@ struct Converter<base::Value> {
};
template <>
struct Converter<base::ListValue> {
struct Converter<base::Value::List> {
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
base::ListValue* out);
base::Value::List* out);
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const base::ListValue& val);
const base::Value::List& val);
};
} // namespace gin