void DocumentLoader::setupForReplaceByMIMEType(const String& newMIMEType) { if (!mainResourceData()) return; String oldMIMEType = m_response.mimeType(); if (!doesProgressiveLoad(oldMIMEType)) { frameLoader()->client()->revertToProvisionalState(this); setupForReplace(); RefPtr<SharedBuffer> resourceData = mainResourceData(); commitLoad(resourceData->data(), resourceData->size()); } maybeCreateArchive(); m_writer.end(); frameLoader()->setReplacing(); m_gotFirstByte = false; if (doesProgressiveLoad(newMIMEType)) { frameLoader()->client()->revertToProvisionalState(this); setupForReplace(); } stopLoadingSubresources(); stopLoadingPlugIns(); #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML) clearArchiveResources(); #endif }
void DocumentLoader::finishedLoading(double finishTime) { DCHECK(m_frame->loader().stateMachine()->creatingInitialEmptyDocument() || !m_frame->page()->defersLoading() || InspectorInstrumentation::isDebuggerPaused(m_frame)); double responseEndTime = finishTime; if (!responseEndTime) responseEndTime = m_timeOfLastDataReceived; if (!responseEndTime) responseEndTime = monotonicallyIncreasingTime(); timing().setResponseEnd(responseEndTime); commitIfReady(); if (!frameLoader()) return; if (!maybeCreateArchive()) { // If this is an empty document, it will not have actually been created yet. // Commit dummy data so that DocumentWriter::begin() gets called and creates // the Document. if (!m_writer) commitData(0, 0); } if (!m_frame) return; m_applicationCacheHost->finishedLoadingMainResource(); endWriting(); if (m_state < MainResourceDone) m_state = MainResourceDone; clearMainResourceHandle(); }
void DocumentLoader::setupForReplace() { if (!mainResourceData()) return; maybeFinishLoadingMultipartContent(); maybeCreateArchive(); m_writer.end(); frameLoader()->setReplacing(); m_gotFirstByte = false; stopLoadingSubresources(); stopLoadingPlugIns(); #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML) clearArchiveResources(); #endif }
void DocumentLoader::finishedLoading(double finishTime) { ASSERT(!m_frame->page()->defersLoading() || InspectorInstrumentation::isDebuggerPaused(m_frame)); RefPtr<DocumentLoader> protect(this); if (m_identifierForLoadWithoutResourceLoader) { frameLoader()->notifier()->dispatchDidFinishLoading(this, m_identifierForLoadWithoutResourceLoader, finishTime); m_identifierForLoadWithoutResourceLoader = 0; } double responseEndTime = finishTime; if (!responseEndTime) responseEndTime = m_timeOfLastDataReceived; if (!responseEndTime) responseEndTime = monotonicallyIncreasingTime(); timing()->setResponseEnd(responseEndTime); commitIfReady(); if (!frameLoader()) return; if (!maybeCreateArchive()) { // If this is an empty document, it will not have actually been created yet. Commit dummy data so that // DocumentWriter::begin() gets called and creates the Document. if (!m_gotFirstByte) commitData(0, 0); frameLoader()->client()->finishedLoading(this); } m_writer.end(); if (!m_mainDocumentError.isNull()) return; clearMainResourceLoader(); if (!frameLoader()->stateMachine()->creatingInitialEmptyDocument()) frameLoader()->checkLoadComplete(); // If the document specified an application cache manifest, it violates the author's intent if we store it in the memory cache // and deny the appcache the chance to intercept it in the future, so remove from the memory cache. if (m_frame) { if (m_mainResource && m_frame->document()->hasManifest()) memoryCache()->remove(m_mainResource.get()); } m_applicationCacheHost->finishedLoadingMainResource(); clearMainResourceHandle(); }
void DocumentLoader::finishedLoading() { commitIfReady(); if (!frameLoader() || frameLoader()->stateMachine()->creatingInitialEmptyDocument()) return; if (!maybeCreateArchive()) { // If this is an empty document, it will not have actually been created yet. Commit dummy data so that // DocumentWriter::begin() gets called and creates the Document. if (!m_gotFirstByte) commitData(0, 0); frameLoader()->client()->finishedLoading(this); } m_writer.end(); if (!m_mainDocumentError.isNull()) return; clearMainResourceLoader(); frameLoader()->checkLoadComplete(); }