Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: Source/bindings/v8/custom/V8XMLHttpRequestCustom.cpp

Issue 22842002: Stop throwing DOM exceptions in internal 'XMLHttpRequest' response getters. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moar. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/xml/XMLHttpRequest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/core/xml/XMLHttpRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698