Index: Source/modules/serviceworkers/Response.cpp |
diff --git a/Source/modules/serviceworkers/Response.cpp b/Source/modules/serviceworkers/Response.cpp |
index 5752a45b580d848c612fdf2a4eea9587d125439c..b12be8c26201e07ba676c13a23ccbe0a9390c58a 100644 |
--- a/Source/modules/serviceworkers/Response.cpp |
+++ b/Source/modules/serviceworkers/Response.cpp |
@@ -11,6 +11,7 @@ |
#include "modules/serviceworkers/FetchBodyStream.h" |
#include "modules/serviceworkers/ResponseInit.h" |
#include "public/platform/WebServiceWorkerResponse.h" |
+#include "wtf/ArrayBuffer.h" |
namespace blink { |
@@ -60,6 +61,15 @@ Response* Response::create(const String& body, const Dictionary& responseInit, E |
return create(blob.get(), ResponseInit(responseInit), exceptionState); |
} |
+Response* Response::create(const ArrayBuffer* body, const Dictionary& responseInit, ExceptionState& exceptionState) |
+{ |
+ OwnPtr<BlobData> blobData = BlobData::create(); |
+ blobData->appendArrayBuffer(body); |
+ const long long length = blobData->length(); |
+ RefPtrWillBeRawPtr<Blob> blob = Blob::create(BlobDataHandle::create(blobData.release(), length)); |
+ return create(blob.get(), ResponseInit(responseInit), 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 |