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

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

Issue 1418813004: [Fetch API] Reflect spec changes of bodyUsed property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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 "config.h" 5 #include "config.h"
6 #include "modules/fetch/Response.h" 6 #include "modules/fetch/Response.h"
7 7
8 #include "bindings/core/v8/Dictionary.h" 8 #include "bindings/core/v8/Dictionary.h"
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "core/dom/DOMArrayBuffer.h" 10 #include "core/dom/DOMArrayBuffer.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 383 }
384 384
385 Response::Response(ExecutionContext* context, FetchResponseData* response, Heade rs* headers) 385 Response::Response(ExecutionContext* context, FetchResponseData* response, Heade rs* headers)
386 : Body(context) , m_response(response) , m_headers(headers) {} 386 : Body(context) , m_response(response) , m_headers(headers) {}
387 387
388 bool Response::hasBody() const 388 bool Response::hasBody() const
389 { 389 {
390 return m_response->internalBuffer(); 390 return m_response->internalBuffer();
391 } 391 }
392 392
393 bool Response::bodyUsed()
394 {
395 return (internalBodyBuffer() && internalBodyBuffer()->stream()->isDisturbed( )) || (bodyBuffer() && bodyBuffer()->stream()->isDisturbed());
tyoshino (SeeGerritForStatus) 2015/11/18 09:55:36 just need to check internalBodyBuffer?
yhirano 2015/11/19 08:41:29 Done.
396 }
397
393 String Response::mimeType() const 398 String Response::mimeType() const
394 { 399 {
395 return m_response->mimeType(); 400 return m_response->mimeType();
396 } 401 }
397 402
398 String Response::internalMIMEType() const 403 String Response::internalMIMEType() const
399 { 404 {
400 return m_response->internalMIMEType(); 405 return m_response->internalMIMEType();
401 } 406 }
402 407
403 DEFINE_TRACE(Response) 408 DEFINE_TRACE(Response)
404 { 409 {
405 Body::trace(visitor); 410 Body::trace(visitor);
406 visitor->trace(m_response); 411 visitor->trace(m_response);
407 visitor->trace(m_headers); 412 visitor->trace(m_headers);
408 } 413 }
409 414
410 } // namespace blink 415 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698