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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 | 101 |
102 ResourceLoader* DocumentLoader::mainResourceLoader() const | 102 ResourceLoader* DocumentLoader::mainResourceLoader() const |
103 { | 103 { |
104 return m_mainResource ? m_mainResource->loader() : 0; | 104 return m_mainResource ? m_mainResource->loader() : 0; |
105 } | 105 } |
106 | 106 |
107 DocumentLoader::~DocumentLoader() | 107 DocumentLoader::~DocumentLoader() |
108 { | 108 { |
109 ASSERT(!m_frame || !isLoading()); | 109 ASSERT(!m_frame || !isLoading()); |
| 110 static_cast<FrameFetchContext&>(m_fetcher->context()).clearDocumentLoader(); |
110 clearMainResourceHandle(); | 111 clearMainResourceHandle(); |
111 m_applicationCacheHost->dispose(); | 112 m_applicationCacheHost->dispose(); |
112 } | 113 } |
113 | 114 |
114 unsigned long DocumentLoader::mainResourceIdentifier() const | 115 unsigned long DocumentLoader::mainResourceIdentifier() const |
115 { | 116 { |
116 return m_mainResource ? m_mainResource->identifier() : 0; | 117 return m_mainResource ? m_mainResource->identifier() : 0; |
117 } | 118 } |
118 | 119 |
119 Document* DocumentLoader::document() const | 120 Document* DocumentLoader::document() const |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 void DocumentLoader::detachFromFrame() | 555 void DocumentLoader::detachFromFrame() |
555 { | 556 { |
556 ASSERT(m_frame); | 557 ASSERT(m_frame); |
557 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame); | 558 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame); |
558 RefPtr<DocumentLoader> protectLoader(this); | 559 RefPtr<DocumentLoader> protectLoader(this); |
559 | 560 |
560 // It never makes sense to have a document loader that is detached from its | 561 // It never makes sense to have a document loader that is detached from its |
561 // frame have any loads active, so go ahead and kill all the loads. | 562 // frame have any loads active, so go ahead and kill all the loads. |
562 stopLoading(); | 563 stopLoading(); |
563 | 564 |
564 m_fetcher->clearContext(); | |
565 m_applicationCacheHost->setApplicationCache(0); | 565 m_applicationCacheHost->setApplicationCache(0); |
566 InspectorInstrumentation::loaderDetachedFromFrame(m_frame, this); | 566 InspectorInstrumentation::loaderDetachedFromFrame(m_frame, this); |
567 m_frame = 0; | 567 m_frame = 0; |
568 } | 568 } |
569 | 569 |
570 void DocumentLoader::clearMainResourceLoader() | 570 void DocumentLoader::clearMainResourceLoader() |
571 { | 571 { |
572 m_loadingMainResource = false; | 572 m_loadingMainResource = false; |
573 } | 573 } |
574 | 574 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |