当前位置: 首页>>代码示例>>C++>>正文


C++ ArchiveResource类代码示例

本文整理汇总了C++中ArchiveResource的典型用法代码示例。如果您正苦于以下问题:C++ ArchiveResource类的具体用法?C++ ArchiveResource怎么用?C++ ArchiveResource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ArchiveResource类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ASSERT

bool DocumentLoader::maybeCreateArchive()
{
    // Only the top-frame can load MHTML.
    if (m_frame->tree().parent())
        return false;

    // Give the archive machinery a crack at this document. If the MIME type is not an archive type, it will return 0.
    if (!isArchiveMIMEType(m_response.mimeType()))
        return false;

    ASSERT(m_mainResource);
    m_archive = MHTMLArchive::create(m_response.url(), m_mainResource->resourceBuffer());
    // Invalid MHTML.
    if (!m_archive || !m_archive->mainResource()) {
        m_archive.clear();
        return false;
    }

    addAllArchiveResources(m_archive.get());
    ArchiveResource* mainResource = m_archive->mainResource();

    // The origin is the MHTML file, we need to set the base URL to the document encoded in the MHTML so
    // relative URLs are resolved properly.
    ensureWriter(mainResource->mimeType(), m_archive->mainResource()->url());

    // The Document has now been created.
    document()->enforceSandboxFlags(SandboxAll);

    commitData(mainResource->data()->data(), mainResource->data()->size());
    return true;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:31,代码来源:DocumentLoader.cpp

示例2: archiveResourceForURL

ArchiveResource* DocumentLoader::archiveResourceForURL(const KURL& url) const
{
    if (!m_archiveResourceCollection)
        return 0;
        
    ArchiveResource* resource = m_archiveResourceCollection->archiveResourceForURL(url);

    return resource && !resource->shouldIgnoreWhenUnarchiving() ? resource : 0;
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:9,代码来源:DocumentLoader.cpp

示例3: addResource

// FIXME: Adding a resource directly to a DocumentLoader/ArchiveResourceCollection seems like bad design, but is API some apps rely on.
// Can we change the design in a manner that will let us deprecate that API without reducing functionality of those apps?
void ArchiveResourceCollection::addResource(ArchiveResource& resource)
{
    const KURL& url = resource.url();
    m_subresources.set(url, &resource);

    KURL cidURI = MHTMLParser::convertContentIDToURI(resource.contentID());
    if (cidURI.isValid())
        m_subresources.set(cidURI, &resource);
}
开发者ID:mtucker6784,项目名称:chromium,代码行数:11,代码来源:ArchiveResourceCollection.cpp

示例4: mainResourceData

bool DocumentLoader::maybeCreateArchive()
{
    // Give the archive machinery a crack at this document. If the MIME type is not an archive type, it will return 0.
    if (!isArchiveMIMEType(m_response.mimeType()))
        return false;

    m_archive = MHTMLArchive::create(m_response.url(), mainResourceData().get());
    ASSERT(m_archive);
    
    addAllArchiveResources(m_archive.get());
    ArchiveResource* mainResource = m_archive->mainResource();
    m_writer.setMIMEType(mainResource->mimeType());
    
    ASSERT(m_frame->document());
    commitData(mainResource->data()->data(), mainResource->data()->size());
    return true;
}
开发者ID:windyuuy,项目名称:opera,代码行数:17,代码来源:DocumentLoader.cpp

示例5: toLocalFrame

void DocumentLoader::prepareSubframeArchiveLoadIfNeeded()
{
    if (!m_frame->tree().parent() || !m_frame->tree().parent()->isLocalFrame())
        return;

    ArchiveResourceCollection* parentCollection = toLocalFrame(m_frame->tree().parent())->loader().documentLoader()->m_archiveResourceCollection.get();
    if (!parentCollection)
        return;

    m_archive = parentCollection->popSubframeArchive(m_frame->tree().uniqueName(), m_request.url());

    if (!m_archive)
        return;
    addAllArchiveResources(m_archive.get());

    ArchiveResource* mainResource = m_archive->mainResource();
    m_substituteData = SubstituteData(mainResource->data(), mainResource->mimeType(), mainResource->textEncoding(), KURL());
}
开发者ID:rzr,项目名称:blink-crosswalk,代码行数:18,代码来源:DocumentLoader.cpp

示例6: ASSERT

bool DocumentLoader::scheduleArchiveLoad(Resource* cachedResource, const ResourceRequest& request)
{
    if (!m_archive)
        return false;

    ASSERT(m_archiveResourceCollection);
    ArchiveResource* archiveResource = m_archiveResourceCollection->archiveResourceForURL(request.url());
    if (!archiveResource) {
        cachedResource->error(Resource::LoadError);
        return true;
    }

    cachedResource->setLoading(true);
    cachedResource->responseReceived(archiveResource->response(), nullptr);
    SharedBuffer* data = archiveResource->data();
    if (data)
        cachedResource->appendData(data->data(), data->size());
    cachedResource->finish();
    return true;
}
开发者ID:rzr,项目名称:blink-crosswalk,代码行数:20,代码来源:DocumentLoader.cpp

示例7: ASSERT

bool DocumentLoader::maybeCreateArchive()
{
    // Give the archive machinery a crack at this document. If the MIME type is not an archive type, it will return 0.
    if (!isArchiveMIMEType(m_response.mimeType()))
        return false;

    ASSERT(m_mainResource);
    ArchiveResource* mainResource = m_fetcher->createArchive(m_mainResource.get());
    if (!mainResource)
        return false;
    // The origin is the MHTML file, we need to set the base URL to the document encoded in the MHTML so
    // relative URLs are resolved properly.
    ensureWriter(mainResource->mimeType(), mainResource->url());

    // The Document has now been created.
    m_frame->document()->enforceSandboxFlags(SandboxAll);

    commitData(mainResource->data()->data(), mainResource->data()->size());
    return true;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:20,代码来源:DocumentLoader.cpp

示例8: mainResourceData

bool DocumentLoader::maybeCreateArchive()
{
#if !ENABLE(WEB_ARCHIVE) && !ENABLE(MHTML)
    return false;
#else
    
    // Give the archive machinery a crack at this document. If the MIME type is not an archive type, it will return 0.
    m_archive = ArchiveFactory::create(m_response.url(), mainResourceData().get(), m_response.mimeType());
    if (!m_archive)
        return false;
    
    addAllArchiveResources(m_archive.get());
    ArchiveResource* mainResource = m_archive->mainResource();
    m_parsedArchiveData = mainResource->data();
    m_writer.setMIMEType(mainResource->mimeType());
    
    ASSERT(m_frame->document());
    commitData(mainResource->data()->data(), mainResource->data()->size());
    return true;
#endif // !ENABLE(WEB_ARCHIVE) && !ENABLE(MHTML)
}
开发者ID:sanyaade-webdev,项目名称:webkit,代码行数:21,代码来源:DocumentLoader.cpp


注:本文中的ArchiveResource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。