summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authoreustas@chromium.org <eustas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-10 12:54:57 +0000
committereustas@chromium.org <eustas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-10 12:54:57 +0000
commitc8c56758c394793fd106f6607b50f0966976e135 (patch)
treef75a94538866b7b68dfa5a7217e61a2fdae859d5 /webkit
parentfd00e49adcf05f05a5cff215abed207e738c606c (diff)
downloadchromium_src-c8c56758c394793fd106f6607b50f0966976e135.zip
chromium_src-c8c56758c394793fd106f6607b50f0966976e135.tar.gz
chromium_src-c8c56758c394793fd106f6607b50f0966976e135.tar.bz2
Add transfer size paramater to didFinishLoading [2/3]
Mini DD: https://docs.google.com/a/chromium.org/document/d/1kAKnBKofLc3Tex_JPveubwJcQLT3BhIL3xNQyjvRIps/edit?usp=sharing Most of files contain only signature changes. There are 3 non-trivial changes: 1) ResourceMsg_RequestComplete IPC message receives struct instead of distinct parameters. 2) Use URLRequest::GetTotalReceivedBytes instead of DevToolsNetLogObserver::GetAndResetEncodedDataLength 3) Remove unused code in DevToolsNetLogObserver. BUG=111052 Review URL: https://codereview.chromium.org/143263002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250069 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/child/multipart_response_delegate_unittest.cc3
-rw-r--r--webkit/child/resource_loader_bridge.h9
-rw-r--r--webkit/child/weburlloader_impl.cc11
3 files changed, 13 insertions, 10 deletions
diff --git a/webkit/child/multipart_response_delegate_unittest.cc b/webkit/child/multipart_response_delegate_unittest.cc
index 4bfa6ab..58c92c5e 100644
--- a/webkit/child/multipart_response_delegate_unittest.cc
+++ b/webkit/child/multipart_response_delegate_unittest.cc
@@ -75,7 +75,8 @@ class MockWebURLLoaderClient : public WebURLLoaderClient {
data_.append(data, data_length);
total_encoded_data_length_ += encoded_data_length;
}
- virtual void didFinishLoading(WebURLLoader*, double finishTime) {}
+ virtual void didFinishLoading(
+ WebURLLoader*, double finishTime, int64_t total_encoded_data_length) {}
virtual void didFail(WebURLLoader*, const WebURLError&) {}
void Reset() {
diff --git a/webkit/child/resource_loader_bridge.h b/webkit/child/resource_loader_bridge.h
index ac8d1fa..2a54d616 100644
--- a/webkit/child/resource_loader_bridge.h
+++ b/webkit/child/resource_loader_bridge.h
@@ -155,16 +155,14 @@ class ResourceLoaderBridge {
// that case, OnReceivedData will not be called.
// The encoded_data_length is the length of the encoded data transferred
// over the network, which could be different from data length (e.g. for
- // gzipped content), or -1 if unknown. It is only valid while devtools are
- // attached. Otherwise it becomes -1.
+ // gzipped content).
virtual void OnDownloadedData(int len, int encoded_data_length) = 0;
// Called when a chunk of response data is available. This method may
// be called multiple times or not at all if an error occurs.
// The encoded_data_length is the length of the encoded data transferred
// over the network, which could be different from data length (e.g. for
- // gzipped content), or -1 if unknown. It is only valid while devtools are
- // attached. Otherwise it becomes -1.
+ // gzipped content).
virtual void OnReceivedData(const char* data,
int data_length,
int encoded_data_length) = 0;
@@ -180,7 +178,8 @@ class ResourceLoaderBridge {
bool was_ignored_by_handler,
bool stale_copy_in_cache,
const std::string& security_info,
- const base::TimeTicks& completion_time) = 0;
+ const base::TimeTicks& completion_time,
+ int64 total_transfer_size) = 0;
protected:
virtual ~Peer() {}
diff --git a/webkit/child/weburlloader_impl.cc b/webkit/child/weburlloader_impl.cc
index 64f91ab..fb805a5 100644
--- a/webkit/child/weburlloader_impl.cc
+++ b/webkit/child/weburlloader_impl.cc
@@ -247,7 +247,8 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>,
bool was_ignored_by_handler,
bool stale_copy_in_cache,
const std::string& security_info,
- const base::TimeTicks& completion_time) OVERRIDE;
+ const base::TimeTicks& completion_time,
+ int64 total_transfer_size) OVERRIDE;
private:
friend class base::RefCounted<Context>;
@@ -601,7 +602,8 @@ void WebURLLoaderImpl::Context::OnCompletedRequest(
bool was_ignored_by_handler,
bool stale_copy_in_cache,
const std::string& security_info,
- const base::TimeTicks& completion_time) {
+ const base::TimeTicks& completion_time,
+ int64 total_transfer_size) {
if (ftp_listing_delegate_) {
ftp_listing_delegate_->OnCompletedRequest();
ftp_listing_delegate_.reset(NULL);
@@ -622,7 +624,8 @@ void WebURLLoaderImpl::Context::OnCompletedRequest(
error_code));
} else {
client_->didFinishLoading(
- loader_, (completion_time - TimeTicks()).InSecondsF());
+ loader_, (completion_time - TimeTicks()).InSecondsF(),
+ total_transfer_size);
}
}
@@ -674,7 +677,7 @@ void WebURLLoaderImpl::Context::HandleDataURL() {
}
OnCompletedRequest(error_code, false, false, info.security_info,
- base::TimeTicks::Now());
+ base::TimeTicks::Now(), 0);
}
// WebURLLoaderImpl -----------------------------------------------------------