chore: remove native_mate (Part 9) (#20645)
* refactor: remove a few uses of native_mate/gfx_converter.h * refactor: deprecate mate::EventEmitter * refactor: add gin_helper::EventEmitter * refactor: convert a few classes to use gin_helper::EventEmitter * refactor: get rid of native_mate_converters/gfx_converter.h * fix: follow native_mate on reporting errors * fix: gin is weak at guessing parameter types * fix: incorrect full class name * fix: gin::Handle does not accept null
This commit is contained in:
parent
b155ebeeb3
commit
eb0e55c514
38 changed files with 532 additions and 326 deletions
|
@ -1,78 +0,0 @@
|
|||
// Copyright (c) 2014 GitHub, Inc.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef SHELL_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_
|
||||
#define SHELL_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_
|
||||
|
||||
#include "native_mate/converter.h"
|
||||
#include "shell/common/gin_converters/gfx_converter.h"
|
||||
|
||||
namespace mate {
|
||||
|
||||
template <>
|
||||
struct Converter<gfx::Point> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const gfx::Point& val) {
|
||||
return gin::ConvertToV8(isolate, val);
|
||||
}
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
gfx::Point* out) {
|
||||
return gin::ConvertFromV8(isolate, val, out);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<gfx::PointF> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const gfx::PointF& val) {
|
||||
return gin::ConvertToV8(isolate, val);
|
||||
}
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
gfx::PointF* out) {
|
||||
return gin::ConvertFromV8(isolate, val, out);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<gfx::Size> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const gfx::Size& val) {
|
||||
return gin::ConvertToV8(isolate, val);
|
||||
}
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
gfx::Size* out) {
|
||||
return gin::ConvertFromV8(isolate, val, out);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<gfx::Rect> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, const gfx::Rect& val) {
|
||||
return gin::ConvertToV8(isolate, val);
|
||||
}
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
gfx::Rect* out) {
|
||||
return gin::ConvertFromV8(isolate, val, out);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<display::Display> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const display::Display& val) {
|
||||
return gin::ConvertToV8(isolate, val);
|
||||
}
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
display::Display* out) {
|
||||
return gin::ConvertFromV8(isolate, val, out);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace mate
|
||||
|
||||
#endif // SHELL_COMMON_NATIVE_MATE_CONVERTERS_GFX_CONVERTER_H_
|
Loading…
Add table
Add a link
Reference in a new issue