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

Unified Diff: ppapi/proxy/udp_socket_resource_base.cc

Issue 881203002: Fix callback access in Pepper's UDP socket resource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 5 years, 11 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/udp_socket_resource_base.cc
diff --git a/ppapi/proxy/udp_socket_resource_base.cc b/ppapi/proxy/udp_socket_resource_base.cc
index b5c977c3a094a2df67f2cc44892a5a33e10150c2..97864d535b2678ccdb191cca0483b6350b69229f 100644
--- a/ppapi/proxy/udp_socket_resource_base.cc
+++ b/ppapi/proxy/udp_socket_resource_base.cc
@@ -320,6 +320,11 @@ void UDPSocketResourceBase::OnPluginMsgPushRecvResult(
void UDPSocketResourceBase::OnPluginMsgSendToReply(
const ResourceMessageReplyParams& params,
int32_t bytes_written) {
+ // This can be empty if the socket was closed, but there are still tasks
+ // to be posted for this resource.
+ if (sendto_callbacks_.empty())
+ return;
+
scoped_refptr<TrackedCallback> callback = sendto_callbacks_.front();
sendto_callbacks_.pop();
if (!TrackedCallback::IsPending(callback))
« 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