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

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

Issue 455303002: Add 'stream' to XMLHttpRequest response type. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@stream-promise-property-reset
Patch Set: Created 6 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
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 20 matching lines...) Expand all
31 #include "config.h" 31 #include "config.h"
32 #include "bindings/core/v8/V8XMLHttpRequest.h" 32 #include "bindings/core/v8/V8XMLHttpRequest.h"
33 33
34 #include "bindings/core/v8/ExceptionMessages.h" 34 #include "bindings/core/v8/ExceptionMessages.h"
35 #include "bindings/core/v8/ExceptionState.h" 35 #include "bindings/core/v8/ExceptionState.h"
36 #include "bindings/core/v8/V8Binding.h" 36 #include "bindings/core/v8/V8Binding.h"
37 #include "bindings/core/v8/V8Blob.h" 37 #include "bindings/core/v8/V8Blob.h"
38 #include "bindings/core/v8/V8Document.h" 38 #include "bindings/core/v8/V8Document.h"
39 #include "bindings/core/v8/V8FormData.h" 39 #include "bindings/core/v8/V8FormData.h"
40 #include "bindings/core/v8/V8HTMLDocument.h" 40 #include "bindings/core/v8/V8HTMLDocument.h"
41 #include "bindings/core/v8/V8ReadableStream.h"
tyoshino (SeeGerritForStatus) 2014/08/15 09:32:06 where is this used?
yhirano 2014/08/15 09:51:34 v8SetReturnValueFast(..., ReadableStream*, ...);
41 #include "bindings/core/v8/V8Stream.h" 42 #include "bindings/core/v8/V8Stream.h"
42 #include "bindings/core/v8/custom/V8ArrayBufferCustom.h" 43 #include "bindings/core/v8/custom/V8ArrayBufferCustom.h"
43 #include "bindings/core/v8/custom/V8ArrayBufferViewCustom.h" 44 #include "bindings/core/v8/custom/V8ArrayBufferViewCustom.h"
44 #include "core/dom/Document.h" 45 #include "core/dom/Document.h"
45 #include "core/inspector/InspectorInstrumentation.h" 46 #include "core/inspector/InspectorInstrumentation.h"
47 #include "core/streams/ReadableStream.h"
46 #include "core/streams/Stream.h" 48 #include "core/streams/Stream.h"
47 #include "core/workers/WorkerGlobalScope.h" 49 #include "core/workers/WorkerGlobalScope.h"
48 #include "core/xml/XMLHttpRequest.h" 50 #include "core/xml/XMLHttpRequest.h"
49 #include "wtf/ArrayBuffer.h" 51 #include "wtf/ArrayBuffer.h"
50 #include <v8.h> 52 #include <v8.h>
51 53
52 namespace blink { 54 namespace blink {
53 55
54 void V8XMLHttpRequest::constructorCustom(const v8::FunctionCallbackInfo<v8::Valu e>& info) 56 void V8XMLHttpRequest::constructorCustom(const v8::FunctionCallbackInfo<v8::Valu e>& info)
55 { 57 {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 127
126 case XMLHttpRequest::ResponseTypeBlob: 128 case XMLHttpRequest::ResponseTypeBlob:
127 { 129 {
128 Blob* blob = xmlHttpRequest->responseBlob(); 130 Blob* blob = xmlHttpRequest->responseBlob();
129 v8SetReturnValueFast(info, blob, xmlHttpRequest); 131 v8SetReturnValueFast(info, blob, xmlHttpRequest);
130 return; 132 return;
131 } 133 }
132 134
133 case XMLHttpRequest::ResponseTypeLegacyStream: 135 case XMLHttpRequest::ResponseTypeLegacyStream:
134 { 136 {
135 Stream* stream = xmlHttpRequest->responseStream(); 137 Stream* stream = xmlHttpRequest->responseLegacyStream();
136 v8SetReturnValueFast(info, stream, xmlHttpRequest); 138 v8SetReturnValueFast(info, stream, xmlHttpRequest);
137 return; 139 return;
138 } 140 }
139 141
142 case XMLHttpRequest::ResponseTypeStream:
143 {
144 ReadableStream* stream = xmlHttpRequest->responseStream();
145 v8SetReturnValueFast(info, stream, xmlHttpRequest);
146 return;
147 }
148
149
tyoshino (SeeGerritForStatus) 2014/08/15 09:32:06 one blank line
yhirano 2014/08/15 09:51:34 Done.
140 case XMLHttpRequest::ResponseTypeArrayBuffer: 150 case XMLHttpRequest::ResponseTypeArrayBuffer:
141 { 151 {
142 ArrayBuffer* arrayBuffer = xmlHttpRequest->responseArrayBuffer(); 152 ArrayBuffer* arrayBuffer = xmlHttpRequest->responseArrayBuffer();
143 if (arrayBuffer) { 153 if (arrayBuffer) {
144 arrayBuffer->setDeallocationObserver(V8ArrayBufferDeallocationOb server::instanceTemplate()); 154 arrayBuffer->setDeallocationObserver(V8ArrayBufferDeallocationOb server::instanceTemplate());
145 } 155 }
146 v8SetReturnValueFast(info, arrayBuffer, xmlHttpRequest); 156 v8SetReturnValueFast(info, arrayBuffer, xmlHttpRequest);
147 return; 157 return;
148 } 158 }
149 } 159 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } else { 252 } else {
243 TOSTRING_VOID(V8StringResource<TreatNullAsNullString>, argString, ar g); 253 TOSTRING_VOID(V8StringResource<TreatNullAsNullString>, argString, ar g);
244 xmlHttpRequest->send(argString, exceptionState); 254 xmlHttpRequest->send(argString, exceptionState);
245 } 255 }
246 } 256 }
247 257
248 exceptionState.throwIfNeeded(); 258 exceptionState.throwIfNeeded();
249 } 259 }
250 260
251 } // namespace blink 261 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698