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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 1675473002: Update V8 security token correctly when installing a new Document. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 738
739 ASSERT(!frame->document() || !frame->document()->isActive()); 739 ASSERT(!frame->document() || !frame->document()->isActive());
740 ASSERT(frame->tree().childCount() == 0); 740 ASSERT(frame->tree().childCount() == 0);
741 741
742 if (!init.shouldReuseDefaultView()) 742 if (!init.shouldReuseDefaultView())
743 frame->setDOMWindow(LocalDOMWindow::create(*frame)); 743 frame->setDOMWindow(LocalDOMWindow::create(*frame));
744 744
745 RefPtrWillBeRawPtr<Document> document = frame->localDOMWindow()->installNewD ocument(mimeType, init); 745 RefPtrWillBeRawPtr<Document> document = frame->localDOMWindow()->installNewD ocument(mimeType, init);
746 if (ownerDocument) { 746 if (ownerDocument) {
747 document->setCookieURL(ownerDocument->cookieURL()); 747 document->setCookieURL(ownerDocument->cookieURL());
748 document->setSecurityOrigin(ownerDocument->securityOrigin()); 748 document->updateSecurityOrigin(ownerDocument->securityOrigin());
749 } 749 }
750 750
751 frame->loader().didBeginDocument(dispatch); 751 frame->loader().didBeginDocument(dispatch);
752 752
753 return DocumentWriter::create(document.get(), parsingPolicy, mimeType, encod ing); 753 return DocumentWriter::create(document.get(), parsingPolicy, mimeType, encod ing);
754 } 754 }
755 755
756 const AtomicString& DocumentLoader::mimeType() const 756 const AtomicString& DocumentLoader::mimeType() const
757 { 757 {
758 if (m_writer) 758 if (m_writer)
759 return m_writer->mimeType(); 759 return m_writer->mimeType();
760 return m_response.mimeType(); 760 return m_response.mimeType();
761 } 761 }
762 762
763 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() 763 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L()
764 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) 764 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument)
765 { 765 {
766 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); 766 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing);
767 if (!source.isNull()) 767 if (!source.isNull())
768 m_writer->appendReplacingData(source); 768 m_writer->appendReplacingData(source);
769 endWriting(m_writer.get()); 769 endWriting(m_writer.get());
770 } 770 }
771 771
772 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 772 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
773 773
774 } // namespace blink 774 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698