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

Unified Diff: webkit/glue/multipart_response_delegate.cc

Issue 661445: Avoid having every frame of a multipart response create a (Closed)
Patch Set: with unittest Created 10 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
« no previous file with comments | « webkit/glue/multipart_response_delegate.h ('k') | webkit/glue/multipart_response_delegate_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/multipart_response_delegate.cc
diff --git a/webkit/glue/multipart_response_delegate.cc b/webkit/glue/multipart_response_delegate.cc
index 20e207af4c8ba37f1d19e51bbfad9849fd791247..8de6469fb584036d703e489df7745e3450a31fd2 100644
--- a/webkit/glue/multipart_response_delegate.cc
+++ b/webkit/glue/multipart_response_delegate.cc
@@ -64,7 +64,8 @@ MultipartResponseDelegate::MultipartResponseDelegate(
boundary_("--"),
first_received_data_(true),
processing_headers_(false),
- stop_sending_(false) {
+ stop_sending_(false),
+ has_sent_first_response_(false) {
// Some servers report a boundary prefixed with "--". See bug 5786.
if (StartsWithASCII(boundary, "--", true)) {
boundary_.assign(boundary);
@@ -227,6 +228,12 @@ bool MultipartResponseDelegate::ParseHeaders() {
WebString::fromUTF8(value));
}
}
+ // 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(has_sent_first_response_);
+ has_sent_first_response_ = true;
// Send the response!
client_->didReceiveResponse(loader_, response);
« no previous file with comments | « webkit/glue/multipart_response_delegate.h ('k') | webkit/glue/multipart_response_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698