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

Unified Diff: Source/WebCore/bindings/ScriptControllerBase.cpp

Issue 7158003: Merge 87959 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 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 | « LayoutTests/webarchive/loading/resources/javascript-url-iframe-crash.webarchive ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/ScriptControllerBase.cpp
===================================================================
--- Source/WebCore/bindings/ScriptControllerBase.cpp (revision 88813)
+++ Source/WebCore/bindings/ScriptControllerBase.cpp (working copy)
@@ -110,7 +110,10 @@
if (shouldReplaceDocumentIfJavaScriptURL == ReplaceDocumentIfJavaScriptURL) {
// We're still in a frame, so there should be a DocumentLoader.
ASSERT(m_frame->document()->loader());
- if (DocumentLoader* loader = m_frame->document()->loader())
+
+ // DocumentWriter::replaceDocument can cause the DocumentLoader to get deref'ed and possible destroyed,
+ // so protect it with a RefPtr.
+ if (RefPtr<DocumentLoader> loader = m_frame->document()->loader())
loader->writer()->replaceDocument(scriptResult);
}
return true;
« no previous file with comments | « LayoutTests/webarchive/loading/resources/javascript-url-iframe-crash.webarchive ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698