示例#1
0
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();
}
示例#2
0
void DocumentLoader::dataReceived(Resource* resource, const char* data, unsigned length)
{
    ASSERT(data);
    ASSERT(length);
    ASSERT_UNUSED(resource, resource == m_mainResource);
    ASSERT(!m_response.isNull());
    ASSERT(!mainResourceLoader() || !mainResourceLoader()->defersLoading());

    // Both unloading the old page and parsing the new page may execute JavaScript which destroys the datasource
    // by starting a new load, so retain temporarily.
    RefPtrWillBeRawPtr<LocalFrame> protectFrame(m_frame);
    RefPtr<DocumentLoader> protectLoader(this);

    m_applicationCacheHost->mainResourceDataReceived(data, length);
    m_timeOfLastDataReceived = monotonicallyIncreasingTime();

    if (isArchiveMIMEType(response().mimeType()))
        return;
    commitIfReady();
    if (!frameLoader())
        return;
    commitData(data, length);

    // If we are sending data to MediaDocument, we should stop here
    // and cancel the request.
    if (m_frame && m_frame->document()->isMediaDocument())
        cancelMainResourceLoad(ResourceError::cancelledError(m_request.url()));
}
void DocumentLoader::finishedLoading()
{
    m_gotFirstByte = true;   
    commitIfReady();
    if (FrameLoader* loader = frameLoader()) {
        loader->finishedLoadingDocument(this);
        loader->end();
    }
}
void DocumentLoader::commitLoad(const char* data, int length)
{
    // Both unloading the old page and parsing the new page may execute JavaScript which destroys the datasource
    // by starting a new load, so retain temporarily.
    RefPtr<DocumentLoader> protect(this);

    commitIfReady();
    if (FrameLoader* frameLoader = DocumentLoader::frameLoader())
        frameLoader->committedLoad(this, data, length);
}
示例#5
0
void DocumentLoader::commitLoad(const char* data, int length)
{
    // Both unloading the old page and parsing the new page may execute JavaScript which destroys the datasource
    // by starting a new load, so retain temporarily.
    RefPtr<DocumentLoader> protect(this);

    commitIfReady();
    FrameLoader* frameLoader = DocumentLoader::frameLoader();
    if (!frameLoader)
        return;
    if (ArchiveFactory::isArchiveMimeType(response().mimeType()))
        return;
    frameLoader->client()->committedLoad(this, data, length);
}
示例#6
0
void DocumentLoader::finishedLoading()
{
// <lab126>
	KINDLE_BEGIN(Kindle_Debug_Resources)
		KINDLE_PRINT("\033[35mFinished Loading %s...\033[0m\n", requestURL().string().latin1().data());
	KINDLE_END()
// </lab126>
    m_gotFirstByte = true;   
    commitIfReady();
    if (FrameLoader* loader = frameLoader()) {
        loader->finishedLoadingDocument(this);
        loader->end();
    }
}
示例#7
0
void DocumentLoader::processData(const char* data, size_t length) {
  m_applicationCacheHost->mainResourceDataReceived(data, length);
  m_timeOfLastDataReceived = monotonicallyIncreasingTime();

  if (isArchiveMIMEType(response().mimeType()))
    return;
  commitIfReady();
  if (!frameLoader())
    return;
  commitData(data, length);

  // If we are sending data to MediaDocument, we should stop here and cancel the
  // request.
  if (m_frame && m_frame->document()->isMediaDocument())
    m_fetcher->stopFetching();
}
示例#8
0
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();
}
示例#9
0
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();
}