Chromium Code Reviews| 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..121961da1e6c8aba05573048098630fc8d7419e5 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 filename = DartUtilities::dartToStringWithNullCheck(valueHandle, exception); |
| + if (exception) |
| + goto fail; |
| - DartStringAdapter filename = DartUtilities::dartToStringWithNullCheck(Dart_GetNativeArgument(args, 3), exception); |
| - if (exception) |
| - goto fail; |
| + receiver->append(name, filename); |
|
blois
2013/07/08 23:09:30
Isn't it:
append(String name, String value)
append
|
| - 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); |
|
Emily Fortuna
2013/07/08 22:48:20
these files don't seem to follow the 80 char conve
blois
2013/07/08 23:09:30
Blink does not abide by the 80 char rule.
|
| + 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; |
| } |