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

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

Issue 1052993006: Refactor frame navigation/detach state cleanup to be more sane. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Minor test cleanup Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ASSERT(!frame->document() || !frame->document()->isActive());
752 frame->document()->prepareForDestruction(); 752 ASSERT(frame->tree().childCount() == 0);
753 753
754 if (!init.shouldReuseDefaultView()) 754 if (!init.shouldReuseDefaultView())
755 frame->setDOMWindow(LocalDOMWindow::create(*frame)); 755 frame->setDOMWindow(LocalDOMWindow::create(*frame));
756 756
757 RefPtrWillBeRawPtr<Document> document = frame->localDOMWindow()->installNewD ocument(mimeType, init); 757 RefPtrWillBeRawPtr<Document> document = frame->localDOMWindow()->installNewD ocument(mimeType, init);
758 if (ownerDocument) { 758 if (ownerDocument) {
759 document->setCookieURL(ownerDocument->cookieURL()); 759 document->setCookieURL(ownerDocument->cookieURL());
760 document->setSecurityOrigin(ownerDocument->securityOrigin()); 760 document->setSecurityOrigin(ownerDocument->securityOrigin());
761 if (ownerDocument->isTransitionDocument()) 761 if (ownerDocument->isTransitionDocument())
762 document->setIsTransitionDocument(true); 762 document->setIsTransitionDocument(true);
(...skipping 20 matching lines...) Expand all
783 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() 783 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L()
784 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) 784 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument)
785 { 785 {
786 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); 786 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing);
787 if (!source.isNull()) 787 if (!source.isNull())
788 m_writer->appendReplacingData(source); 788 m_writer->appendReplacingData(source);
789 endWriting(m_writer.get()); 789 endWriting(m_writer.get());
790 } 790 }
791 791
792 } // namespace blink 792 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698