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

Unified Diff: Source/WebCore/loader/DocumentWriter.cpp

Issue 8083016: Merge 96260 - JavaScript generated documents don't inherit the cookie URL (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 3 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') | no next file » | 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 96367)
+++ Source/WebCore/loader/DocumentWriter.cpp (working copy)
@@ -67,7 +67,7 @@
void DocumentWriter::replaceDocument(const String& source)
{
m_frame->loader()->stopAllLoaders();
- begin(m_frame->document()->url(), true, m_frame->document()->securityOrigin());
+ begin(m_frame->document()->url(), true, InheritSecurityOrigin);
if (!source.isNull()) {
if (!m_hasReceivedSomeData) {
@@ -106,11 +106,9 @@
return DOMImplementation::createDocument(m_mimeType, m_frame, url, m_frame->inViewSourceMode());
}
-void DocumentWriter::begin(const KURL& urlReference, bool dispatch, SecurityOrigin* origin)
+void DocumentWriter::begin(const KURL& urlReference, bool dispatch, SecurityOriginSource originSource)
{
- // We need to take a reference to the security origin because |clear|
- // might destroy the document that owns it.
- RefPtr<SecurityOrigin> forcedSecurityOrigin = origin;
+ 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.
@@ -139,8 +137,10 @@
if (m_decoder)
document->setDecoder(m_decoder.get());
- if (forcedSecurityOrigin)
- document->setSecurityOrigin(forcedSecurityOrigin.get());
+ if (originSource == InheritSecurityOrigin) {
+ document->setCookieURL(oldDocument->cookieURL());
+ document->setSecurityOrigin(oldDocument->securityOrigin());
+ }
m_frame->domWindow()->setURL(document->url());
m_frame->domWindow()->setSecurityOrigin(document->securityOrigin());
« no previous file with comments | « Source/WebCore/loader/DocumentWriter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698