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

Unified Diff: webkit/port/bindings/v8/v8_proxy.cpp

Issue 133001: Add missing null handle check to document wrapper caching code.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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/port/bindings/v8/v8_proxy.cpp
===================================================================
--- webkit/port/bindings/v8/v8_proxy.cpp (revision 18692)
+++ webkit/port/bindings/v8/v8_proxy.cpp (working copy)
@@ -1842,6 +1842,14 @@
}
v8::Handle<v8::Value> document_wrapper = NodeToV8Object(m_frame->document());
+
+ // If instantiation of the document wrapper fails, clear the cache
+ // and let the DOMWindow accessor handle access to the document.
+ if (document_wrapper.IsEmpty()) {
+ ClearDocumentWrapperCache();
+ return;
+ }
+
m_context->Global()->ForceSet(v8::String::New("document"),
document_wrapper,
static_cast<v8::PropertyAttribute>(v8::ReadOnly | v8::DontDelete));
« 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