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

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

Issue 661453004: Add getPropertyNames to v8 Dictionaries and make use of in Keyframes processing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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/core/animation/EffectInput.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/Dictionary.cpp
diff --git a/Source/bindings/core/v8/Dictionary.cpp b/Source/bindings/core/v8/Dictionary.cpp
index 95e90911ddcdb7f0c8208f82b6f821f5aaf79a9e..ae523a4a0de41c747a6d442d6ce9af17441084f0 100644
--- a/Source/bindings/core/v8/Dictionary.cpp
+++ b/Source/bindings/core/v8/Dictionary.cpp
@@ -264,6 +264,29 @@ bool Dictionary::getOwnPropertyNames(Vector<String>& names) const
return true;
}
+bool Dictionary::getPropertyNames(Vector<String>& names) const
+{
+ if (!isObject())
+ return false;
+
+ v8::Handle<v8::Object> options = m_options->ToObject();
+ if (options.IsEmpty())
+ return false;
+
+ v8::Local<v8::Array> properties = options->GetPropertyNames();
+ if (properties.IsEmpty())
+ return true;
+ for (uint32_t i = 0; i < properties->Length(); ++i) {
+ v8::Local<v8::String> key = properties->Get(i)->ToString();
+ if (!options->Has(key))
+ continue;
+ TOSTRING_DEFAULT(V8StringResource<>, stringKey, key, false);
+ names.append(stringKey);
+ }
+
+ return true;
+}
+
void Dictionary::ConversionContext::resetPerPropertyContext()
{
if (m_dirty) {
« no previous file with comments | « Source/bindings/core/v8/Dictionary.h ('k') | Source/core/animation/EffectInput.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698