chore: remove native_mate (Part 3) (#20131)
* use gin converter in atom_api_menu * please only put necessary includes in header Having include in header means they have dependency relationship, putting arbitrary includes really really really really really makes refacoring much harder. * remove some simple uses of callback_converter_deprecated.h * use gin callback converter in file_dialog code * use gin in ErrorThrower * use gin in atom_bundle_mover * fix mistake in node stream * deprecate native_mate version of event_emitter_caller * use gin in node_bindings * remove usages of native_mate event_emitter_caller.h except for EventEmitter * fix compilation on Windows * gin::Arguments behaves differently on GetNext * just use StringToV8
This commit is contained in:
parent
7be1905023
commit
2c23e44ed9
61 changed files with 515 additions and 323 deletions
|
@ -6,11 +6,30 @@
|
|||
#define SHELL_COMMON_GIN_CONVERTERS_STD_CONVERTER_H_
|
||||
|
||||
#include <set>
|
||||
#include <utility>
|
||||
|
||||
#include "gin/converter.h"
|
||||
|
||||
namespace gin {
|
||||
|
||||
// Make it possible to convert move-only types.
|
||||
template <typename T>
|
||||
v8::Local<v8::Value> ConvertToV8(v8::Isolate* isolate, T&& input) {
|
||||
return Converter<typename std::remove_reference<T>::type>::ToV8(
|
||||
isolate, std::move(input));
|
||||
}
|
||||
|
||||
#if !defined(OS_LINUX) && !defined(OS_FREEBSD)
|
||||
template <>
|
||||
struct Converter<unsigned long> { // NOLINT(runtime/int)
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
unsigned long val); // NOLINT(runtime/int)
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
unsigned long* out); // NOLINT(runtime/int)
|
||||
};
|
||||
#endif
|
||||
|
||||
template <>
|
||||
struct Converter<v8::Local<v8::Array>> {
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue