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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/Body.cpp

Issue 1844053003: CREDENTIAL: Rework the integration with Fetch (1/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clear attachedcredentials Created 4 years, 8 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/fetch/Body.h" 5 #include "modules/fetch/Body.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/V8ArrayBuffer.h" 10 #include "bindings/core/v8/V8ArrayBuffer.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 if (getExecutionContext()->activeDOMObjectsAreStopped()) 283 if (getExecutionContext()->activeDOMObjectsAreStopped())
284 return false; 284 return false;
285 if (!bodyBuffer()) 285 if (!bodyBuffer())
286 return false; 286 return false;
287 return bodyBuffer()->hasPendingActivity(); 287 return bodyBuffer()->hasPendingActivity();
288 } 288 }
289 289
290 Body::Body(ExecutionContext* context) 290 Body::Body(ExecutionContext* context)
291 : ActiveScriptWrappable(this) 291 : ActiveScriptWrappable(this)
292 , ActiveDOMObject(context) 292 , ActiveDOMObject(context)
293 , m_opaque(false)
294 { 293 {
295 suspendIfNeeded(); 294 suspendIfNeeded();
296 } 295 }
297 296
298 ScriptPromise Body::rejectInvalidConsumption(ScriptState* scriptState) 297 ScriptPromise Body::rejectInvalidConsumption(ScriptState* scriptState)
299 { 298 {
300 if (m_opaque)
301 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror(scriptState->isolate(), "The body is opaque."));
302 if (isBodyLocked() || bodyUsed()) 299 if (isBodyLocked() || bodyUsed())
303 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror(scriptState->isolate(), "Already read")); 300 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror(scriptState->isolate(), "Already read"));
304 return ScriptPromise(); 301 return ScriptPromise();
305 } 302 }
306 303
307 } // namespace blink 304 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/fetch/Body.h ('k') | third_party/WebKit/Source/modules/fetch/FetchManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698