• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ platformStrategies函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: blobRegistry

BlobRegistry& blobRegistry()
{
    ASSERT(isMainThread());

    static BlobRegistry& instance = *platformStrategies()->loaderStrategy()->createBlobRegistry();
    return instance;
}
开发者ID:CannedFish,项目名称:webkitgtk,代码行数:7,代码来源:BlobRegistry.cpp


示例2: protect

void ResourceLoader::willSendRequest(ResourceRequest& request, const ResourceResponse& redirectResponse)
{
    // Protect this in this delegate method since the additional processing can do
    // anything including possibly derefing this; one example of this is Radar 3266216.
    Ref<ResourceLoader> protect(*this);

    ASSERT(!m_reachedTerminalState);

    // We need a resource identifier for all requests, even if FrameLoader is never going to see it (such as with CORS preflight requests).
    bool createdResourceIdentifier = false;
    if (!m_identifier) {
        m_identifier = m_frame->page()->progress().createUniqueIdentifier();
        createdResourceIdentifier = true;
    }

    if (m_options.sendLoadCallbacks == SendCallbacks) {
        if (createdResourceIdentifier)
            frameLoader()->notifier()->assignIdentifierToInitialRequest(m_identifier, documentLoader(), request);

        frameLoader()->notifier()->willSendRequest(this, request, redirectResponse);
    }
#if ENABLE(INSPECTOR)
    else
        InspectorInstrumentation::willSendRequest(m_frame.get(), m_identifier, m_frame->loader().documentLoader(), request, redirectResponse);
#endif

    if (!redirectResponse.isNull())
        platformStrategies()->loaderStrategy()->resourceLoadScheduler()->crossOriginRedirectReceived(this, request.url());

    m_request = request;

    if (!redirectResponse.isNull() && !m_documentLoader->isCommitted())
        frameLoader()->client().dispatchDidReceiveServerRedirectForProvisionalLoad();
}
开发者ID:webOS-ports,项目名称:webkit,代码行数:34,代码来源:ResourceLoader.cpp


示例3: ASSERT

void ResourceLoader::willSwitchToSubstituteResource()
{
    ASSERT(!m_documentLoader->isSubstituteLoadPending(this));
    platformStrategies()->loaderStrategy()->resourceLoadScheduler()->remove(this);
    if (m_handle)
        m_handle->cancel();
}
开发者ID:Wrichik1999,项目名称:webkit,代码行数:7,代码来源:ResourceLoader.cpp


示例4: resourceLoadScheduler

ResourceLoadScheduler* resourceLoadScheduler()
{
    ASSERT(isMainThread());
    static ResourceLoadScheduler* globalScheduler = 0;
    
    if (!globalScheduler) {
#if USE(PLATFORM_STRATEGIES)
        static bool isCallingOutToStrategy = false;
        
        // If we're re-entering resourceLoadScheduler() while calling out to the LoaderStrategy,
        // then the LoaderStrategy is trying to use the default resourceLoadScheduler.
        // So we'll create it here and start using it.
        if (isCallingOutToStrategy) {
            globalScheduler = new ResourceLoadScheduler;
            return globalScheduler;
        }
        
        TemporaryChange<bool> recursionGuard(isCallingOutToStrategy, true);
        globalScheduler = platformStrategies()->loaderStrategy()->resourceLoadScheduler();
#else
        globalScheduler = new ResourceLoadScheduler;
#endif
    }

    return globalScheduler;
}
开发者ID:dog-god,项目名称:iptv,代码行数:26,代码来源:ResourceLoadScheduler.cpp


示例5: localizationStrategy

