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

Unified Diff: Source/WebCore/bindings/dart/custom/DartMessageEventCustom.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/DartMessageEventCustom.cpp
diff --git a/Source/WebCore/bindings/dart/custom/DartMessageEventCustom.cpp b/Source/WebCore/bindings/dart/custom/DartMessageEventCustom.cpp
index 5ae242e730bf4379667d8ca2b59759b5283709d1..2edbc638c8165925513cb956664e578005b4d53c 100644
--- a/Source/WebCore/bindings/dart/custom/DartMessageEventCustom.cpp
+++ b/Source/WebCore/bindings/dart/custom/DartMessageEventCustom.cpp
@@ -109,11 +109,9 @@ void initMessageEventCallback(Dart_NativeArguments args)
{
MessageEvent* receiver = DartDOMWrapper::receiver<MessageEvent>(args);
- const ParameterAdapter<String> typeArg(Dart_GetNativeArgument(args, 1));
- if (!typeArg.conversionSuccessful()) {
- exception = typeArg.exception();
+ DartStringAdapter typeArg = DartUtilities::dartToString(Dart_GetNativeArgument(args, 1), exception);
+ if (exception)
goto fail;
- }
bool canBubbleArg = DartUtilities::dartToBool(Dart_GetNativeArgument(args, 2), exception);
if (exception)
@@ -127,17 +125,13 @@ void initMessageEventCallback(Dart_NativeArguments args)
if (exception)
goto fail;
- const ParameterAdapter<String> originArg(Dart_GetNativeArgument(args, 5));
- if (!originArg.conversionSuccessful()) {
- exception = originArg.exception();
+ DartStringAdapter originArg = DartUtilities::dartToString(Dart_GetNativeArgument(args, 5), exception);
+ if (exception)
goto fail;
- }
- const ParameterAdapter<String> lastEventIdArg(Dart_GetNativeArgument(args, 6));
- if (!lastEventIdArg.conversionSuccessful()) {
- exception = lastEventIdArg.exception();
+ DartStringAdapter lastEventIdArg = DartUtilities::dartToString(Dart_GetNativeArgument(args, 6), exception);
+ if (exception)
goto fail;
- }
DOMWindow* sourceArg = DartDOMWindow::toNative(Dart_GetNativeArgument(args, 7), exception);
if (exception)

Powered by Google App Engine
This is Rietveld 408576698