| Index: Source/modules/serviceworkers/Response.cpp
|
| diff --git a/Source/modules/serviceworkers/Response.cpp b/Source/modules/serviceworkers/Response.cpp
|
| index e7dc47e47ef597b41315d3be0891a5cdbeaac314..5208acb41ff92c8f0e238d80dd9ec361cb32c160 100644
|
| --- a/Source/modules/serviceworkers/Response.cpp
|
| +++ b/Source/modules/serviceworkers/Response.cpp
|
| @@ -12,14 +12,12 @@
|
|
|
| namespace blink {
|
|
|
| -DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Response);
|
| -
|
| -PassRefPtrWillBeRawPtr<Response> Response::create(Blob* body, const Dictionary& responseInit, ExceptionState& exceptionState)
|
| +Response* Response::create(Blob* body, const Dictionary& responseInit, ExceptionState& exceptionState)
|
| {
|
| return create(body, ResponseInit(responseInit), exceptionState);
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<Response> Response::create(const String& body, const Dictionary& responseInit, ExceptionState& exceptionState)
|
| +Response* Response::create(const String& body, const Dictionary& responseInit, ExceptionState& exceptionState)
|
| {
|
| OwnPtr<BlobData> blobData = BlobData::create();
|
| blobData->appendText(body, false);
|
| @@ -30,13 +28,13 @@ PassRefPtrWillBeRawPtr<Response> Response::create(const String& body, const Dict
|
| return create(blob.get(), ResponseInit(responseInit), exceptionState);
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<Response> Response::create(Blob* body, const ResponseInit& responseInit, ExceptionState& exceptionState)
|
| +Response* Response::create(Blob* body, const ResponseInit& responseInit, ExceptionState& exceptionState)
|
| {
|
| // "1. If |init|'s status member is not in the range 200 to 599, throw a
|
| // RangeError."
|
| if (responseInit.status < 200 || 599 < responseInit.status) {
|
| exceptionState.throwRangeError("Invalid status");
|
| - return nullptr;
|
| + return 0;
|
| }
|
|
|
| // FIXME: "2. If |init|'s statusText member does not match the Reason-Phrase
|
| @@ -44,7 +42,7 @@ PassRefPtrWillBeRawPtr<Response> Response::create(Blob* body, const ResponseInit
|
|
|
| // "3. Let |r| be a new Response object, associated with a new response,
|
| // Headers object, and FetchBodyStream object."
|
| - RefPtrWillBeRawPtr<Response> r = adoptRefWillBeNoop(new Response());
|
| + Response* r = new Response();
|
|
|
| // "4. Set |r|'s response's status to |init|'s status member."
|
| r->m_response->setStatus(responseInit.status);
|
| @@ -60,7 +58,7 @@ PassRefPtrWillBeRawPtr<Response> Response::create(Blob* body, const ResponseInit
|
| // any exceptions."
|
| r->m_headers->fillWith(responseInit.headers.get(), exceptionState);
|
| if (exceptionState.hadException())
|
| - return nullptr;
|
| + return 0;
|
| } else if (!responseInit.headersDictionary.isUndefinedOrNull()) {
|
| // "1. Empty |r|'s response's header list."
|
| r->m_response->headerList()->clearList();
|
| @@ -68,7 +66,7 @@ PassRefPtrWillBeRawPtr<Response> Response::create(Blob* body, const ResponseInit
|
| // any exceptions."
|
| r->m_headers->fillWith(responseInit.headersDictionary, exceptionState);
|
| if (exceptionState.hadException())
|
| - return nullptr;
|
| + return 0;
|
| }
|
| // "7. If body is given, run these substeps:"
|
| if (body) {
|
| @@ -90,12 +88,12 @@ PassRefPtrWillBeRawPtr<Response> Response::create(Blob* body, const ResponseInit
|
| // extracting a MIME type from |r|'s response's header list."
|
|
|
| // "9. Return |r|."
|
| - return r.release();
|
| + return r;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<Response> Response::create(PassRefPtrWillBeRawPtr<FetchResponseData> response)
|
| +Response* Response::create(FetchResponseData* response)
|
| {
|
| - return adoptRefWillBeNoop(new Response(response));
|
| + return new Response(response);
|
| }
|
|
|
| String Response::type() const
|
| @@ -141,16 +139,16 @@ String Response::statusText() const
|
| return m_response->statusMessage();
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<Headers> Response::headers() const
|
| +Headers* Response::headers() const
|
| {
|
| // "The headers attribute's getter must return the associated Headers object."
|
| return m_headers;
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<FetchBodyStream> Response::body(ExecutionContext* context)
|
| +FetchBodyStream* Response::body(ExecutionContext* context)
|
| {
|
| if (!m_response->blobDataHandle())
|
| - return nullptr;
|
| + return 0;
|
| if (!m_fetchBodyStream)
|
| m_fetchBodyStream = FetchBodyStream::create(context, m_response->blobDataHandle());
|
| return m_fetchBodyStream;
|
| @@ -169,7 +167,7 @@ Response::Response()
|
| ScriptWrappable::init(this);
|
| }
|
|
|
| -Response::Response(PassRefPtrWillBeRawPtr<FetchResponseData> response)
|
| +Response::Response(FetchResponseData* response)
|
| : m_response(response)
|
| , m_headers(Headers::create(m_response->headerList()))
|
| {
|
|
|