diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-10 03:47:58 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-10 03:47:58 +0000 |
commit | 96fe50e3c30274d1ccb23704c9318857631c549d (patch) | |
tree | 662fe5d886c4b6a8076f202ab6b072d0d3b9c5f2 /ppapi/proxy/plugin_resource_tracker.cc | |
parent | 8ceca680b845dec367abe35dcaa9babf9730fd15 (diff) | |
download | chromium_src-96fe50e3c30274d1ccb23704c9318857631c549d.zip chromium_src-96fe50e3c30274d1ccb23704c9318857631c549d.tar.gz chromium_src-96fe50e3c30274d1ccb23704c9318857631c549d.tar.bz2 |
Keep a reference to the module when handling PPB_Flash::Navigate
This is needed because Navigate can end up destroying the last instance, but the
dispatcher is still needed to send the reply.
This also cleans up a typo in a safeguard, and an incorrect assumption.
BUG=chromium-os:15044
TEST=http://nmd.mcd06514.orl.wayport.net/index.adp?MacAddr=48%3a5D%3a60%3a77%3a53%3a2A&IpAddr=192%2e168%2e6%2e84&vsgpId=&vsgId=60982&UserAgent=&ProxyHost=
Review URL: http://codereview.chromium.org/6999006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/plugin_resource_tracker.cc')
-rw-r--r-- | ppapi/proxy/plugin_resource_tracker.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ppapi/proxy/plugin_resource_tracker.cc b/ppapi/proxy/plugin_resource_tracker.cc index 202fef3..e499bfa 100644 --- a/ppapi/proxy/plugin_resource_tracker.cc +++ b/ppapi/proxy/plugin_resource_tracker.cc @@ -161,13 +161,12 @@ void PluginResourceTracker::ReleasePluginResourceRef( resource_map_.erase(found); plugin_resource.reset(); - if (notify_browser_on_release) { - if (dispatcher) { - dispatcher->Send(new PpapiHostMsg_PPBCore_ReleaseResource( - INTERFACE_ID_PPB_CORE, host_resource)); - } else { - NOTREACHED(); - } + // dispatcher can be NULL if the plugin held on to a resource after the + // instance was destroyed. In that case the browser-side resource has + // already been freed correctly on the browser side. + if (notify_browser_on_release && dispatcher) { + dispatcher->Send(new PpapiHostMsg_PPBCore_ReleaseResource( + INTERFACE_ID_PPB_CORE, host_resource)); } } } |