refactor: remove path from nativeImage converter (#26546)

This commit is contained in:
Shelley Vohr 2021-01-04 12:58:31 -08:00 committed by GitHub
parent 4db3e3a08a
commit 3455136e9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 167 additions and 103 deletions

View file

@ -77,6 +77,10 @@ class NativeImage : public gin::Wrappable<NativeImage> {
static v8::Local<v8::FunctionTemplate> GetConstructor(v8::Isolate* isolate);
static bool TryConvertNativeImage(v8::Isolate* isolate,
v8::Local<v8::Value> image,
NativeImage** native_image);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
@ -133,18 +137,4 @@ class NativeImage : public gin::Wrappable<NativeImage> {
} // namespace electron
namespace gin {
// A custom converter that allows converting path to NativeImage.
template <>
struct Converter<electron::api::NativeImage*> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
electron::api::NativeImage* val);
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
electron::api::NativeImage** out);
};
} // namespace gin
#endif // SHELL_COMMON_API_ELECTRON_API_NATIVE_IMAGE_H_