| Index: Source/bindings/dart/custom/DartFormDataCustom.cpp
|
| diff --git a/Source/bindings/dart/custom/DartFormDataCustom.cpp b/Source/bindings/dart/custom/DartFormDataCustom.cpp
|
| index 229b169ea89399cc54805ad8debc6c0aa97dc653..3c37fcc7edcaa34bcf605321a86e5aade7febcbe 100644
|
| --- a/Source/bindings/dart/custom/DartFormDataCustom.cpp
|
| +++ b/Source/bindings/dart/custom/DartFormDataCustom.cpp
|
| @@ -70,23 +70,41 @@ void appendCallback(Dart_NativeArguments args)
|
| goto fail;
|
|
|
| Dart_Handle valueHandle = Dart_GetNativeArgument(args, 2);
|
| - if (DartDOMWrapper::instanceOf<DartBlob>(valueHandle)) {
|
| - Blob* blob = DartBlob::toNative(valueHandle, exception);
|
| - if (exception)
|
| - goto fail;
|
| + DartStringAdapter value = DartUtilities::dartToStringWithNullCheck(valueHandle, exception);
|
| + if (exception)
|
| + goto fail;
|
|
|
| - DartStringAdapter filename = DartUtilities::dartToStringWithNullCheck(Dart_GetNativeArgument(args, 3), exception);
|
| - if (exception)
|
| - goto fail;
|
| + receiver->append(name, value);
|
|
|
| - receiver->append(name, blob, filename);
|
| - } else {
|
| - DartStringAdapter filename = DartUtilities::dartToStringWithNullCheck(valueHandle, exception);
|
| - if (exception)
|
| - goto fail;
|
| + return;
|
| + }
|
|
|
| - receiver->append(name, filename);
|
| - }
|
| +fail:
|
| + Dart_ThrowException(exception);
|
| + ASSERT_NOT_REACHED();
|
| +}
|
| +
|
| +void appendBlobCallback(Dart_NativeArguments args)
|
| +{
|
| + DartApiScope dartApiScope;
|
| + Dart_Handle exception = 0;
|
| + {
|
| + DOMFormData* receiver = DartDOMWrapper::receiver<DOMFormData>(args);
|
| +
|
| + DartStringAdapter name = DartUtilities::dartToStringWithNullCheck(Dart_GetNativeArgument(args, 1), exception);
|
| + if (exception)
|
| + goto fail;
|
| +
|
| + Dart_Handle valueHandle = Dart_GetNativeArgument(args, 2);
|
| + Blob* blob = DartBlob::toNative(valueHandle, exception);
|
| + if (exception)
|
| + goto fail;
|
| +
|
| + DartStringAdapter filename = DartUtilities::dartToStringWithNullCheck(Dart_GetNativeArgument(args, 3), exception);
|
| + if (exception)
|
| + goto fail;
|
| +
|
| + receiver->append(name, blob, filename);
|
|
|
| return;
|
| }
|
|
|