refactor: remove path from nativeImage converter (#26546)
This commit is contained in:
parent
4db3e3a08a
commit
3455136e9d
13 changed files with 167 additions and 103 deletions
|
@ -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_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue