diff --git a/atom/common/native_mate_converters/blink_converter.cc b/atom/common/native_mate_converters/blink_converter.cc index a262e9b1ba..b2fb1113bb 100644 --- a/atom/common/native_mate_converters/blink_converter.cc +++ b/atom/common/native_mate_converters/blink_converter.cc @@ -305,13 +305,21 @@ bool Converter::FromV8( return dict.Get("x", &out->x) && dict.Get("y", &out->y); } -bool Converter::FromV8( - v8::Isolate* isolate, v8::Local val, blink::WebPoint* out) { - mate::Dictionary dict; - if (!ConvertFromV8(isolate, val, &dict)) - return false; - return dict.Get("x", &out->x) && dict.Get("y", &out->y); -} +template<> +struct Converter> { + static bool FromV8( + v8::Isolate* isolate, v8::Local val, + base::Optional* out) { + mate::Dictionary dict; + if (!ConvertFromV8(isolate, val, &dict)) + return false; + blink::WebPoint point; + bool success = dict.Get("x", &point.x) && dict.Get("y", &point.y); + if (!success) return false; + out->emplace(point); + return true; + } +}; bool Converter::FromV8( v8::Isolate* isolate, v8::Local val, blink::WebSize* out) {