summaryrefslogtreecommitdiffstats
path: root/webkit/glue/multipart_response_delegate.cc
diff options
context:
space:
mode:
authoryurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-02 18:45:07 +0000
committeryurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-02 18:45:07 +0000
commit5ce1080087f15aba535651d45fedd456992641cf (patch)
treee30e61c97782267077cc26a4a0939a2fbc66bdc1 /webkit/glue/multipart_response_delegate.cc
parent1a33ee397f360ee793dee7faf618ac8093f768d1 (diff)
downloadchromium_src-5ce1080087f15aba535651d45fedd456992641cf.zip
chromium_src-5ce1080087f15aba535651d45fedd456992641cf.tar.gz
chromium_src-5ce1080087f15aba535651d45fedd456992641cf.tar.bz2
DevTools: report correct content length for resources.
Currently lengthReceived always has the same value as dataLength when Safari calls ResourceHandle::didReceiveData. In Chrome expected content length is passed as lengthReceived parameter which leads to incorrect content length to be stored in InspectorResource. InspectorResource expects lengthReceived to be the length of current data chunk(see InspectorResource::addLength). So I changed lengthReceived parameter to be dataLength. Darin, I see your TODO comment at line 581 in http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/weburlloader_impl.cc?annotate=6296 (the comment was deleted later) so I think you are right person to review the change in weburlloader_impl.cc. Please look at weburlloader_impl.cc and feel free to leave devtools specific changes to Alex and Pavel. BUG=25213 TEST=DevToolsSanityTest.TestResourceContentLength Review URL: http://codereview.chromium.org/295041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30725 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/multipart_response_delegate.cc')
-rw-r--r--webkit/glue/multipart_response_delegate.cc13
1 files changed, 2 insertions, 11 deletions
diff --git a/webkit/glue/multipart_response_delegate.cc b/webkit/glue/multipart_response_delegate.cc
index 8870de9..5d1f57d 100644
--- a/webkit/glue/multipart_response_delegate.cc
+++ b/webkit/glue/multipart_response_delegate.cc
@@ -81,10 +81,6 @@ void MultipartResponseDelegate::OnReceivedData(const char* data,
if (stop_sending_)
return;
- // TODO(tc): Figure out what to use for length_received. Maybe we can just
- // pass the value on from our caller.
- int length_received = -1;
-
data_.append(data, data_len);
if (first_received_data_) {
// Some servers don't send a boundary token before the first chunk of
@@ -132,8 +128,7 @@ void MultipartResponseDelegate::OnReceivedData(const char* data,
// Send the last data chunk.
client_->didReceiveData(loader_,
data_.data(),
- static_cast<int>(boundary_pos),
- length_received);
+ static_cast<int>(boundary_pos));
}
size_t boundary_end_pos = boundary_pos + boundary_.length();
if (boundary_end_pos < data_.length() && '-' == data_[boundary_end_pos]) {
@@ -159,13 +154,9 @@ void MultipartResponseDelegate::OnCompletedRequest() {
// If we have any pending data and we're not in a header, go ahead and send
// it to WebCore.
if (!processing_headers_ && !data_.empty()) {
- // TODO(tc): Figure out what to use for length_received. Maybe we can just
- // pass the value on from our caller.
- int length_received = -1;
client_->didReceiveData(loader_,
data_.data(),
- static_cast<int>(data_.length()),
- length_received);
+ static_cast<int>(data_.length()));
}
}