Commit 7db7b736 authored by ckehoe@chromium.org's avatar ckehoe@chromium.org

Fixing HttpPost deletion crash

BUG=403284

Review URL: https://codereview.chromium.org/468213002

Cr-Commit-Position: refs/heads/master@{#289450}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289450 0039d316-1c4b-4281-b951-d872f2087c98
parent 6ed970c7
...@@ -350,7 +350,8 @@ void RpcHandler::RegisterResponseHandler( ...@@ -350,7 +350,8 @@ void RpcHandler::RegisterResponseHandler(
int http_status_code, int http_status_code,
const std::string& response_data) { const std::string& response_data) {
if (completed_post) { if (completed_post) {
DCHECK(pending_posts_.erase(completed_post)); int elements_erased = pending_posts_.erase(completed_post);
DCHECK(elements_erased);
delete completed_post; delete completed_post;
} }
...@@ -379,7 +380,8 @@ void RpcHandler::ReportResponseHandler(const StatusCallback& status_callback, ...@@ -379,7 +380,8 @@ void RpcHandler::ReportResponseHandler(const StatusCallback& status_callback,
int http_status_code, int http_status_code,
const std::string& response_data) { const std::string& response_data) {
if (completed_post) { if (completed_post) {
DCHECK(pending_posts_.erase(completed_post)); int elements_erased = pending_posts_.erase(completed_post);
DCHECK(elements_erased);
delete completed_post; delete completed_post;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment