OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010 Google Inc. 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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "V8XMLHttpRequest.h" | 32 #include "V8XMLHttpRequest.h" |
33 | 33 |
34 #include "V8ArrayBuffer.h" | 34 #include "V8ArrayBuffer.h" |
35 #include "V8ArrayBufferView.h" | 35 #include "V8ArrayBufferView.h" |
36 #include "V8Blob.h" | 36 #include "V8Blob.h" |
37 #include "V8DOMFormData.h" | |
38 #include "V8Document.h" | 37 #include "V8Document.h" |
| 38 #include "V8FormData.h" |
39 #include "V8HTMLDocument.h" | 39 #include "V8HTMLDocument.h" |
40 #include "bindings/v8/V8Binding.h" | 40 #include "bindings/v8/V8Binding.h" |
41 #include "bindings/v8/V8Utilities.h" | 41 #include "bindings/v8/V8Utilities.h" |
42 #include "bindings/v8/custom/V8ArrayBufferCustom.h" | 42 #include "bindings/v8/custom/V8ArrayBufferCustom.h" |
43 #include "core/dom/Document.h" | 43 #include "core/dom/Document.h" |
44 #include "core/inspector/InspectorInstrumentation.h" | 44 #include "core/inspector/InspectorInstrumentation.h" |
45 #include "core/page/Frame.h" | 45 #include "core/page/Frame.h" |
46 #include "core/workers/WorkerContext.h" | 46 #include "core/workers/WorkerContext.h" |
47 #include "core/xml/XMLHttpRequest.h" | 47 #include "core/xml/XMLHttpRequest.h" |
48 #include "wtf/ArrayBuffer.h" | 48 #include "wtf/ArrayBuffer.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 else if (isDocumentType(arg, args.GetIsolate(), currentWorldType)) { | 186 else if (isDocumentType(arg, args.GetIsolate(), currentWorldType)) { |
187 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); | 187 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); |
188 Document* document = V8Document::toNative(object); | 188 Document* document = V8Document::toNative(object); |
189 ASSERT(document); | 189 ASSERT(document); |
190 xmlHttpRequest->send(document, ec); | 190 xmlHttpRequest->send(document, ec); |
191 } else if (V8Blob::HasInstance(arg, args.GetIsolate(), currentWorldType)
) { | 191 } else if (V8Blob::HasInstance(arg, args.GetIsolate(), currentWorldType)
) { |
192 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); | 192 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); |
193 Blob* blob = V8Blob::toNative(object); | 193 Blob* blob = V8Blob::toNative(object); |
194 ASSERT(blob); | 194 ASSERT(blob); |
195 xmlHttpRequest->send(blob, ec); | 195 xmlHttpRequest->send(blob, ec); |
196 } else if (V8DOMFormData::HasInstance(arg, args.GetIsolate(), currentWor
ldType)) { | 196 } else if (V8FormData::HasInstance(arg, args.GetIsolate(), currentWorldT
ype)) { |
197 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); | 197 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); |
198 DOMFormData* domFormData = V8DOMFormData::toNative(object); | 198 DOMFormData* domFormData = V8FormData::toNative(object); |
199 ASSERT(domFormData); | 199 ASSERT(domFormData); |
200 xmlHttpRequest->send(domFormData, ec); | 200 xmlHttpRequest->send(domFormData, ec); |
201 } else if (V8ArrayBuffer::HasInstance(arg, args.GetIsolate(), currentWor
ldType)) { | 201 } else if (V8ArrayBuffer::HasInstance(arg, args.GetIsolate(), currentWor
ldType)) { |
202 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); | 202 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); |
203 ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(object); | 203 ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(object); |
204 ASSERT(arrayBuffer); | 204 ASSERT(arrayBuffer); |
205 xmlHttpRequest->send(arrayBuffer, ec); | 205 xmlHttpRequest->send(arrayBuffer, ec); |
206 } else if (V8ArrayBufferView::HasInstance(arg, args.GetIsolate(), curren
tWorldType)) { | 206 } else if (V8ArrayBufferView::HasInstance(arg, args.GetIsolate(), curren
tWorldType)) { |
207 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); | 207 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg); |
208 ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(objec
t); | 208 ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(objec
t); |
209 ASSERT(arrayBufferView); | 209 ASSERT(arrayBufferView); |
210 xmlHttpRequest->send(arrayBufferView, ec); | 210 xmlHttpRequest->send(arrayBufferView, ec); |
211 } else | 211 } else |
212 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), ec); | 212 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), ec); |
213 } | 213 } |
214 | 214 |
215 if (ec) | 215 if (ec) |
216 return setDOMException(ec, args.GetIsolate()); | 216 return setDOMException(ec, args.GetIsolate()); |
217 | 217 |
218 return v8::Undefined(); | 218 return v8::Undefined(); |
219 } | 219 } |
220 | 220 |
221 } // namespace WebCore | 221 } // namespace WebCore |
OLD | NEW |