diff --git a/native_mate/dictionary.h b/native_mate/dictionary.h index 0ff05c9bb88a..c15f8f902fdd 100644 --- a/native_mate/dictionary.h +++ b/native_mate/dictionary.h @@ -36,12 +36,25 @@ class Dictionary { return ConvertFromV8(isolate_, val, out); } + template + bool GetHidden(const base::StringPiece& key, T* out) const { + v8::Local val = GetHandle()->GetHiddenValue( + StringToV8(isolate_, key)); + return ConvertFromV8(isolate_, val, out); + } + template bool Set(const base::StringPiece& key, T val) { return GetHandle()->Set(StringToV8(isolate_, key), ConvertToV8(isolate_, val)); } + template + bool SetHidden(const base::StringPiece& key, T val) { + return GetHandle()->SetHiddenValue(StringToV8(isolate_, key), + ConvertToV8(isolate_, val)); + } + template bool SetMethod(const base::StringPiece& key, const T& callback) { return GetHandle()->Set(