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

Unified Diff: Source/WebCore/bindings/dart/custom/DartHTMLCanvasElementCustom.cpp

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/custom/DartHTMLCanvasElementCustom.cpp
diff --git a/Source/WebCore/bindings/dart/custom/DartHTMLCanvasElementCustom.cpp b/Source/WebCore/bindings/dart/custom/DartHTMLCanvasElementCustom.cpp
index c5df422def13801374af1ab39b6bfcbc6b91a9b2..5b2c91c46e368a5a2ff7e0c00bbf0c2ea7eb4b15 100644
--- a/Source/WebCore/bindings/dart/custom/DartHTMLCanvasElementCustom.cpp
+++ b/Source/WebCore/bindings/dart/custom/DartHTMLCanvasElementCustom.cpp
@@ -56,11 +56,9 @@ void toDataURLCallback(Dart_NativeArguments args)
{
HTMLCanvasElement* receiver = DartDOMWrapper::receiver<HTMLCanvasElement>(args);
- const ParameterAdapter<String> type(Dart_GetNativeArgument(args, 1));
- if (!type.conversionSuccessful()) {
- exception = type.exception();
+ DartStringAdapter type = DartUtilities::dartToString(Dart_GetNativeArgument(args, 1), exception);
+ if (exception)
goto fail;
- }
ExceptionCode ec = 0;
String result = receiver->toDataURL(type, 0, ec);
@@ -85,11 +83,9 @@ void getContextCallback(Dart_NativeArguments args)
{
HTMLCanvasElement* receiver = DartDOMWrapper::receiver<HTMLCanvasElement>(args);
- const ParameterAdapter<String> contextId(Dart_GetNativeArgument(args, 1));
- if (!contextId.conversionSuccessful()) {
- exception = contextId.exception();
+ DartStringAdapter contextId = DartUtilities::dartToString(Dart_GetNativeArgument(args, 1), exception);
+ if (exception)
goto fail;
- }
RefPtr<CanvasContextAttributes> attrs;
#if ENABLE(WEBGL)

Powered by Google App Engine
This is Rietveld 408576698