| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 enum class ValueType { | 101 enum class ValueType { |
| 102 Undefined, | 102 Undefined, |
| 103 Null, | 103 Null, |
| 104 Object | 104 Object |
| 105 } m_valueType = ValueType::Undefined; | 105 } m_valueType = ValueType::Undefined; |
| 106 v8::Local<v8::Object> m_dictionaryObject; // an Object or empty | 106 v8::Local<v8::Object> m_dictionaryObject; // an Object or empty |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 template <> | 109 template <> |
| 110 struct NativeValueTraits<Dictionary> { | 110 struct NativeValueTraits<Dictionary> { |
| 111 using ImplType = Dictionary; |
| 111 static Dictionary nativeValue(v8::Isolate* isolate, | 112 static Dictionary nativeValue(v8::Isolate* isolate, |
| 112 v8::Local<v8::Value> value, | 113 v8::Local<v8::Value> value, |
| 113 ExceptionState& exceptionState) { | 114 ExceptionState& exceptionState) { |
| 114 return Dictionary(isolate, value, exceptionState); | 115 return Dictionary(isolate, value, exceptionState); |
| 115 } | 116 } |
| 116 }; | 117 }; |
| 117 | 118 |
| 118 // DictionaryHelper is a collection of static methods for getting or | 119 // DictionaryHelper is a collection of static methods for getting or |
| 119 // converting a value from Dictionary. | 120 // converting a value from Dictionary. |
| 120 struct DictionaryHelper { | 121 struct DictionaryHelper { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 144 static bool get(const Dictionary&, | 145 static bool get(const Dictionary&, |
| 145 const StringView& key, | 146 const StringView& key, |
| 146 PointerType<T>& value); | 147 PointerType<T>& value); |
| 147 template <typename T> | 148 template <typename T> |
| 148 static bool get(const Dictionary&, const StringView& key, Nullable<T>& value); | 149 static bool get(const Dictionary&, const StringView& key, Nullable<T>& value); |
| 149 }; | 150 }; |
| 150 | 151 |
| 151 } // namespace blink | 152 } // namespace blink |
| 152 | 153 |
| 153 #endif // Dictionary_h | 154 #endif // Dictionary_h |
| OLD | NEW |