| Index: Source/modules/fetch/Request.cpp
|
| diff --git a/Source/modules/fetch/Request.cpp b/Source/modules/fetch/Request.cpp
|
| index 82e6f5ad415045af0344498b0e441dcafa50d56b..01f1c607fa3ceb1bc1b228581fd04fe927ec90a0 100644
|
| --- a/Source/modules/fetch/Request.cpp
|
| +++ b/Source/modules/fetch/Request.cpp
|
| @@ -74,7 +74,7 @@ Request* Request::createRequestWithRequestOrString(ScriptState* scriptState, Req
|
| // creating a draining stream.
|
| // TODO(yhirano): Fix this once Request.body is introduced.
|
| OwnPtr<BlobData> blobData = BlobData::create();
|
| - blobData->setContentType(inputRequest->blobDataHandle()->type());
|
| + blobData->setContentType(inputRequest->m_request->blobDataHandle()->type());
|
| temporaryBody = BlobDataHandle::create(blobData.release(), 0);
|
| } else {
|
| temporaryBody = inputRequest->m_request->blobDataHandle();
|
| @@ -320,7 +320,7 @@ Request* Request::create(ExecutionContext* context, const WebServiceWorkerReques
|
|
|
| Request::Request(ExecutionContext* context, const WebServiceWorkerRequest& webRequest)
|
| : Body(context)
|
| - , m_request(FetchRequestData::create(webRequest))
|
| + , m_request(FetchRequestData::create(context, webRequest))
|
| , m_headers(Headers::create(m_request->headerList()))
|
| {
|
| m_headers->setGuard(Headers::RequestGuard);
|
| @@ -472,16 +472,16 @@ Request* Request::clone(ExceptionState& exceptionState) const
|
| return nullptr;
|
| }
|
|
|
| - FetchRequestData* request = m_request->clone();
|
| - if (blobDataHandle() && isBodyConsumed()) {
|
| + FetchRequestData* request = m_request->clone(executionContext());
|
| + if (m_request->blobDataHandle() && isBodyConsumed()) {
|
| // Currently the only methods that can consume body data without
|
| // setting 'body passed' flag consume entire body (e.g. text()). Thus
|
| // we can set an empty blob to the new request instead of creating a
|
| // draining stream.
|
| // TODO(yhirano): Fix this once Request.body is introduced.
|
| OwnPtr<BlobData> blobData = BlobData::create();
|
| - blobData->setContentType(blobDataHandle()->type());
|
| - request->setBlobDataHandle(BlobDataHandle::create(blobData.release(), 0));
|
| + blobData->setContentType(m_request->blobDataHandle()->type());
|
| + request->setBlobDataHandle(executionContext(), BlobDataHandle::create(blobData.release(), 0));
|
| }
|
|
|
| Headers* headers = Headers::create(request->headerList());
|
| @@ -495,7 +495,7 @@ FetchRequestData* Request::passRequestData()
|
| {
|
| ASSERT(!bodyUsed());
|
| lockBody(PassBody);
|
| - return m_request->pass();
|
| + return m_request->pass(executionContext());
|
| }
|
|
|
| void Request::populateWebServiceWorkerRequest(WebServiceWorkerRequest& webRequest) const
|
| @@ -518,8 +518,8 @@ void Request::populateWebServiceWorkerRequest(WebServiceWorkerRequest& webReques
|
|
|
| void Request::setBodyBlobHandle(PassRefPtr<BlobDataHandle> blobDataHandle)
|
| {
|
| - m_request->setBlobDataHandle(blobDataHandle);
|
| - setBody(m_request->blobDataHandle());
|
| + m_request->setBlobDataHandle(executionContext(), blobDataHandle);
|
| + setBody(m_request->buffer());
|
| }
|
|
|
| void Request::clearHeaderList()
|
| @@ -527,15 +527,9 @@ void Request::clearHeaderList()
|
| m_request->headerList()->clearList();
|
| }
|
|
|
| -PassRefPtr<BlobDataHandle> Request::blobDataHandle() const
|
| +BodyStreamBuffer2* Request::buffer() const
|
| {
|
| - return m_request->blobDataHandle();
|
| -}
|
| -
|
| -BodyStreamBuffer* Request::buffer() const
|
| -{
|
| - // We don't support BodyStreamBuffer for Request yet.
|
| - return nullptr;
|
| + return m_request->buffer();
|
| }
|
|
|
| String Request::mimeType() const
|
|
|