OLD | NEW |
---|---|
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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
741 { | 741 { |
742 ASSERT_UNUSED(writer, m_writer == writer); | 742 ASSERT_UNUSED(writer, m_writer == writer); |
743 m_writer->end(); | 743 m_writer->end(); |
744 m_writer.clear(); | 744 m_writer.clear(); |
745 } | 745 } |
746 | 746 |
747 PassRefPtrWillBeRawPtr<DocumentWriter> DocumentLoader::createWriterFor(const Doc ument* ownerDocument, const DocumentInit& init, const AtomicString& mimeType, co nst AtomicString& encoding, bool dispatch, ParserSynchronizationPolicy parsingPo licy) | 747 PassRefPtrWillBeRawPtr<DocumentWriter> DocumentLoader::createWriterFor(const Doc ument* ownerDocument, const DocumentInit& init, const AtomicString& mimeType, co nst AtomicString& encoding, bool dispatch, ParserSynchronizationPolicy parsingPo licy) |
748 { | 748 { |
749 LocalFrame* frame = init.frame(); | 749 LocalFrame* frame = init.frame(); |
750 | 750 |
751 if (frame->document()) | 751 if (frame->document()) { |
dcheng
2015/04/03 14:35:45
When creating the initial empty page, I believe th
| |
752 frame->document()->prepareForDestruction(); | 752 ASSERT(!frame->document()->isActive()); |
753 } | |
754 ASSERT(frame->tree().childCount() == 0); | |
753 | 755 |
754 if (!init.shouldReuseDefaultView()) | 756 if (!init.shouldReuseDefaultView()) |
755 frame->setDOMWindow(LocalDOMWindow::create(*frame)); | 757 frame->setDOMWindow(LocalDOMWindow::create(*frame)); |
756 | 758 |
757 RefPtrWillBeRawPtr<Document> document = frame->localDOMWindow()->installNewD ocument(mimeType, init); | 759 RefPtrWillBeRawPtr<Document> document = frame->localDOMWindow()->installNewD ocument(mimeType, init); |
758 if (ownerDocument) { | 760 if (ownerDocument) { |
759 document->setCookieURL(ownerDocument->cookieURL()); | 761 document->setCookieURL(ownerDocument->cookieURL()); |
760 document->setSecurityOrigin(ownerDocument->securityOrigin()); | 762 document->setSecurityOrigin(ownerDocument->securityOrigin()); |
761 if (ownerDocument->isTransitionDocument()) | 763 if (ownerDocument->isTransitionDocument()) |
762 document->setIsTransitionDocument(true); | 764 document->setIsTransitionDocument(true); |
(...skipping 20 matching lines...) Expand all Loading... | |
783 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() | 785 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() |
784 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) | 786 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) |
785 { | 787 { |
786 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); | 788 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); |
787 if (!source.isNull()) | 789 if (!source.isNull()) |
788 m_writer->appendReplacingData(source); | 790 m_writer->appendReplacingData(source); |
789 endWriting(m_writer.get()); | 791 endWriting(m_writer.get()); |
790 } | 792 } |
791 | 793 |
792 } // namespace blink | 794 } // namespace blink |
OLD | NEW |