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

Unified Diff: Source/bindings/templates/dictionary_v8.cpp

Issue 724733002: Support for [Clamp] and [EnforceRange] to IDL dictionary. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
Index: Source/bindings/templates/dictionary_v8.cpp
diff --git a/Source/bindings/templates/dictionary_v8.cpp b/Source/bindings/templates/dictionary_v8.cpp
index 769f5ef44d67fb4e911f36455adc62950eb1bf29..e81780a200d000d68cb065c697b81ef66792b095 100644
--- a/Source/bindings/templates/dictionary_v8.cpp
+++ b/Source/bindings/templates/dictionary_v8.cpp
@@ -28,15 +28,13 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value, {
return;
{% endif %}
- // FIXME: Do not use Dictionary and DictionaryHelper
- // https://crbug.com/321462
- Dictionary dictionary(v8Value, isolate);
- // FIXME: Remove this v8::TryCatch once the code is switched from
- // Dictionary/DictionaryHelper to something that uses ExceptionState.
+
+ v8::Local<v8::Object> v8Object = v8Value->ToObject(isolate);
v8::TryCatch block;
{% for member in members %}
- {{member.cpp_type}} {{member.name}};
- if (DictionaryHelper::getWithUndefinedOrNullCheck(dictionary, "{{member.name}}", {{member.name}})) {
+ v8::Local<v8::Value> {{member.name}}Value = v8Object->Get(v8String(isolate, "{{member.name}}"));
+ if (!{{member.name}}Value.IsEmpty() && !isUndefinedOrNull({{member.name}}Value)) {
+ {{member.v8_value_to_local_cpp_value}};
{% if member.enum_validation_expression %}
String string = {{member.name}};
if (!({{member.enum_validation_expression}})) {
@@ -52,7 +50,6 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value, {
impl.{{member.setter_name}}({{member.name}});
} else if (block.HasCaught()) {
exceptionState.rethrowV8Exception(block.Exception());
- return;
zino 2014/11/19 18:12:19 This is my mistake.. :-(
bashi 2014/11/20 02:18:02 I'm not sure why you removed this return. Early ex
zino 2014/11/20 02:40:43 Yep, you're right! It's just my mistake :-P
}
{% endfor %}

Powered by Google App Engine
This is Rietveld 408576698