static inline LocalizationStrategy* localizationStrategy()
{
    if (hasPlatformStrategies())
        return platformStrategies()->localizationStrategy();

    return &DefaultLocalizationStrategy::shared();
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:7,代码来源:LocalizedStrings.cpp


示例6: USE

PassRefPtr<StorageNamespace> StorageNamespace::localStorageNamespace(const String& path, unsigned quota)
{
#if USE(PLATFORM_STRATEGIES)
    return platformStrategies()->storageStrategy()->localStorageNamespace(path, quota);
#else
    return StorageNamespaceImpl::localStorageNamespace(path, quota);
#endif
}
开发者ID:fmalita,项目名称:webkit,代码行数:8,代码来源:StorageNamespace.cpp


示例7: notifyCookiesChangedOnMainThread

static void notifyCookiesChangedOnMainThread(void*)
{
    ASSERT(isMainThread());

#if USE(PLATFORM_STRATEGIES)
    platformStrategies()->cookiesStrategy()->notifyCookiesChanged();
#endif
}
开发者ID:1833183060,项目名称:wke,代码行数:8,代码来源:CookieStorageCFNet.cpp


示例8: addVisitedLink

static inline void addVisitedLink(Page* page, const KURL& url)
{
#if USE(PLATFORM_STRATEGIES)
    platformStrategies()->visitedLinkStrategy()->addVisitedLink(page, visitedLinkHash(url.string().characters(), url.string().length()));
#else
    page->group().addVisitedLink(url);
#endif
}
开发者ID:gobihun,项目名称:webkit,代码行数:8,代码来源:HistoryController.cpp


示例9: protect

void ResourceLoader::willSendRequestInternal(ResourceRequest& request, const ResourceResponse& redirectResponse)
{
    // Protect this in this delegate method since the additional processing can do
    // anything including possibly derefing this; one example of this is Radar 3266216.
    Ref<ResourceLoader> protect(*this);

    ASSERT(!m_reachedTerminalState);
#if ENABLE(CONTENT_EXTENSIONS)
    ASSERT(m_resourceType != ResourceType::Invalid);
#endif

    // We need a resource identifier for all requests, even if FrameLoader is never going to see it (such as with CORS preflight requests).
    bool createdResourceIdentifier = false;
    if (!m_identifier) {
        m_identifier = m_frame->page()->progress().createUniqueIdentifier();
        createdResourceIdentifier = true;
    }

#if ENABLE(CONTENT_EXTENSIONS)
    if (frameLoader()) {
        Page* page = frameLoader()->frame().page();
        if (page && m_documentLoader) {
            auto* userContentController = page->userContentController();
            if (userContentController)
                userContentController->processContentExtensionRulesForLoad(*page, request, m_resourceType, *m_documentLoader);
        }
    }
#endif

    if (request.isNull()) {
        didFail(cannotShowURLError());
        return;
    }

    if (m_options.sendLoadCallbacks() == SendCallbacks) {
        if (createdResourceIdentifier)
            frameLoader()->notifier().assignIdentifierToInitialRequest(m_identifier, documentLoader(), request);

#if PLATFORM(IOS)
        // If this ResourceLoader was stopped as a result of assignIdentifierToInitialRequest, bail out
        if (m_reachedTerminalState)
            return;
#endif

        frameLoader()->notifier().willSendRequest(this, request, redirectResponse);
    }
    else
        InspectorInstrumentation::willSendRequest(m_frame.get(), m_identifier, m_frame->loader().documentLoader(), request, redirectResponse);

    if (!redirectResponse.isNull())
        platformStrategies()->loaderStrategy()->resourceLoadScheduler()->crossOriginRedirectReceived(this, request.url());

    m_request = request;

    if (!redirectResponse.isNull() && !m_documentLoader->isCommitted())
        frameLoader()->client().dispatchDidReceiveServerRedirectForProvisionalLoad();
}
开发者ID:JoKaWare,项目名称:webkit,代码行数:57,代码来源:ResourceLoader.cpp


示例10: platformStrategies

PostResolutionCallbackDisabler::PostResolutionCallbackDisabler(Document& document)
{
    ++resolutionNestingDepth;

    if (resolutionNestingDepth == 1)
        platformStrategies()->loaderStrategy()->suspendPendingRequests();

    // FIXME: It's strange to build this into the disabler.
    suspendMemoryCacheClientCalls(document);
}
开发者ID:edcwconan,项目名称:webkit,代码行数:10,代码来源:StyleTreeResolver.cpp


示例11: platformStrategies

void ResourceLoader::finishNetworkLoad()
{
    platformStrategies()->loaderStrategy()->resourceLoadScheduler()->remove(this);

    if (m_handle) {
        ASSERT(m_handle->client() == this);
        m_handle->clearClient();
        m_handle = nullptr;
    }
}
开发者ID:home201448,项目名称:webkit,代码行数:10,代码来源:ResourceLoader.cpp


示例12: checkForPendingPreloads

void CachedResourceLoader::performPostLoadActions()
{
    checkForPendingPreloads();

#if USE(PLATFORM_STRATEGIES)
    platformStrategies()->loaderStrategy()->resourceLoadScheduler()->servePendingRequests();
#else
    resourceLoadScheduler()->servePendingRequests();
#endif
}
开发者ID:fmalita,项目名称:webkit,代码行数:10,代码来源:CachedResourceLoader.cpp


示例13: m_server

DatabaseManager::DatabaseManager()
    : m_server(platformStrategies()->databaseStrategy()->getDatabaseServer())
    , m_client(0)
    , m_databaseIsAvailable(true)
#if !ASSERT_DISABLED
    , m_databaseContextRegisteredCount(0)
    , m_databaseContextInstanceCount(0)
#endif
{
    ASSERT(m_server); // We should always have a server to work with.
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:11,代码来源:DatabaseManager.cpp


示例14: ResourceRequest

void ResourceLoader::setDefersLoading(bool defers)
{
    m_defersLoading = defers;
    if (m_handle)
        m_handle->setDefersLoading(defers);
    if (!defers && !m_deferredRequest.isNull()) {
        m_request = m_deferredRequest;
        m_deferredRequest = ResourceRequest();
        start();
    }

    platformStrategies()->loaderStrategy()->resourceLoadScheduler()->setDefersLoading(this, defers);
}
开发者ID:Wrichik1999,项目名称:webkit,代码行数:13,代码来源:ResourceLoader.cpp


示例15: postResolutionCallbackQueue

PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler()
{
    if (resolutionNestingDepth == 1) {
        // Get size each time through the loop because a callback can add more callbacks to the end of the queue.
        auto& queue = postResolutionCallbackQueue();
        for (size_t i = 0; i < queue.size(); ++i)
            queue[i]();
        queue.clear();

        platformStrategies()->loaderStrategy()->resumePendingRequests();
    }

    --resolutionNestingDepth;
}
开发者ID:edcwconan,项目名称:webkit,代码行数:14,代码来源:StyleTreeResolver.cpp


示例16: m_client

DatabaseManager::DatabaseManager()
    : m_client(0)
    , m_databaseIsAvailable(true)
#if !ASSERT_DISABLED
    , m_databaseContextRegisteredCount(0)
    , m_databaseContextInstanceCount(0)
#endif
{
#if USE(PLATFORM_STRATEGIES)
    m_server = platformStrategies()->databaseStrategy()->getDatabaseServer();
#else
    m_server = new DatabaseServer;
#endif
    ASSERT(m_server); // We should always have a server to work with.
}
开发者ID:fatman2021,项目名称:webkitgtk,代码行数:15,代码来源:DatabaseManager.cpp


示例17: protect

void ResourceLoader::willSendRequest(ResourceRequest& request, const ResourceResponse& redirectResponse)
{
    // Protect this in this delegate method since the additional processing can do
    // anything including possibly derefing this; one example of this is Radar 3266216.
    Ref<ResourceLoader> protect(*this);

    ASSERT(!m_reachedTerminalState);
    
#if PLATFORM(IOS)
    // Ensure an identifier is always set. This ensures that this assetion is not hit:
    // <rdar://problem/11059794> ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) in WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace loading the attached web archive
    // This is not needed in WebKit2, as it doesn't use m_identifier in WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace
    if (!m_identifier) {
        m_identifier = m_frame->page()->progress().createUniqueIdentifier();
        frameLoader()->notifier().assignIdentifierToInitialRequest(m_identifier, documentLoader(), request);

        // If this ResourceLoader was stopped as a result of assignIdentifierToInitialRequest, bail out
        if (m_reachedTerminalState)
            return;
    }
#endif

    // We need a resource identifier for all requests, even if FrameLoader is never going to see it (such as with CORS preflight requests).
    bool createdResourceIdentifier = false;
    if (!m_identifier) {
        m_identifier = m_frame->page()->progress().createUniqueIdentifier();
        createdResourceIdentifier = true;
    }

    if (m_options.sendLoadCallbacks == SendCallbacks) {
        if (createdResourceIdentifier)
            frameLoader()->notifier().assignIdentifierToInitialRequest(m_identifier, documentLoader(), request);

        frameLoader()->notifier().willSendRequest(this, request, redirectResponse);
    }
#if ENABLE(INSPECTOR)
    else
        InspectorInstrumentation::willSendRequest(m_frame.get(), m_identifier, m_frame->loader().documentLoader(), request, redirectResponse);
#endif

    if (!redirectResponse.isNull())
        platformStrategies()->loaderStrategy()->resourceLoadScheduler()->crossOriginRedirectReceived(this, request.url());

    m_request = request;

    if (!redirectResponse.isNull() && !m_documentLoader->isCommitted())
        frameLoader()->client().dispatchDidReceiveServerRedirectForProvisionalLoad();
}
开发者ID:Wrichik1999,项目名称:webkit,代码行数:48,代码来源:ResourceLoader.cpp


示例18: ResourceRequest

void ResourceLoader::setDefersLoading(bool defers)
{
    if (m_options.defersLoadingPolicy() == DefersLoadingPolicy::DisallowDefersLoading)
        return;

    m_defersLoading = defers;
    if (m_handle)
        m_handle->setDefersLoading(defers);
    if (!defers && !m_deferredRequest.isNull()) {
        m_request = m_deferredRequest;
        m_deferredRequest = ResourceRequest();
        start();
    }

    platformStrategies()->loaderStrategy()->resourceLoadScheduler()->setDefersLoading(this, defers);
}
开发者ID:home201448,项目名称:webkit,代码行数:16,代码来源:ResourceLoader.cpp


示例19: blobRegistry

BlobRegistry& blobRegistry()
{
    ASSERT(isMainThread());
    return *platformStrategies()->blobRegistry();
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:5,代码来源:BlobRegistry.cpp


示例20: failBeforeStarting

void CachedResource::load(CachedResourceLoader* cachedResourceLoader, const ResourceLoaderOptions& options)
{
    if (!cachedResourceLoader->frame()) {
        failBeforeStarting();
        return;
    }

    FrameLoader& frameLoader = cachedResourceLoader->frame()->loader();
    if (options.securityCheck() == DoSecurityCheck && (frameLoader.state() == FrameStateProvisional || !frameLoader.activeDocumentLoader() || frameLoader.activeDocumentLoader()->isStopping())) {
        failBeforeStarting();
        return;
    }

    m_options = options;
    m_loading = true;

#if USE(QUICK_LOOK)
    if (!m_resourceRequest.isNull() && m_resourceRequest.url().protocolIs(QLPreviewProtocol())) {
        // When QuickLook is invoked to convert a document, it returns a unique URL in the
        // NSURLReponse for the main document. To make safeQLURLForDocumentURLAndResourceURL()
        // work, we need to use the QL URL not the original URL.
        const URL& documentURL = cachedResourceLoader->frame() ? cachedResourceLoader->frame()->loader().documentLoader()->response().url() : cachedResourceLoader->document()->url();
        m_resourceRequest.setURL(safeQLURLForDocumentURLAndResourceURL(documentURL, url()));
    }
#endif

    if (!accept().isEmpty())
        m_resourceRequest.setHTTPAccept(accept());

    if (isCacheValidator()) {
        CachedResource* resourceToRevalidate = m_resourceToRevalidate;
        ASSERT(resourceToRevalidate->canUseCacheValidator());
        ASSERT(resourceToRevalidate->isLoaded());
        const String& lastModified = resourceToRevalidate->response().httpHeaderField(HTTPHeaderName::LastModified);
        const String& eTag = resourceToRevalidate->response().httpHeaderField(HTTPHeaderName::ETag);
        if (!lastModified.isEmpty() || !eTag.isEmpty()) {
            ASSERT(cachedResourceLoader->cachePolicy(type()) != CachePolicyReload);
            if (cachedResourceLoader->cachePolicy(type()) == CachePolicyRevalidate)
                m_resourceRequest.setHTTPHeaderField(HTTPHeaderName::CacheControl, "max-age=0");
            if (!lastModified.isEmpty())
                m_resourceRequest.setHTTPHeaderField(HTTPHeaderName::IfModifiedSince, lastModified);
            if (!eTag.isEmpty())
                m_resourceRequest.setHTTPHeaderField(HTTPHeaderName::IfNoneMatch, eTag);
        }
    }

#if ENABLE(LINK_PREFETCH)
    if (type() == CachedResource::LinkPrefetch || type() == CachedResource::LinkSubresource)
        m_resourceRequest.setHTTPHeaderField(HTTPHeaderName::Purpose, "prefetch");
#endif
    m_resourceRequest.setPriority(loadPriority());

    if (type() != MainResource)
        addAdditionalRequestHeaders(cachedResourceLoader);

    // FIXME: It's unfortunate that the cache layer and below get to know anything about fragment identifiers.
    // We should look into removing the expectation of that knowledge from the platform network stacks.
    ResourceRequest request(m_resourceRequest);
    if (!m_fragmentIdentifierForRequest.isNull()) {
        URL url = request.url();
        url.setFragmentIdentifier(m_fragmentIdentifierForRequest);
        request.setURL(url);
        m_fragmentIdentifierForRequest = String();
    }

    m_loader = platformStrategies()->loaderStrategy()->resourceLoadScheduler()->scheduleSubresourceLoad(cachedResourceLoader->frame(), this, request, request.priority(), options);
    if (!m_loader) {
        failBeforeStarting();
        return;
    }

    m_status = Pending;
}
开发者ID:CannedFish,项目名称:webkit,代码行数:73,代码来源:CachedResource.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ platform_device_add函数代码示例发布时间:2022-05-30
下一篇:
C++ platformPath函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap