Chromium Code Reviews| 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 "config.h" | 5 #include "config.h" |
| 6 #include "Response.h" | 6 #include "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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 | 232 |
| 233 Response* Response::clone() const | 233 Response* Response::clone() const |
| 234 { | 234 { |
| 235 return Response::create(*this); | 235 return Response::create(*this); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void Response::populateWebServiceWorkerResponse(WebServiceWorkerResponse& respon se) | 238 void Response::populateWebServiceWorkerResponse(WebServiceWorkerResponse& respon se) |
| 239 { | 239 { |
| 240 m_response->populateWebServiceWorkerResponse(response); | 240 m_response->populateWebServiceWorkerResponse(response); |
| 241 } | 241 } |
| 242 | 242 |
|
gavinp
2014/11/13 19:35:03
Does Response::hasBody() go here?
(and Response::
| |
| 243 Response::Response(ExecutionContext* context) | 243 Response::Response(ExecutionContext* context) |
| 244 : Body(context) | 244 : Body(context) |
| 245 , m_response(FetchResponseData::create()) | 245 , m_response(FetchResponseData::create()) |
| 246 , m_headers(Headers::create(m_response->headerList())) | 246 , m_headers(Headers::create(m_response->headerList())) |
| 247 { | 247 { |
| 248 m_headers->setGuard(Headers::ResponseGuard); | 248 m_headers->setGuard(Headers::ResponseGuard); |
| 249 } | 249 } |
| 250 | 250 |
| 251 Response::Response(const Response& copy_from) | 251 Response::Response(const Response& copy_from) |
| 252 : Body(copy_from) | 252 : Body(copy_from) |
| 253 , m_response(copy_from.m_response) | 253 , m_response(copy_from.m_response) |
| 254 , m_headers(copy_from.m_headers->createCopy()) | 254 , m_headers(copy_from.m_headers->createCopy()) |
| 255 { | 255 { |
| 256 } | 256 } |
| 257 | 257 |
| 258 Response::Response(ExecutionContext* context, FetchResponseData* response) | 258 Response::Response(ExecutionContext* context, FetchResponseData* response) |
| 259 : Body(context) | 259 : Body(context) |
| 260 , m_response(response) | 260 , m_response(response) |
| 261 , m_headers(Headers::create(m_response->headerList())) | 261 , m_headers(Headers::create(m_response->headerList())) |
| 262 { | 262 { |
| 263 m_headers->setGuard(Headers::ResponseGuard); | 263 m_headers->setGuard(Headers::ResponseGuard); |
| 264 } | 264 } |
| 265 | 265 |
| 266 | 266 |
| 267 PassRefPtr<BlobDataHandle> Response::blobDataHandle() | 267 PassRefPtr<BlobDataHandle> Response::blobDataHandle() |
| 268 { | 268 { |
| 269 return m_response->blobDataHandle(); | 269 return m_response->blobDataHandle(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 bool Response::hasBody() const | |
| 273 { | |
| 274 return m_response->blobDataHandle(); | |
| 275 } | |
| 276 | |
| 272 void Response::trace(Visitor* visitor) | 277 void Response::trace(Visitor* visitor) |
| 273 { | 278 { |
| 274 Body::trace(visitor); | 279 Body::trace(visitor); |
| 275 visitor->trace(m_response); | 280 visitor->trace(m_response); |
| 276 visitor->trace(m_headers); | 281 visitor->trace(m_headers); |
| 277 } | 282 } |
| 278 | 283 |
| 279 } // namespace blink | 284 } // namespace blink |
| OLD | NEW |