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

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

Issue 8223012: Merge 97087 - ScriptController::executeIfJavaScriptURL gets confused by synchronous frame loads (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 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
Index: Source/WebCore/bindings/ScriptControllerBase.cpp
===================================================================
--- Source/WebCore/bindings/ScriptControllerBase.cpp (revision 97088)
+++ Source/WebCore/bindings/ScriptControllerBase.cpp (working copy)
@@ -93,6 +93,7 @@
// We need to hold onto the Frame here because executing script can
// destroy the frame.
RefPtr<Frame> protector(m_frame);
+ RefPtr<Document> ownerDocument(m_frame->document());
const int javascriptSchemeLength = sizeof("javascript:") - 1;
@@ -125,7 +126,7 @@
// 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);
+ loader->writer()->replaceDocument(scriptResult, ownerDocument.get());
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698