diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-24 18:40:02 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-24 18:40:02 +0000 |
commit | 1f06ba037858fdbef94c37cdacccb56aa1e72b32 (patch) | |
tree | 3a9deeca06c3cdfcb9b15a88515dd7c565ff907f /webkit | |
parent | cd20e924b7103c66da8299c3eaa15f5900ae1de8 (diff) | |
download | chromium_src-1f06ba037858fdbef94c37cdacccb56aa1e72b32.zip chromium_src-1f06ba037858fdbef94c37cdacccb56aa1e72b32.tar.gz chromium_src-1f06ba037858fdbef94c37cdacccb56aa1e72b32.tar.bz2 |
Fixed the following layout test:
LayoutTests/http/tests/xmlhttprequest/redirect-cross-origin-post.html
The crash happens in simple_resource_loader_bridge.cc, there is a
case when MaybeUpdateUploadProgress is posted as a task and in the
queue while a redirect response by the server cancels the upload.
Leaving request_->get_upload() returns NULL, and of cource using of
the pointer failes.
Review URL: http://codereview.chromium.org/50077
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/tools/test_shell/simple_resource_loader_bridge.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc index 657e97b..a714c10 100644 --- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc +++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc @@ -320,6 +320,14 @@ class RequestProxy : public URLRequest::Delegate, // Called on the IO thread. void MaybeUpdateUploadProgress() { + // If a redirect is received upload is cancelled in URLRequest, we should + // try to stop the |upload_progress_timer_| timer and return. + if (!request_->has_upload()) { + if (upload_progress_timer_.IsRunning()) + upload_progress_timer_.Stop(); + return; + } + uint64 size = request_->get_upload()->GetContentLength(); uint64 position = request_->GetUploadProgress(); if (position == last_upload_position_) |