| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 } | 101 } |
| 102 | 102 |
| 103 ResourceLoader* DocumentLoader::mainResourceLoader() const | 103 ResourceLoader* DocumentLoader::mainResourceLoader() const |
| 104 { | 104 { |
| 105 return m_mainResource ? m_mainResource->loader() : 0; | 105 return m_mainResource ? m_mainResource->loader() : 0; |
| 106 } | 106 } |
| 107 | 107 |
| 108 DocumentLoader::~DocumentLoader() | 108 DocumentLoader::~DocumentLoader() |
| 109 { | 109 { |
| 110 ASSERT(!m_frame || !isLoading()); | 110 ASSERT(!m_frame || !isLoading()); |
| 111 static_cast<FrameFetchContext&>(m_fetcher->context()).clearDocumentLoader(); | |
| 112 clearMainResourceHandle(); | 111 clearMainResourceHandle(); |
| 113 m_applicationCacheHost->dispose(); | 112 m_applicationCacheHost->dispose(); |
| 114 } | 113 } |
| 115 | 114 |
| 116 unsigned long DocumentLoader::mainResourceIdentifier() const | 115 unsigned long DocumentLoader::mainResourceIdentifier() const |
| 117 { | 116 { |
| 118 return m_mainResource ? m_mainResource->identifier() : 0; | 117 return m_mainResource ? m_mainResource->identifier() : 0; |
| 119 } | 118 } |
| 120 | 119 |
| 121 Document* DocumentLoader::document() const | 120 Document* DocumentLoader::document() const |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 void DocumentLoader::detachFromFrame() | 555 void DocumentLoader::detachFromFrame() |
| 557 { | 556 { |
| 558 ASSERT(m_frame); | 557 ASSERT(m_frame); |
| 559 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame); | 558 RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame); |
| 560 RefPtr<DocumentLoader> protectLoader(this); | 559 RefPtr<DocumentLoader> protectLoader(this); |
| 561 | 560 |
| 562 // 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 |
| 563 // 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. |
| 564 stopLoading(); | 563 stopLoading(); |
| 565 | 564 |
| 565 m_fetcher->clearContext(); |
| 566 m_applicationCacheHost->setApplicationCache(0); | 566 m_applicationCacheHost->setApplicationCache(0); |
| 567 WeakIdentifierMap<DocumentLoader>::notifyObjectDestroyed(this); | 567 WeakIdentifierMap<DocumentLoader>::notifyObjectDestroyed(this); |
| 568 m_frame = 0; | 568 m_frame = 0; |
| 569 } | 569 } |
| 570 | 570 |
| 571 void DocumentLoader::clearMainResourceLoader() | 571 void DocumentLoader::clearMainResourceLoader() |
| 572 { | 572 { |
| 573 m_loadingMainResource = false; | 573 m_loadingMainResource = false; |
| 574 } | 574 } |
| 575 | 575 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR
L() | 784 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR
L() |
| 785 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn
it& init, const String& source, Document* ownerDocument) | 785 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn
it& init, const String& source, Document* ownerDocument) |
| 786 { | 786 { |
| 787 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); | 787 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri
ter->encoding() : emptyAtom, true, ForceSynchronousParsing); |
| 788 if (!source.isNull()) | 788 if (!source.isNull()) |
| 789 m_writer->appendReplacingData(source); | 789 m_writer->appendReplacingData(source); |
| 790 endWriting(m_writer.get()); | 790 endWriting(m_writer.get()); |
| 791 } | 791 } |
| 792 | 792 |
| 793 } // namespace blink | 793 } // namespace blink |
| OLD | NEW |