diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 18:04:55 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 18:04:55 +0000 |
commit | 2ccdef6db7f9b14a72922e7c5cd3ad82e8662214 (patch) | |
tree | f222fec187ce6716da73758846463dc47d3f2f2b /ppapi | |
parent | 5f6f83ed0406e5c53975cb52667f7f1610e801ab (diff) | |
download | chromium_src-2ccdef6db7f9b14a72922e7c5cd3ad82e8662214.zip chromium_src-2ccdef6db7f9b14a72922e7c5cd3ad82e8662214.tar.gz chromium_src-2ccdef6db7f9b14a72922e7c5cd3ad82e8662214.tar.bz2 |
Don't re-enter when destroying FlashNetConnector
BUG=chromium-os:15439, chromium-os:15353
TEST=grooveshark with Pepper Flash
Review URL: http://codereview.chromium.org/7067014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/proxy/ppb_flash_net_connector_proxy.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/ppapi/proxy/ppb_flash_net_connector_proxy.cc b/ppapi/proxy/ppb_flash_net_connector_proxy.cc index f7279d35..45c33ee 100644 --- a/ppapi/proxy/ppb_flash_net_connector_proxy.cc +++ b/ppapi/proxy/ppb_flash_net_connector_proxy.cc @@ -26,6 +26,19 @@ void StringToNetAddress(const std::string& str, PP_Flash_NetAddress* addr) { memcpy(addr->data, str.data(), addr->size); } +class AbortCallbackTask : public Task { + public: + AbortCallbackTask(PP_CompletionCallback callback) + : callback_(callback) {} + + virtual void Run() { + PP_RunCompletionCallback(&callback_, PP_ERROR_ABORTED); + } + + private: + PP_CompletionCallback callback_; +}; + class FlashNetConnector : public PluginResource { public: FlashNetConnector(const HostResource& resource) @@ -35,8 +48,10 @@ class FlashNetConnector : public PluginResource { remote_addr_out_(NULL) { } ~FlashNetConnector() { - if (callback_.func) - PP_RunCompletionCallback(&callback_, PP_ERROR_ABORTED); + if (callback_.func) { + MessageLoop::current()->PostTask(FROM_HERE, + new AbortCallbackTask(callback_)); + } } // Resource overrides. |