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

Unified Diff: Source/WebCore/bindings/v8/V8Helpers.cpp

Issue 8493015: Merge 99311 - [V8] Null out V8NPObject::rootObject when the owning (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 1 month 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 | Source/WebCore/bindings/v8/npruntime.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/v8/V8Helpers.cpp
===================================================================
--- Source/WebCore/bindings/v8/V8Helpers.cpp (revision 99451)
+++ Source/WebCore/bindings/v8/V8Helpers.cpp (working copy)
@@ -32,6 +32,7 @@
#include "V8Helpers.h"
#include "DOMWindow.h"
+#include "Frame.h"
#include "NPV8Object.h"
#include "V8Proxy.h"
@@ -40,6 +41,9 @@
v8::Local<v8::Context> toV8Context(NPP npp, NPObject* npObject)
{
V8NPObject* object = reinterpret_cast<V8NPObject*>(npObject);
+ DOMWindow* domWindow = object->rootObject;
+ if (!domWindow || domWindow != domWindow->frame()->domWindow())
+ return v8::Local<v8::Context>();
return V8Proxy::mainWorldContext(object->rootObject->frame());
}
« no previous file with comments | « no previous file | Source/WebCore/bindings/v8/npruntime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698