Index: ppapi/proxy/ppb_url_loader_proxy.cc |
=================================================================== |
--- ppapi/proxy/ppb_url_loader_proxy.cc (revision 75471) |
+++ ppapi/proxy/ppb_url_loader_proxy.cc (working copy) |
@@ -70,8 +70,13 @@ |
URLLoader::~URLLoader() { |
// Always need to fire completion callbacks to prevent a leak in the plugin. |
- if (current_read_callback_.func) |
- PP_RunCompletionCallback(¤t_read_callback_, PP_ERROR_ABORTED); |
+ if (current_read_callback_.func) { |
+ // TODO(brettw) the callbacks at this level should be refactored with a |
+ // more automatic tracking system like we have in the renderer. |
+ MessageLoop::current()->PostTask(FROM_HERE, NewRunnableFunction( |
+ current_read_callback_.func, current_read_callback_.user_data, |
+ static_cast<int32_t>(PP_ERROR_ABORTED))); |
+ } |
if (response_info_) |
PluginResourceTracker::GetInstance()->ReleaseResource(response_info_); |