Fix WebURLLoaderImpl::Context leak if a pending request is canceled.
commitba355df173b3270c61fe4ea1e4dc1b442d723612
authorkcwu@chromium.org <kcwu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 30 Apr 2014 14:46:14 +0000 (30 14:46 +0000)
committerkcwu@chromium.org <kcwu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Wed, 30 Apr 2014 14:46:14 +0000 (30 14:46 +0000)
tree89f6d4712ebbd776e6220363641339aa023fc535
parenta501c1d1040bc3e9db0b9e03435bc0be8ce8daf0
Fix WebURLLoaderImpl::Context leak if a pending request is canceled.

Now, ResourceDispatcher::CancelPendingRequest will send
ResourceHostMsg_CancelRequest and trigger OnRequestComplete. However,
the request is pending and thus OnRequestComplete will be queued.

There are at least two problems if OnRequestComplete is not called:
1. WebURLLoaderImpl::Context will never be released.
2. request_info->buffer leaks. The buffer holds shared memory handle
   (file descriptor). fd leaking may lead to HW video decode failure on
   ChromeOS (detail in chrome-os-partner:27911#63)

This issue is similar to issue 328092.

BUG=chrome-os-partner:27911
R=jam@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267206 0039d316-1c4b-4281-b951-d872f2087c98
content/child/resource_dispatcher.cc
content/child/resource_dispatcher.h