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

Unified Diff: Source/WebCore/loader/DocumentWriter.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
« no previous file with comments | « Source/WebCore/loader/DocumentWriter.h ('k') | Source/WebKit/chromium/src/WebFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/loader/DocumentWriter.cpp
===================================================================
--- Source/WebCore/loader/DocumentWriter.cpp (revision 97088)
+++ Source/WebCore/loader/DocumentWriter.cpp (working copy)
@@ -64,10 +64,10 @@
// This is only called by ScriptController::executeIfJavaScriptURL
// and always contains the result of evaluating a javascript: url.
// This is the <iframe src="javascript:'html'"> case.
-void DocumentWriter::replaceDocument(const String& source)
+void DocumentWriter::replaceDocument(const String& source, Document* ownerDocument)
{
m_frame->loader()->stopAllLoaders();
- begin(m_frame->document()->url(), true, InheritSecurityOrigin);
+ begin(m_frame->document()->url(), true, ownerDocument);
if (!source.isNull()) {
if (!m_hasReceivedSomeData) {
@@ -106,10 +106,8 @@
return DOMImplementation::createDocument(m_mimeType, m_frame, url, m_frame->inViewSourceMode());
}
-void DocumentWriter::begin(const KURL& urlReference, bool dispatch, SecurityOriginSource originSource)
+void DocumentWriter::begin(const KURL& urlReference, bool dispatch, Document* ownerDocument)
{
- RefPtr<Document> oldDocument = m_frame->document();
-
// We grab a local copy of the URL because it's easy for callers to supply
// a URL that will be deallocated during the execution of this function.
// For example, see <https://bugs.webkit.org/show_bug.cgi?id=66360>.
@@ -137,9 +135,9 @@
if (m_decoder)
document->setDecoder(m_decoder.get());
- if (originSource == InheritSecurityOrigin) {
- document->setCookieURL(oldDocument->cookieURL());
- document->setSecurityOrigin(oldDocument->securityOrigin());
+ if (ownerDocument) {
+ document->setCookieURL(ownerDocument->cookieURL());
+ document->setSecurityOrigin(ownerDocument->securityOrigin());
}
m_frame->domWindow()->setURL(document->url());
« no previous file with comments | « Source/WebCore/loader/DocumentWriter.h ('k') | Source/WebKit/chromium/src/WebFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698