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

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

Issue 2292763002: [Fetch API] Implement Request.formData and Response.formData. (Closed)
Patch Set: Rebase Created 3 years, 7 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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698