Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: ppapi/proxy/ppb_flash_net_connector_proxy.cc

Issue 7067014: Don't re-enter when destroying FlashNetConnector (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_flash_net_connector_proxy.cc
diff --git a/ppapi/proxy/ppb_flash_net_connector_proxy.cc b/ppapi/proxy/ppb_flash_net_connector_proxy.cc
index f7279d35761c268d15e5c5dc919e83a78caa3e99..c5fbdc9b99f86d796b93a766c67062f9975fe77f 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)
@@ -36,7 +49,8 @@ class FlashNetConnector : public PluginResource {
}
~FlashNetConnector() {
if (callback_.func)
- PP_RunCompletionCallback(&callback_, PP_ERROR_ABORTED);
+ MessageLoop::current()->PostTask(FROM_HERE,
viettrungluu 2011/05/24 17:39:48 Nit: Our style rules apparently dictate braces for
+ new AbortCallbackTask(callback_));
}
// Resource overrides.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698