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

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

Issue 122783002: Add Dictionary get() method for AtomicString values and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 12 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
Index: Source/bindings/v8/Dictionary.cpp
diff --git a/Source/bindings/v8/Dictionary.cpp b/Source/bindings/v8/Dictionary.cpp
index ffb54ecbd7a78cce41a026913cc4da4c37f914db..0571b548122428b5de038e658830635355838b18 100644
--- a/Source/bindings/v8/Dictionary.cpp
+++ b/Source/bindings/v8/Dictionary.cpp
@@ -199,7 +199,8 @@ bool Dictionary::convert(ConversionContext& context, const String& key, double&
return true;
}
-bool Dictionary::get(const String& key, String& value) const
+template<typename StringType>
+inline bool Dictionary::getStringType(const String& key, StringType& value) const
{
v8::Local<v8::Value> v8Value;
if (!getKey(key, v8Value))
@@ -210,6 +211,16 @@ bool Dictionary::get(const String& key, String& value) const
return true;
}
+bool Dictionary::get(const String& key, String& value) const
+{
+ return getStringType(key, value);
+}
+
+bool Dictionary::get(const String& key, AtomicString& value) const
+{
+ return getStringType(key, value);
+}
+
bool Dictionary::convert(ConversionContext& context, const String& key, String& value) const
{
ConversionContextScope scope(context);
« Source/bindings/v8/CustomElementConstructorBuilder.cpp ('K') | « Source/bindings/v8/Dictionary.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698