Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / core / v8 / Dictionary.h
index 573932f..b9a0d5f 100644 (file)
@@ -134,16 +134,16 @@ public:
 
     v8::Isolate* isolate() const { return m_isolate; }
 
-private:
     bool getKey(const String& key, v8::Local<v8::Value>&) const;
 
+private:
     v8::Handle<v8::Value> m_options;
     v8::Isolate* m_isolate;
 };
 
 template<>
 struct NativeValueTraits<Dictionary> {
-    static inline Dictionary nativeValue(const v8::Handle<v8::Value>& value, v8::Isolate* isolate)
+    static inline Dictionary nativeValue(const v8::Handle<v8::Value>& value, v8::Isolate* isolate, ExceptionState&)
     {
         return Dictionary(value, isolate);
     }
@@ -156,6 +156,14 @@ struct DictionaryHelper {
     static bool get(const Dictionary&, const String& key, T& value);
     template <typename T>
     static bool get(const Dictionary&, const String& key, T& value, bool& hasValue);
+    template <typename T>
+    static bool getWithUndefinedOrNullCheck(const Dictionary& dictionary, const String& key, T& value)
+    {
+        v8::Local<v8::Value> v8Value;
+        if (!dictionary.getKey(key, v8Value) || isUndefinedOrNull(v8Value))
+            return false;
+        return DictionaryHelper::get(dictionary, key, value);
+    }
     template <template <typename> class PointerType, typename T>
     static bool get(const Dictionary&, const String& key, PointerType<T>& value);
     template <typename T>