| OLD | NEW |
| 1 // Copyright 2011, Google Inc. | 1 // Copyright 2011, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 { | 127 { |
| 128 Dart_Handle exception = 0; | 128 Dart_Handle exception = 0; |
| 129 { | 129 { |
| 130 XMLHttpRequest* receiver = DartDOMWrapper::receiver<XMLHttpRequest>(args
); | 130 XMLHttpRequest* receiver = DartDOMWrapper::receiver<XMLHttpRequest>(args
); |
| 131 | 131 |
| 132 DartExceptionState es; | 132 DartExceptionState es; |
| 133 DartDOMData* domData = static_cast<DartDOMData*>(Dart_GetNativeIsolateDa
ta(args)); | 133 DartDOMData* domData = static_cast<DartDOMData*>(Dart_GetNativeIsolateDa
ta(args)); |
| 134 Dart_Handle arg1 = Dart_GetNativeArgument(args, 1); | 134 Dart_Handle arg1 = Dart_GetNativeArgument(args, 1); |
| 135 if (Dart_IsNull(arg1)) { | 135 if (Dart_IsNull(arg1)) { |
| 136 receiver->send(es); | 136 receiver->send(es); |
| 137 } else if (DartDOMWrapper::instanceOf<DartDocument>(domData, arg1)) { | 137 } else if (DartDOMWrapper::subtypeOf<DartDocument>(domData, arg1)) { |
| 138 Document* asDocument = DartDocument::toNative(arg1, exception); | 138 Document* asDocument = DartDocument::toNative(arg1, exception); |
| 139 if (exception) | 139 if (exception) |
| 140 goto fail; | 140 goto fail; |
| 141 receiver->send(asDocument, es); | 141 receiver->send(asDocument, es); |
| 142 } else if (DartDOMWrapper::instanceOf<DartBlob>(domData, arg1)) { | 142 } else if (DartDOMWrapper::subtypeOf<DartBlob>(domData, arg1)) { |
| 143 Blob* asBlob = DartBlob::toNative(arg1, exception); | 143 Blob* asBlob = DartBlob::toNative(arg1, exception); |
| 144 if (exception) | 144 if (exception) |
| 145 goto fail; | 145 goto fail; |
| 146 receiver->send(asBlob, es); | 146 receiver->send(asBlob, es); |
| 147 } else if (DartDOMWrapper::instanceOf<DartFormData>(domData, arg1)) { | 147 } else if (DartDOMWrapper::subtypeOf<DartFormData>(domData, arg1)) { |
| 148 DOMFormData* asDOMFormData = DartFormData::toNative(arg1, exception)
; | 148 DOMFormData* asDOMFormData = DartFormData::toNative(arg1, exception)
; |
| 149 if (exception) | 149 if (exception) |
| 150 goto fail; | 150 goto fail; |
| 151 receiver->send(asDOMFormData, es); | 151 receiver->send(asDOMFormData, es); |
| 152 } else if (DartUtilities::isTypedData(arg1)) { | 152 } else if (DartUtilities::isTypedData(arg1)) { |
| 153 RefPtr<ArrayBuffer> asArrayBuffer = DartUtilities::dartToArrayBuffer
(arg1, exception); | 153 RefPtr<ArrayBuffer> asArrayBuffer = DartUtilities::dartToArrayBuffer
(arg1, exception); |
| 154 if (exception) | 154 if (exception) |
| 155 goto fail; | 155 goto fail; |
| 156 receiver->send(asArrayBuffer.get(), es); | 156 receiver->send(asArrayBuffer.get(), es); |
| 157 } else { | 157 } else { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 } | 264 } |
| 265 | 265 |
| 266 fail: | 266 fail: |
| 267 Dart_ThrowException(exception); | 267 Dart_ThrowException(exception); |
| 268 ASSERT_NOT_REACHED(); | 268 ASSERT_NOT_REACHED(); |
| 269 } | 269 } |
| 270 | 270 |
| 271 } // DartXMLHttpRequestInternal | 271 } // DartXMLHttpRequestInternal |
| 272 | 272 |
| 273 } // WebCore | 273 } // WebCore |
| OLD | NEW |