summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 19:54:57 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-12 19:54:57 +0000
commit89c7ed00c4d37c0b917d4a681d94d6a4ce782c33 (patch)
treea5fe16a1fcbed0acb5a111830fc7d2b3c4ca8fba /webkit/glue
parent4a66920f66fe2c5db40f4e8c0efa9cb5d7bebfcb (diff)
downloadchromium_src-89c7ed00c4d37c0b917d4a681d94d6a4ce782c33.zip
chromium_src-89c7ed00c4d37c0b917d4a681d94d6a4ce782c33.tar.gz
chromium_src-89c7ed00c4d37c0b917d4a681d94d6a4ce782c33.tar.bz2
WebKit resource requests now have a flag reportUploadProgress that tells us whether we should turn on the reporting of upload progress updates.
This CL adds plumbing in the SimpleResourceLoader for reporting upload progress updates, as is already done in ResourceDispatcherHost. This makes 3 layout tests (XMLHttpRequest related) pass. BUG=None TEST=Run the layout tests. Review URL: http://codereview.chromium.org/28341 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11567 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/resource_handle_impl.cc9
-rw-r--r--webkit/glue/resource_loader_bridge.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/webkit/glue/resource_handle_impl.cc b/webkit/glue/resource_handle_impl.cc
index dbc8606..961e788 100644
--- a/webkit/glue/resource_handle_impl.cc
+++ b/webkit/glue/resource_handle_impl.cc
@@ -222,6 +222,7 @@ class ResourceHandleInternal : public ResourceLoaderBridge::Peer {
void SetDefersLoading(bool value);
// ResourceLoaderBridge::Peer implementation
+ virtual void OnUploadProgress(uint64 position, uint64 size);
virtual void OnReceivedRedirect(const GURL& new_url);
virtual void OnReceivedResponse(
const ResourceLoaderBridge::ResponseInfo& info,
@@ -358,6 +359,9 @@ bool ResourceHandleInternal::Start(
break;
}
+ if (request_.reportUploadProgress())
+ load_flags_ |= net::LOAD_ENABLE_UPLOAD_PROGRESS;
+
// Translate the table of request headers to a formatted string blob
String headerBuf;
const HTTPHeaderMap& headerMap = request_.httpHeaderFields();
@@ -511,6 +515,11 @@ void ResourceHandleInternal::SetDefersLoading(bool value) {
// ResourceLoaderBridge::Peer impl --------------------------------------------
+void ResourceHandleInternal::OnUploadProgress(uint64 position, uint64 size) {
+ if (client_)
+ client_->didSendData(job_, position, size);
+}
+
void ResourceHandleInternal::OnReceivedRedirect(const GURL& new_url) {
DCHECK(pending_);
diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h
index d5ca181..8d32f0c 100644
--- a/webkit/glue/resource_loader_bridge.h
+++ b/webkit/glue/resource_loader_bridge.h
@@ -93,7 +93,7 @@ class ResourceLoaderBridge {
// Called as upload progress is made.
// note: only for requests with LOAD_ENABLE_UPLOAD_PROGRESS set
- virtual void OnUploadProgress(uint64 position, uint64 size) {};
+ virtual void OnUploadProgress(uint64 position, uint64 size) = 0;
// Called when a redirect occurs.
virtual void OnReceivedRedirect(const GURL& new_url) = 0;