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

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

Issue 139803012: Move speech module over to Oilpan. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More namespace tweaks for clang Created 6 years, 10 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 | « no previous file | Source/bindings/v8/Dictionary.cpp » ('j') | Source/heap/Handle.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/Dictionary.h
diff --git a/Source/bindings/v8/Dictionary.h b/Source/bindings/v8/Dictionary.h
index fff0cfa28c754e2d4ab63f0c45090259d36c9a64..20829cfab0ce8ef6bccdf577c6ff4a294918faa3 100644
--- a/Source/bindings/v8/Dictionary.h
+++ b/Source/bindings/v8/Dictionary.h
@@ -88,8 +88,8 @@ public:
bool get(const String&, RefPtr<MediaKeyError>&) const;
bool get(const String&, RefPtr<TrackBase>&) const;
bool get(const String&, RefPtr<SpeechRecognitionError>&) const;
- bool get(const String&, RefPtr<SpeechRecognitionResult>&) const;
- bool get(const String&, RefPtr<SpeechRecognitionResultList>&) const;
+ bool get(const String&, RefPtrWillBeRawPtr<SpeechRecognitionResult>&) const;
+ bool get(const String&, RefPtrWillBeRawPtr<SpeechRecognitionResultList>&) const;
bool get(const String&, RefPtr<MediaStream>&) const;
bool get(const String&, RefPtr<EventTarget>&) const;
bool get(const String&, HashSet<AtomicString>&) const;
@@ -161,6 +161,8 @@ public:
bool convert(ConversionContext &, const String&, ArrayValue&) const;
template<typename T>
bool convert(ConversionContext &, const String&, RefPtr<T>&) const;
+ template<typename T>
+ bool convert(ConversionContext &, const String&, RawPtr<T>&) const;
haraken 2014/02/12 05:18:45 Nit: Unnecessary space before '&'.
sof 2014/02/12 07:48:51 Well spotted, fixed.
template<typename StringType>
bool getStringType(const String&, StringType&) const;
@@ -321,6 +323,25 @@ template<typename T> bool Dictionary::convert(ConversionContext& context, const
return false;
}
+template<typename T> bool Dictionary::convert(ConversionContext& context, const String& key, RawPtr<T>& value) const
haraken 2014/02/12 05:18:45 Nit: It's a shame that we have to duplicate the co
sof 2014/02/12 07:48:51 Seems ripe for that; we can handle that separately
+{
+ ConversionContextScope scope(context);
+
+ if (!get(key, value))
+ return true;
+
+ if (value)
+ return true;
+
+ v8::Local<v8::Value> v8Value;
+ getKey(key, v8Value);
+ if (context.isNullable() && WebCore::isUndefinedOrNull(v8Value))
+ return true;
+
+ context.throwTypeError(ExceptionMessages::incorrectPropertyType(key, "does not have a " + context.typeName() + " type."));
+ return false;
+}
+
}
#endif // Dictionary_h
« no previous file with comments | « no previous file | Source/bindings/v8/Dictionary.cpp » ('j') | Source/heap/Handle.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698