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

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

Issue 786893004: [ServiceWorker] Use BodyStreamBuffer as the body data of the Response object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated yhirano's comment Created 6 years 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
Index: Source/modules/serviceworkers/Request.cpp
diff --git a/Source/modules/serviceworkers/Request.cpp b/Source/modules/serviceworkers/Request.cpp
index 0dfc4b60438e8d838d2ef40bd90f96e17c112237..66cefbc28afea6ae5c6695f7f261db48a7289141 100644
--- a/Source/modules/serviceworkers/Request.cpp
+++ b/Source/modules/serviceworkers/Request.cpp
@@ -268,8 +268,8 @@ Request::Request(ExecutionContext* context, const WebServiceWorkerRequest& webRe
Request::Request(const Request& copy_from)
: Body(copy_from)
- , m_request(copy_from.m_request)
- , m_headers(copy_from.m_headers->createCopy())
+ , m_request(copy_from.m_request->createCopy())
+ , m_headers(Headers::create(m_request->headerList()))
{
}
@@ -342,6 +342,11 @@ Request* Request::clone(ExceptionState& exceptionState) const
exceptionState.throwTypeError("Request body is already used");
return nullptr;
}
+ if (streamAccessed()) {
+ // FIXME: Support clone() of the stream accessed Request.
+ exceptionState.throwTypeError("clone() of the Request which .body is accessed is not supported.");
+ return nullptr;
+ }
return Request::create(*this);
}
@@ -371,11 +376,21 @@ void Request::clearHeaderList()
m_request->headerList()->clearList();
}
-PassRefPtr<BlobDataHandle> Request::blobDataHandle()
+PassRefPtr<BlobDataHandle> Request::blobDataHandle() const
{
return m_request->blobDataHandle();
}
+BodyStreamBuffer* Request::buffer() const
+{
+ return nullptr;
+}
+
+String Request::contentType() const
+{
+ return m_request->contentType();
+}
+
void Request::trace(Visitor* visitor)
{
Body::trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698