Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Unified Diff: Source/bindings/core/v8/DictionaryHelperForCore.cpp

Issue 555133003: Use ExceptionState to throw exceptions when converting arrays (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/v8/Dictionary.h ('k') | Source/bindings/core/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/DictionaryHelperForCore.cpp
diff --git a/Source/bindings/core/v8/DictionaryHelperForCore.cpp b/Source/bindings/core/v8/DictionaryHelperForCore.cpp
index bcff302797600602e53feb245e08729bb4d71915..dc7743d8e81094f951633477fa9692e2e6314fd0 100644
--- a/Source/bindings/core/v8/DictionaryHelperForCore.cpp
+++ b/Source/bindings/core/v8/DictionaryHelperForCore.cpp
@@ -265,22 +265,6 @@ bool DictionaryHelper::get(const Dictionary& dictionary, const String& key, RefP
}
template <>
-bool DictionaryHelper::get(const Dictionary& dictionary, const String& key, MessagePortArray& value)
-{
- v8::Local<v8::Value> v8Value;
- if (!dictionary.get(key, v8Value))
- return false;
-
- ASSERT(dictionary.isolate());
- ASSERT(dictionary.isolate() == v8::Isolate::GetCurrent());
- if (blink::isUndefinedOrNull(v8Value))
- return true;
- bool success = false;
- value = toRefPtrWillBeMemberNativeArray<MessagePort, V8MessagePort>(v8Value, key, dictionary.isolate(), &success);
- return success;
-}
-
-template <>
bool DictionaryHelper::get(const Dictionary& dictionary, const String& key, HashSet<AtomicString>& value)
{
v8::Local<v8::Value> v8Value;
@@ -663,7 +647,18 @@ bool DictionaryHelper::convert(const Dictionary& dictionary, Dictionary::Convers
if (!dictionary.get(key, v8Value))
return true;
- return DictionaryHelper::get(dictionary, key, value);
+ ASSERT(dictionary.isolate());
+ ASSERT(dictionary.isolate() == v8::Isolate::GetCurrent());
+
+ if (isUndefinedOrNull(v8Value))
+ return true;
+
+ value = toRefPtrWillBeMemberNativeArray<MessagePort, V8MessagePort>(v8Value, key, dictionary.isolate(), context.exceptionState());
+
+ if (context.exceptionState().throwIfNeeded())
+ return false;
+
+ return true;
}
} // namespace blink
« no previous file with comments | « Source/bindings/core/v8/Dictionary.h ('k') | Source/bindings/core/v8/SerializedScriptValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698