Index: third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
index 88c099f63f39b47f318a4bdd583965cf3b558540..8c0f3a4a43bde8fa72666c4603232cea15b4401d 100644 |
--- a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
+++ b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl |
@@ -534,9 +534,15 @@ static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop |
return; |
} |
- v8::Local<v8::Value> hiddenValue = V8HiddenValue::getHiddenValue(ScriptState::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), v8AtomicString(info.GetIsolate(), "{{method.name}}")); |
- if (!hiddenValue.IsEmpty()) { |
- v8SetReturnValue(info, hiddenValue); |
+ {% raw %} |
+ // {{method.name}} must be same with |methodName| (=name) in |
+ // {{cpp_class}}OriginSafeMethodSetter defined in interface.cpp.tmpl. |
+ {% endraw %} |
+ v8::Local<v8::Value> propertyValue = |
+ V8PrivateProperty::getSymbol(info.GetIsolate(), "{{method.name}}") |
+ .getOrEmpty(v8::Local<v8::Object>::Cast(info.Holder())); |
+ if (!propertyValue.IsEmpty()) { |
Yuki
2017/04/03 07:20:39
nit: You may want to use hasValue and getOrUndefin
peria
2017/04/03 07:44:06
Done.
|
+ v8SetReturnValue(info, propertyValue); |
} |
} |
{% endmacro %} |