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

Unified Diff: webkit/plugins/ppapi/ppb_url_loader_impl.cc

Issue 10797037: Stale user_buffer_ pointer in PPB_URLLoader_impl after disptaching a callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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: webkit/plugins/ppapi/ppb_url_loader_impl.cc
===================================================================
--- webkit/plugins/ppapi/ppb_url_loader_impl.cc (revision 147461)
+++ webkit/plugins/ppapi/ppb_url_loader_impl.cc (working copy)
@@ -390,6 +390,8 @@
void PPB_URLLoader_Impl::FinishLoading(int32_t done_status) {
done_status_ = done_status;
+ user_buffer_ = NULL;
+ user_buffer_size_ = 0;
// If the client hasn't called any function that takes a callback since
// the initial call to Open, or called ReadResponseBody and got a
// synchronous return, then the callback will be NULL.
@@ -424,6 +426,10 @@
CHECK(main_document_loader_);
return;
}
+
+ // If |user_buffer_| was set as part of registering the callback, ensure
+ // it got cleared since the callback is now free to delete it.
+ DCHECK(!user_buffer_);
TrackedCallback::ClearAndRun(&pending_callback_, result);
}
« 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