Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: webkit/tools/test_shell/simple_resource_loader_bridge.cc

Issue 50077: Fix a layout test crash caused by simple_resource_loader_bridge.cc (Closed)
Patch Set: stop timer Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/test_shell/simple_resource_loader_bridge.cc
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
index 657e97b6aca34b990fc8c0e5f398cca6581dc462..a714c1007d4baaa7dcba317bed27da80265389b3 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_)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698