diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 23:25:04 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-29 23:25:04 +0000 |
commit | dba635a4500b6f345d1bd7639d5e7144e037e11f (patch) | |
tree | 2a7e6a575038ecf4e82d22851f4cedb57d7f2409 /chrome/common/resource_dispatcher.h | |
parent | 45e71eff71b7e4310f9cd731a7251b3b90090c84 (diff) | |
download | chromium_src-dba635a4500b6f345d1bd7639d5e7144e037e11f.zip chromium_src-dba635a4500b6f345d1bd7639d5e7144e037e11f.tar.gz chromium_src-dba635a4500b6f345d1bd7639d5e7144e037e11f.tar.bz2 |
When cancelling a pending request, release any outstanding SharedIOBuffer
objects and their associated shared memory segments. This avoids a shared
memory leak and file descriptor leak.
BUG=38383
TEST=Using test_chrome_fd_leak from bug 38383 and lsof, the renderer process
should not show an fd leak on Mac or Linux.
Review URL: http://codereview.chromium.org/1703017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46007 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/resource_dispatcher.h')
-rw-r--r-- | chrome/common/resource_dispatcher.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h index 92234f3..ab5ab81 100644 --- a/chrome/common/resource_dispatcher.h +++ b/chrome/common/resource_dispatcher.h @@ -72,7 +72,6 @@ class ResourceDispatcher { resource_type(resource_type), filter_policy(FilterPolicy::DONT_FILTER), is_deferred(false), - is_cancelled(false), url(request_url) { } ~PendingRequestInfo() { } @@ -81,7 +80,6 @@ class ResourceDispatcher { FilterPolicy::Type filter_policy; MessageQueue deferred_message_queue; bool is_deferred; - bool is_cancelled; GURL url; }; typedef base::hash_map<int, PendingRequestInfo> PendingRequestList; @@ -122,7 +120,12 @@ class ResourceDispatcher { // handle in it that we should cleanup it up nicely. This method accepts any // message and determine whether the message is // ViewHostMsg_Resource_DataReceived and clean up the shared memory handle. - void ReleaseResourcesInDataMessage(const IPC::Message& message); + static void ReleaseResourcesInDataMessage(const IPC::Message& message); + + // Iterate through a message queue and clean up the messages by calling + // ReleaseResourcesInDataMessage and removing them from the queue. Intended + // for use on deferred message queues that are no longer needed. + static void ReleaseResourcesInMessageQueue(MessageQueue* queue); IPC::Message::Sender* message_sender_; |