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

Unified Diff: chrome_frame/urlmon_url_request.cc

Issue 456013: Fix a crash caused by a race condition between the time the UrlmonUrlRequest:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | « chrome_frame/urlmon_url_request.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/urlmon_url_request.cc
===================================================================
--- chrome_frame/urlmon_url_request.cc (revision 33288)
+++ chrome_frame/urlmon_url_request.cc (working copy)
@@ -315,18 +315,9 @@
} else {
status_.set_status(URLRequestStatus::SUCCESS);
status_.set_os_error(0);
+ ReleaseBindings();
}
- DLOG(INFO) << "OnStopBinding received for request id: " << id();
-
- // Release these variables after reporting EndRequest since we might need to
- // access their state.
- binding_.Release();
- if (bind_context_) {
- ::RevokeBindStatusCallback(bind_context_, this);
- bind_context_.Release();
- }
-
return S_OK;
}
@@ -724,8 +715,11 @@
ignore_redirect_stop_binding_error_ = false;
}
+ ReleaseBindings();
// Remove the request mapping and release the outstanding reference to us in
// the context of the UI thread.
+ // We should not access any members of the UrlmonUrlRequest object after this
+ // as the object would be deleted.
PostTask(FROM_HERE,
NewRunnableMethod(this, &UrlmonUrlRequest::EndRequestInternal));
}
@@ -803,6 +797,14 @@
return buffer.get();
}
+void UrlmonUrlRequest::ReleaseBindings() {
+ binding_.Release();
+ if (bind_context_) {
+ ::RevokeBindStatusCallback(bind_context_, this);
+ bind_context_.Release();
+ }
+}
+
//
// UrlmonUrlRequest::Cache implementation.
//
« no previous file with comments | « chrome_frame/urlmon_url_request.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698