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

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

Issue 475533005: [ServiceWorker] Add support of FetchEvent's request.body. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 4 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/Request.h ('k') | Source/modules/serviceworkers/Request.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/serviceworkers/Request.cpp
diff --git a/Source/modules/serviceworkers/Request.cpp b/Source/modules/serviceworkers/Request.cpp
index 898f1b22ad2603503aa32ed0fbe8cec3310b562b..835617bc59f83e6a0c5619fdd0ba50d7b1c7f626 100644
--- a/Source/modules/serviceworkers/Request.cpp
+++ b/Source/modules/serviceworkers/Request.cpp
@@ -212,6 +212,16 @@ String Request::url() const
return url;
}
+PassRefPtrWillBeRawPtr<FetchBodyStream> Request::body(ExecutionContext* context)
+{
+ if (!m_request->blobDataHandle())
+ return nullptr;
+ if (!m_fetchBodyStream)
+ m_fetchBodyStream = FetchBodyStream::create(context, m_request->blobDataHandle());
+ return m_fetchBodyStream;
+}
+
+
String Request::referrer() const
{
// "The referrer attribute's getter must return the empty string if
@@ -258,6 +268,7 @@ void Request::trace(Visitor* visitor)
{
visitor->trace(m_request);
visitor->trace(m_headers);
+ visitor->trace(m_fetchBodyStream);
}
} // namespace blink
« no previous file with comments | « Source/modules/serviceworkers/Request.h ('k') | Source/modules/serviceworkers/Request.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698