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 <memory> | 7 #include <memory> |
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 "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 } | 418 } |
419 | 419 |
420 bool Response::bodyUsed() { | 420 bool Response::bodyUsed() { |
421 return InternalBodyBuffer() && InternalBodyBuffer()->IsStreamDisturbed(); | 421 return InternalBodyBuffer() && InternalBodyBuffer()->IsStreamDisturbed(); |
422 } | 422 } |
423 | 423 |
424 String Response::MimeType() const { | 424 String Response::MimeType() const { |
425 return response_->MimeType(); | 425 return response_->MimeType(); |
426 } | 426 } |
427 | 427 |
| 428 String Response::ContentType() const { |
| 429 String result; |
| 430 response_->HeaderList()->Get(HTTPNames::Content_Type, result); |
| 431 return result; |
| 432 } |
| 433 |
428 String Response::InternalMIMEType() const { | 434 String Response::InternalMIMEType() const { |
429 return response_->InternalMIMEType(); | 435 return response_->InternalMIMEType(); |
430 } | 436 } |
431 | 437 |
432 const Vector<KURL>& Response::InternalURLList() const { | 438 const Vector<KURL>& Response::InternalURLList() const { |
433 return response_->InternalURLList(); | 439 return response_->InternalURLList(); |
434 } | 440 } |
435 | 441 |
436 void Response::InstallBody() { | 442 void Response::InstallBody() { |
437 if (!InternalBodyBuffer()) | 443 if (!InternalBodyBuffer()) |
(...skipping 16 matching lines...) Expand all Loading... |
454 .Set(response.As<v8::Object>(), body_buffer); | 460 .Set(response.As<v8::Object>(), body_buffer); |
455 } | 461 } |
456 | 462 |
457 DEFINE_TRACE(Response) { | 463 DEFINE_TRACE(Response) { |
458 Body::Trace(visitor); | 464 Body::Trace(visitor); |
459 visitor->Trace(response_); | 465 visitor->Trace(response_); |
460 visitor->Trace(headers_); | 466 visitor->Trace(headers_); |
461 } | 467 } |
462 | 468 |
463 } // namespace blink | 469 } // namespace blink |
OLD | NEW |