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

Unified Diff: third_party/WebKit/Source/core/fetch/MultipartImageResourceParser.cpp

Issue 1710733002: Move multipart resource handling to core/fetch (2/2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@multipart-cleanup
Patch Set: rebase Created 4 years, 10 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
Index: third_party/WebKit/Source/core/fetch/MultipartImageResourceParser.cpp
diff --git a/third_party/WebKit/Source/core/fetch/MultipartImageResourceParser.cpp b/third_party/WebKit/Source/core/fetch/MultipartImageResourceParser.cpp
index 7a177ff73251ed868d4a65d5aa6a1581d5f200e1..463ad98ed3b5d60dad4e6ab57de981cafabb2d50 100644
--- a/third_party/WebKit/Source/core/fetch/MultipartImageResourceParser.cpp
+++ b/third_party/WebKit/Source/core/fetch/MultipartImageResourceParser.cpp
@@ -107,6 +107,8 @@ void MultipartImageResourceParser::appendData(const char* bytes, size_t size)
m_isParsingHeaders = true;
break;
}
+ if (isCancelled())
+ return;
}
// At this point, we should send over any data we have, but keep enough data
@@ -158,14 +160,10 @@ bool MultipartImageResourceParser::parseHeaders()
return false;
m_data.remove(0, end);
- // To avoid recording every multipart load as a separate visit in
- // the history database, we want to keep track of whether the response
- // is part of a multipart payload. We do want to record the first visit,
- // so we only set isMultipartPayload to true after the first visit.
- response.setIsMultipartPayload(!m_isFirstPart);
+ bool isFirstPart = m_isFirstPart;
m_isFirstPart = false;
// Send the response!
- m_client->onePartInMultipartReceived(response.toResourceResponse());
+ m_client->onePartInMultipartReceived(response.toResourceResponse(), isFirstPart);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698