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

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

Issue 534133002: [WIP] bindings: Introduce PropertyBag (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/templates/dictionary_v8.h ('k') | Source/bindings/templates/interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/dictionary_v8.cpp
diff --git a/Source/bindings/templates/dictionary_v8.cpp b/Source/bindings/templates/dictionary_v8.cpp
index 2b3c32e728c403ff49c79d3063e910323e1fe822..8931159d0c0d8f4eb365b1e9b95e3c7ea9e1dca8 100644
--- a/Source/bindings/templates/dictionary_v8.cpp
+++ b/Source/bindings/templates/dictionary_v8.cpp
@@ -13,15 +13,16 @@
namespace blink {
-{{cpp_class}}* {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value)
+{{cpp_class}}* {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Handle<v8::Value> v8Value, ExceptionState& exceptionState)
{
{{cpp_class}}* impl = {{cpp_class}}::create();
- // FIXME: Do not use Dictionary and DictionaryHelper
- // https://crbug.com/321462
- Dictionary dictionary(v8Value, isolate);
+ if (v8Value.IsEmpty() || !v8Value->IsObject())
+ return impl;
+ v8::Local<v8::Object> v8Object = v8Value->ToObject();
+ PropertyBag bag(isolate, v8Object, exceptionState);
{% for member in members %}
{{member.cpp_type}} {{member.name}};
- if (DictionaryHelper::get(dictionary, "{{member.name}}", {{member.name}}))
+ if (bag.get("{{member.name}}", {{member.name}}))
impl->{{member.setter_name}}({{member.name}});
{% endfor %}
return impl;
« no previous file with comments | « Source/bindings/templates/dictionary_v8.h ('k') | Source/bindings/templates/interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698