diff options
author | vsevik@chromium.org <vsevik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-08 18:52:10 +0000 |
---|---|---|
committer | vsevik@chromium.org <vsevik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-08 18:52:10 +0000 |
commit | 8bd0de7e38b1f56b00e2ee8c2680b9306ede5eee (patch) | |
tree | fa146e5937db671b67ba8a425e0fcc9448d98a8d /webkit/glue/weburlloader_impl.cc | |
parent | 776c05d1347784290de3751bb753439204247591 (diff) | |
download | chromium_src-8bd0de7e38b1f56b00e2ee8c2680b9306ede5eee.zip chromium_src-8bd0de7e38b1f56b00e2ee8c2680b9306ede5eee.tar.gz chromium_src-8bd0de7e38b1f56b00e2ee8c2680b9306ede5eee.tar.bz2 |
Enabled actual transfer size in chromium
BUG=40502
TEST=Open DevTools, open site having gzip/chunked encoding, ensure transfer size is correct.
Review URL: http://codereview.chromium.org/6771043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80965 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/weburlloader_impl.cc')
-rw-r--r-- | webkit/glue/weburlloader_impl.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc index 2c0659a..c3d79be 100644 --- a/webkit/glue/weburlloader_impl.cc +++ b/webkit/glue/weburlloader_impl.cc @@ -157,6 +157,7 @@ bool GetInfoFromDataURL(const GURL& url, info->charset.swap(charset); info->security_info.clear(); info->content_length = -1; + info->raw_data_length = 0; info->load_timing.base_time = Time::Now(); return true; @@ -295,7 +296,9 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>, GURL* new_first_party_for_cookies); virtual void OnReceivedResponse(const ResourceResponseInfo& info); virtual void OnDownloadedData(int len); - virtual void OnReceivedData(const char* data, int len); + virtual void OnReceivedData(const char* data, + int data_length, + int raw_data_length); virtual void OnReceivedCachedMetadata(const char* data, int len); virtual void OnCompletedRequest(const net::URLRequestStatus& status, const std::string& security_info, @@ -591,23 +594,25 @@ void WebURLLoaderImpl::Context::OnDownloadedData(int len) { client_->didDownloadData(loader_, len); } -void WebURLLoaderImpl::Context::OnReceivedData(const char* data, int len) { +void WebURLLoaderImpl::Context::OnReceivedData(const char* data, + int data_length, + int raw_data_length) { if (!client_) return; // Temporary logging, see site_isolation_metrics.h/cc. - SiteIsolationMetrics::SniffCrossOriginHTML(response_url_, data, len); + SiteIsolationMetrics::SniffCrossOriginHTML(response_url_, data, data_length); if (ftp_listing_delegate_.get()) { // The FTP listing delegate will make the appropriate calls to // client_->didReceiveData and client_->didReceiveResponse. - ftp_listing_delegate_->OnReceivedData(data, len); + ftp_listing_delegate_->OnReceivedData(data, data_length); } else if (multipart_delegate_.get()) { // The multipart delegate will make the appropriate calls to // client_->didReceiveData and client_->didReceiveResponse. - multipart_delegate_->OnReceivedData(data, len); + multipart_delegate_->OnReceivedData(data, data_length, raw_data_length); } else { - client_->didReceiveData(loader_, data, len, -1); + client_->didReceiveData(loader_, data, data_length, raw_data_length); } } @@ -694,7 +699,7 @@ void WebURLLoaderImpl::Context::HandleDataURL() { if (GetInfoFromDataURL(request_.url(), &info, &data, &status)) { OnReceivedResponse(info); if (!data.empty()) - OnReceivedData(data.data(), data.size()); + OnReceivedData(data.data(), data.size(), 0); } OnCompletedRequest(status, info.security_info, base::Time::Now()); |