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

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

Issue 1053503002: [Fetch] Response.clone should tee the body stream. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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/fetch/Request.cpp ('k') | Source/modules/serviceworkers/Cache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/Response.cpp
diff --git a/Source/modules/fetch/Response.cpp b/Source/modules/fetch/Response.cpp
index 80d47fdb99bb1b5603a79f23f376cf0db2cbc320..f31521ae5233fa696f1694ea162250c8b3c7ab75 100644
--- a/Source/modules/fetch/Response.cpp
+++ b/Source/modules/fetch/Response.cpp
@@ -299,6 +299,10 @@ Response* Response::clone(ExceptionState& exceptionState)
BodyStreamBuffer* drainingStream = createDrainingStream();
m_response->replaceBodyStreamBuffer(drainingStream);
}
+ // Lock the old body and set |body| property to the new one.
+ lockBody();
+ refreshBody();
+
FetchResponseData* response = m_response->clone();
Headers* headers = Headers::create(response->headerList());
headers->setGuard(m_headers->guard());
« no previous file with comments | « Source/modules/fetch/Request.cpp ('k') | Source/modules/serviceworkers/Cache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698