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

Unified Diff: Source/WebCore/bindings/dart/DartDOMWrapper.h

Issue 10660025: Cleanup dart to string conversions. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: . Created 8 years, 6 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/WebCore/bindings/dart/DartDOMWrapper.h
diff --git a/Source/WebCore/bindings/dart/DartDOMWrapper.h b/Source/WebCore/bindings/dart/DartDOMWrapper.h
index 8cea9a2d68030b1d827a43fc7a25bcd5d17e1caa..999da8139145cd75d161e3c4c3977bcef3a7420e 100644
--- a/Source/WebCore/bindings/dart/DartDOMWrapper.h
+++ b/Source/WebCore/bindings/dart/DartDOMWrapper.h
@@ -247,90 +247,6 @@ private:
}
};
-// ParameterAdapter.
-
-template <typename Value>
-class ParameterAdapterBase {
-public:
- bool conversionSuccessful() const { return !m_exception; }
-
- Dart_Handle exception() const
- {
- ASSERT(!conversionSuccessful());
- return m_exception;
- }
-
-protected:
-
- ParameterAdapterBase()
- : m_value()
- , m_exception(0) { }
-
- void setException(Dart_Handle exception)
- {
- ASSERT(exception);
- m_exception = exception;
- ASSERT(!conversionSuccessful());
- }
-
- const Value& value() const
- {
- ASSERT(conversionSuccessful());
- return m_value;
- }
-
- void setValue(Value value)
- {
- m_value = value;
- }
-
-protected:
- Value m_value;
-
- template <class C>
- void init(C* c, Dart_Handle handle)
- {
- Dart_Handle exception = 0;
- this->setValue(c->convert(handle, exception));
- if (exception)
- this->setException(exception);
- }
-
- template <class C>
- void init(C* c, Dart_Handle handle, DartUtilities::ConversionFlag conversionFlag)
- {
- if (conversionFlag == DartUtilities::ConvertNullToDefaultValue) {
- if (Dart_IsNull(handle))
- return;
- }
- Dart_Handle exception = 0;
- this->setValue(c->convert(handle, exception));
- if (exception)
- this->setException(exception);
- }
-
-private:
- Dart_Handle m_exception;
-};
-
-template <class DartBindingsClass>
-class ParameterAdapter {};
-
-// FIXME: [performance] need better treatment of String vs. AtomicString, cf. v8 implementation.
-template <>
-class ParameterAdapter<String> : public ParameterAdapterBase< RefPtr<StringImpl> > {
-public:
- explicit ParameterAdapter(Dart_Handle handle, DartUtilities::ConversionFlag flag = DartUtilities::ConvertNone)
- {
- Dart_Handle exception = 0;
- setValue(DartUtilities::toStringImpl(handle, flag, exception));
- if (exception)
- setException(exception);
- }
- operator String() const { return String(this->value()); }
- operator AtomicString() const { return AtomicString(this->value()); }
-};
-
}
#endif // DartDOMWrapper_h
« no previous file with comments | « Source/WebCore/bindings/dart/DartApplicationLoader.cpp ('k') | Source/WebCore/bindings/dart/DartDebugServer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698