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

Unified Diff: Source/WebCore/bindings/dart/custom/DartCanvasRenderingContext2DCustom.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/DartCanvasRenderingContext2DCustom.cpp
diff --git a/Source/WebCore/bindings/dart/custom/DartCanvasRenderingContext2DCustom.cpp b/Source/WebCore/bindings/dart/custom/DartCanvasRenderingContext2DCustom.cpp
index 6f1566289202a1c19fa9fad2e6c437af1083a1ad..85c9cea399d061a7cb83f382cc88d23b32b7b99f 100644
--- a/Source/WebCore/bindings/dart/custom/DartCanvasRenderingContext2DCustom.cpp
+++ b/Source/WebCore/bindings/dart/custom/DartCanvasRenderingContext2DCustom.cpp
@@ -97,11 +97,9 @@ void strokeStyleSetter(Dart_NativeArguments args)
Dart_Handle arg = Dart_GetNativeArgument(args, 1);
if (Dart_IsString(arg)) {
- const ParameterAdapter<String> color(Dart_GetNativeArgument(args, 1));
- if (!color.conversionSuccessful()) {
- exception = color.exception();
+ DartStringAdapter color = DartUtilities::dartToString(Dart_GetNativeArgument(args, 1), exception);
+ if (exception)
goto fail;
- }
receiver->setStrokeColor(color);
return;
@@ -138,11 +136,9 @@ void fillStyleSetter(Dart_NativeArguments args)
Dart_Handle arg = Dart_GetNativeArgument(args, 1);
if (Dart_IsString(arg)) {
- const ParameterAdapter<String> color(arg);
- if (!color.conversionSuccessful()) {
- exception = color.exception();
+ DartStringAdapter color = DartUtilities::dartToString(arg, exception);
+ if (exception)
goto fail;
- }
receiver->setFillColor(color);
return;
« no previous file with comments | « Source/WebCore/bindings/dart/DartUtilities.cpp ('k') | Source/WebCore/bindings/dart/custom/DartDOMStringListCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698