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

Unified Diff: Source/modules/serviceworkers/Response.cpp

Issue 606653006: bindings: Adds DOMArrayBuffer, etc. as thin wrappers for ArrayBuffer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/serviceworkers/Response.h ('k') | Source/modules/webaudio/AnalyserNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/Response.cpp
diff --git a/Source/modules/serviceworkers/Response.cpp b/Source/modules/serviceworkers/Response.cpp
index 2f402811448f478d52c391c4090f51fc9f5614b7..7ea930cab4e2ff520abb1839c0fd94d7b9709ba7 100644
--- a/Source/modules/serviceworkers/Response.cpp
+++ b/Source/modules/serviceworkers/Response.cpp
@@ -7,11 +7,11 @@
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "core/dom/DOMArrayBuffer.h"
+#include "core/dom/DOMArrayBufferView.h"
#include "core/fileapi/Blob.h"
#include "modules/serviceworkers/ResponseInit.h"
#include "public/platform/WebServiceWorkerResponse.h"
-#include "wtf/ArrayBuffer.h"
-#include "wtf/ArrayBufferView.h"
#include "wtf/RefPtr.h"
namespace blink {
@@ -75,19 +75,19 @@ Response* Response::create(ExecutionContext* context, const String& body, const
return create(context, blob, ResponseInit(responseInit, exceptionState), exceptionState);
}
-Response* Response::create(ExecutionContext* context, const ArrayBuffer* body, const Dictionary& responseInit, ExceptionState& exceptionState)
+Response* Response::create(ExecutionContext* context, const DOMArrayBuffer* body, const Dictionary& responseInit, ExceptionState& exceptionState)
{
OwnPtr<BlobData> blobData = BlobData::create();
- blobData->appendArrayBuffer(body);
+ blobData->appendArrayBuffer(body->buffer());
const long long length = blobData->length();
Blob* blob = Blob::create(BlobDataHandle::create(blobData.release(), length));
return create(context, blob, ResponseInit(responseInit, exceptionState), exceptionState);
}
-Response* Response::create(ExecutionContext* context, const ArrayBufferView* body, const Dictionary& responseInit, ExceptionState& exceptionState)
+Response* Response::create(ExecutionContext* context, const DOMArrayBufferView* body, const Dictionary& responseInit, ExceptionState& exceptionState)
{
OwnPtr<BlobData> blobData = BlobData::create();
- blobData->appendArrayBufferView(body);
+ blobData->appendArrayBufferView(body->view());
const long long length = blobData->length();
Blob* blob = Blob::create(BlobDataHandle::create(blobData.release(), length));
return create(context, blob, ResponseInit(responseInit, exceptionState), exceptionState);
« no previous file with comments | « Source/modules/serviceworkers/Response.h ('k') | Source/modules/webaudio/AnalyserNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698