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

Unified Diff: Source/WebCore/bindings/dart/custom/DartXMLHttpRequestCustom.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
« no previous file with comments | « Source/WebCore/bindings/dart/custom/DartWebSocketCustom.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/dart/custom/DartXMLHttpRequestCustom.cpp
diff --git a/Source/WebCore/bindings/dart/custom/DartXMLHttpRequestCustom.cpp b/Source/WebCore/bindings/dart/custom/DartXMLHttpRequestCustom.cpp
index b6313bdd2aeb377101151049317dd2cf4ace9662..deb80213afc08c7c0a34984fdeaf91a2561cac73 100644
--- a/Source/WebCore/bindings/dart/custom/DartXMLHttpRequestCustom.cpp
+++ b/Source/WebCore/bindings/dart/custom/DartXMLHttpRequestCustom.cpp
@@ -72,16 +72,12 @@ void openCallback(Dart_NativeArguments args)
Dart_Handle exception = 0;
{
XMLHttpRequest* receiver = DartDOMWrapper::receiver<XMLHttpRequest>(args);
- const ParameterAdapter<String> method(Dart_GetNativeArgument(args, 1));
- if (!method.conversionSuccessful()) {
- exception = method.exception();
+ DartStringAdapter method = DartUtilities::dartToString(Dart_GetNativeArgument(args, 1), exception);
+ if (exception)
goto fail;
- }
- const ParameterAdapter<String> url(Dart_GetNativeArgument(args, 2));
- if (!url.conversionSuccessful()) {
- exception = url.exception();
+ DartStringAdapter url = DartUtilities::dartToString(Dart_GetNativeArgument(args, 2), exception);
+ if (exception)
goto fail;
- }
ScriptExecutionContext* context = DartUtilities::scriptExecutionContext();
if (!context)
@@ -97,19 +93,15 @@ void openCallback(Dart_NativeArguments args)
Dart_Handle arg4 = Dart_GetNativeArgument(args, 4);
if (!Dart_IsNull(arg4)) {
- const ParameterAdapter<String> user(arg4);
- if (!user.conversionSuccessful()) {
- exception = user.exception();
+ DartStringAdapter user = DartUtilities::dartToString(arg4, exception);
+ if (exception)
goto fail;
- }
Dart_Handle arg5 = Dart_GetNativeArgument(args, 5);
if (!Dart_IsNull(arg5)) {
- const ParameterAdapter<String> passwd(arg5);
- if (!passwd.conversionSuccessful()) {
- exception = passwd.exception();
+ DartStringAdapter passwd = DartUtilities::dartToString(arg5, exception);
+ if (exception)
goto fail;
- }
receiver->open(method, fullURL, async, user, passwd, ec);
} else
@@ -165,11 +157,9 @@ void sendCallback(Dart_NativeArguments args)
receiver->send(asArrayBuffer, ec);
#endif
} else {
- const ParameterAdapter<String> asString(arg1);
- if (!asString.conversionSuccessful()) {
- exception = asString.exception();
+ DartStringAdapter asString = DartUtilities::dartToString(arg1, exception);
+ if (exception)
goto fail;
- }
receiver->send(asString, ec);
}
« no previous file with comments | « Source/WebCore/bindings/dart/custom/DartWebSocketCustom.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698