OLD | NEW |
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/Response.h" | 5 #include "modules/fetch/Response.h" |
6 | 6 |
7 #include "bindings/core/v8/Dictionary.h" | 7 #include "bindings/core/v8/Dictionary.h" |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 } | 424 } |
425 | 425 |
426 bool Response::hasBody() const { | 426 bool Response::hasBody() const { |
427 return m_response->internalBuffer(); | 427 return m_response->internalBuffer(); |
428 } | 428 } |
429 | 429 |
430 bool Response::bodyUsed() { | 430 bool Response::bodyUsed() { |
431 return internalBodyBuffer() && internalBodyBuffer()->isStreamDisturbed(); | 431 return internalBodyBuffer() && internalBodyBuffer()->isStreamDisturbed(); |
432 } | 432 } |
433 | 433 |
| 434 String Response::contentType() const { |
| 435 String result; |
| 436 m_response->headerList()->get(HTTPNames::Content_Type, result); |
| 437 return result; |
| 438 } |
| 439 |
434 String Response::mimeType() const { | 440 String Response::mimeType() const { |
435 return m_response->mimeType(); | 441 return m_response->mimeType(); |
436 } | 442 } |
437 | 443 |
438 String Response::internalMIMEType() const { | 444 String Response::internalMIMEType() const { |
439 return m_response->internalMIMEType(); | 445 return m_response->internalMIMEType(); |
440 } | 446 } |
441 | 447 |
442 void Response::installBody() { | 448 void Response::installBody() { |
443 if (!internalBodyBuffer()) | 449 if (!internalBodyBuffer()) |
(...skipping 17 matching lines...) Expand all Loading... |
461 V8HiddenValue::internalBodyBuffer(scriptState->isolate()), bodyBuffer); | 467 V8HiddenValue::internalBodyBuffer(scriptState->isolate()), bodyBuffer); |
462 } | 468 } |
463 | 469 |
464 DEFINE_TRACE(Response) { | 470 DEFINE_TRACE(Response) { |
465 Body::trace(visitor); | 471 Body::trace(visitor); |
466 visitor->trace(m_response); | 472 visitor->trace(m_response); |
467 visitor->trace(m_headers); | 473 visitor->trace(m_headers); |
468 } | 474 } |
469 | 475 |
470 } // namespace blink | 476 } // namespace blink |
OLD | NEW |