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

Unified Diff: content/plugin/npobject_stub.cc

Issue 7792007: NULL nobject_ in the stub prior to deallocating the object, to avoid re-entrancy into NPObjectStu... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 4 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: content/plugin/npobject_stub.cc
===================================================================
--- content/plugin/npobject_stub.cc (revision 98673)
+++ content/plugin/npobject_stub.cc (working copy)
@@ -116,9 +116,16 @@
if (npobject_) {
channel_->RemoveMappingForNPObjectStub(route_id_, npobject_);
+
+ // We need to NULL npobject_ prior to calling releaseObject() to avoid
+ // problems with re-entrancy. See http://crbug.com/94179#c17 for more
+ // details on how this can happen.
+ NPObject* npobject = npobject_;
+ npobject_ = NULL;
+
if (release_npobject)
- WebBindings::releaseObject(npobject_);
- npobject_ = NULL;
+ WebBindings::releaseObject(npobject);
+
MessageLoop::current()->PostTask(
FROM_HERE,
NewRunnableFunction(
« 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