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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 ExceptionState es(info.GetIsolate()); | 95 ExceptionState es(info.GetIsolate()); |
96 Document* document = xmlHttpRequest->responseXML(es); | 96 Document* document = xmlHttpRequest->responseXML(es); |
97 if (es.throwIfNeeded()) | 97 if (es.throwIfNeeded()) |
98 return; | 98 return; |
99 v8SetReturnValue(info, toV8Fast(document, info, xmlHttpRequest)); | 99 v8SetReturnValue(info, toV8Fast(document, info, xmlHttpRequest)); |
100 return; | 100 return; |
101 } | 101 } |
102 | 102 |
103 case XMLHttpRequest::ResponseTypeBlob: | 103 case XMLHttpRequest::ResponseTypeBlob: |
104 { | 104 { |
105 ExceptionState es(info.GetIsolate()); | 105 Blob* blob = xmlHttpRequest->responseBlob(); |
106 Blob* blob = xmlHttpRequest->responseBlob(es); | |
107 if (es.throwIfNeeded()) | |
108 return; | |
109 v8SetReturnValue(info, toV8Fast(blob, info, xmlHttpRequest)); | 106 v8SetReturnValue(info, toV8Fast(blob, info, xmlHttpRequest)); |
110 return; | 107 return; |
111 } | 108 } |
112 | 109 |
113 case XMLHttpRequest::ResponseTypeArrayBuffer: | 110 case XMLHttpRequest::ResponseTypeArrayBuffer: |
114 { | 111 { |
115 ExceptionState es(info.GetIsolate()); | 112 ArrayBuffer* arrayBuffer = xmlHttpRequest->responseArrayBuffer(); |
116 ArrayBuffer* arrayBuffer = xmlHttpRequest->responseArrayBuffer(es); | |
117 if (es.throwIfNeeded()) | |
118 return; | |
119 if (arrayBuffer && !arrayBuffer->hasDeallocationObserver()) { | 113 if (arrayBuffer && !arrayBuffer->hasDeallocationObserver()) { |
120 arrayBuffer->setDeallocationObserver(V8ArrayBufferDeallocationOb
server::instance()); | 114 arrayBuffer->setDeallocationObserver(V8ArrayBufferDeallocationOb
server::instance()); |
121 v8::V8::AdjustAmountOfExternalAllocatedMemory(arrayBuffer->byteL
ength()); | 115 v8::V8::AdjustAmountOfExternalAllocatedMemory(arrayBuffer->byteL
ength()); |
122 } | 116 } |
123 v8SetReturnValue(info, toV8Fast(arrayBuffer, info, xmlHttpRequest)); | 117 v8SetReturnValue(info, toV8Fast(arrayBuffer, info, xmlHttpRequest)); |
124 return; | 118 return; |
125 } | 119 } |
126 } | 120 } |
127 } | 121 } |
128 | 122 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 ASSERT(arrayBufferView); | 211 ASSERT(arrayBufferView); |
218 xmlHttpRequest->send(arrayBufferView, es); | 212 xmlHttpRequest->send(arrayBufferView, es); |
219 } else | 213 } else |
220 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), es); | 214 xmlHttpRequest->send(toWebCoreStringWithNullCheck(arg), es); |
221 } | 215 } |
222 | 216 |
223 es.throwIfNeeded(); | 217 es.throwIfNeeded(); |
224 } | 218 } |
225 | 219 |
226 } // namespace WebCore | 220 } // namespace WebCore |
OLD | NEW |