本文整理汇总了C++中platformStrategies函数的典型用法代码示例。如果您正苦于以下问题:C++ platformStrategies函数的具体用法?C++ platformStrategies怎么用?C++ platformStrategies使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了platformStrategies函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: blobRegistry
BlobRegistry& blobRegistry()
{
ASSERT(isMainThread());
static BlobRegistry& instance = *platformStrategies()->loaderStrategy()->createBlobRegistry();
return instance;
}
示例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();
}
示例3: ASSERT
void ResourceLoader::willSwitchToSubstituteResource()
{
ASSERT(!m_documentLoader->isSubstituteLoadPending(this));
platformStrategies()->loaderStrategy()->resourceLoadScheduler()->remove(this);
if (m_handle)
m_handle->cancel();
}
示例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;
}
示例5: localizationStrategy
static inline LocalizationStrategy* localizationStrategy()
{
if (hasPlatformStrategies())
return platformStrategies()->localizationStrategy();
return &DefaultLocalizationStrategy::shared();
}
示例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
}
示例7: notifyCookiesChangedOnMainThread
static void notifyCookiesChangedOnMainThread(void*)
{
ASSERT(isMainThread());
#if USE(PLATFORM_STRATEGIES)
platformStrategies()->cookiesStrategy()->notifyCookiesChanged();
#endif
}
示例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
}
示例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();
}
示例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);
}
示例11: platformStrategies
void ResourceLoader::finishNetworkLoad()
{
platformStrategies()->loaderStrategy()->resourceLoadScheduler()->remove(this);
if (m_handle) {
ASSERT(m_handle->client() == this);
m_handle->clearClient();
m_handle = nullptr;
}
}
示例12: checkForPendingPreloads
void CachedResourceLoader::performPostLoadActions()
{
checkForPendingPreloads();
#if USE(PLATFORM_STRATEGIES)
platformStrategies()->loaderStrategy()->resourceLoadScheduler()->servePendingRequests();
#else
resourceLoadScheduler()->servePendingRequests();
#endif
}
示例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.
}
示例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);
}
示例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;
}