本文整理汇总了C++中FrameLoader::loadType方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameLoader::loadType方法的具体用法?C++ FrameLoader::loadType怎么用?C++ FrameLoader::loadType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameLoader
的用法示例。
在下文中一共展示了FrameLoader::loadType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateForCommit
void HistoryController::updateForCommit()
{
FrameLoader* frameLoader = m_frame->loader();
#if !LOG_DISABLED
if (frameLoader->documentLoader())
LOG(History, "WebCoreHistory: Updating History for commit in frame %s", frameLoader->documentLoader()->title().string().utf8().data());
#endif
FrameLoadType type = frameLoader->loadType();
if (isBackForwardLoadType(type)
|| isReplaceLoadTypeWithProvisionalItem(type)
|| (isReloadTypeWithProvisionalItem(type) && !frameLoader->provisionalDocumentLoader()->unreachableURL().isEmpty())) {
// Once committed, we want to use current item for saving DocState, and
// the provisional item for restoring state.
// Note previousItem must be set before we close the URL, which will
// happen when the data source is made non-provisional below
m_frameLoadComplete = false;
m_previousItem = m_currentItem;
ASSERT(m_provisionalItem);
m_currentItem = m_provisionalItem;
m_provisionalItem = 0;
// Tell all other frames in the tree to commit their provisional items and
// restore their scroll position. We'll avoid this frame (which has already
// committed) and its children (which will be replaced).
Page* page = m_frame->page();
ASSERT(page);
page->mainFrame()->loader()->history()->recursiveUpdateForCommit();
}
}
示例2: dispatchWillSendRequest
void FrameLoaderClientBlackBerry::dispatchWillSendRequest(DocumentLoader* docLoader, long unsigned int, ResourceRequest& request, const ResourceResponse&)
{
// If the request is being loaded by the provisional document loader, then
// it is a new top level request which has not been commited.
bool isMainResourceLoad = docLoader && docLoader == docLoader->frameLoader()->provisionalDocumentLoader();
// TargetType for subresource loads should have been set in CachedResource::load().
if (isMainResourceLoad && request.targetType() == ResourceRequest::TargetIsUnspecified)
request.setTargetType(isMainFrame() ? ResourceRequest::TargetIsMainFrame : ResourceRequest::TargetIsSubframe);
// Any processing which is done for all loads (both main and subresource) should go here.
NetworkRequest platformRequest;
request.initializePlatformRequest(platformRequest, cookiesEnabled());
m_webPagePrivate->m_client->populateCustomHeaders(platformRequest);
const NetworkRequest::HeaderList& headerLists = platformRequest.getHeaderListRef();
for (NetworkRequest::HeaderList::const_iterator it = headerLists.begin(); it != headerLists.end(); ++it) {
std::string headerString = it->first;
std::string headerValueString = it->second;
request.setHTTPHeaderField(String::fromUTF8WithLatin1Fallback(headerString.data(), headerString.length()), String::fromUTF8WithLatin1Fallback(headerValueString.data(), headerValueString.length()));
}
if (!isMainResourceLoad) {
// Do nothing for now.
// Any processing which is done only for subresources should go here.
return;
}
// All processing beyond this point is done only for main resource loads.
if (m_clientRedirectIsPending && isMainFrame()) {
String originalUrl = m_frame->document()->url().string();
String finalUrl = request.url().string();
m_webPagePrivate->m_client->notifyClientRedirect(originalUrl.characters(), originalUrl.length(),
finalUrl.characters(), finalUrl.length());
}
FrameLoader* loader = m_frame->loader();
ASSERT(loader);
if (isBackForwardLoadType(loader->loadType())) {
// Do not use the passed DocumentLoader because it is the loader that
// will be used for the new request (the DESTINATION of the history
// navigation - we want to use the current DocumentLoader to record the
// SOURCE).
DocumentLoader* docLoader = m_frame->loader()->documentLoader();
ASSERT(docLoader);
m_historyNavigationSourceURLs.add(docLoader->url());
m_historyNavigationSourceURLs.add(docLoader->originalURL());
}
}
示例3: updateForCommit
void HistoryController::updateForCommit()
{
FrameLoader* frameLoader = m_frame->loader();
#if !LOG_DISABLED
if (m_frame->document())
LOG(History, "WebCoreHistory: Updating History for commit in frame %s", m_frame->document()->title().utf8().data());
#endif
FrameLoadType type = frameLoader->loadType();
if (isBackForwardLoadType(type) || (isReloadTypeWithProvisionalItem(type) && !frameLoader->documentLoader()->unreachableURL().isEmpty())) {
// Once committed, we want to use current item for saving DocState, and
// the provisional item for restoring state.
// Note previousItem must be set before we close the URL, which will
// happen when the data source is made non-provisional below
m_previousItem = m_currentItem;
ASSERT(m_provisionalItem);
m_currentItem = m_provisionalItem;
m_provisionalItem = 0;
// Tell all other frames in the tree to commit their provisional items and
// restore their scroll position. We'll avoid this frame (which has already
// committed) and its children (which will be replaced).
Page* page = m_frame->page();
ASSERT(page);
page->mainFrame()->loader()->history()->recursiveUpdateForCommit();
}
switch (type) {
case FrameLoadTypeBackForward:
updateForBackForwardNavigation();
return;
case FrameLoadTypeReload:
case FrameLoadTypeReloadFromOrigin:
case FrameLoadTypeSame:
updateForReload();
return;
case FrameLoadTypeStandard:
updateForStandardLoad();
return;
case FrameLoadTypeRedirectWithLockedBackForwardList:
updateForRedirectWithLockedBackForwardList();
return;
case FrameLoadTypeInitialInChildFrame:
updateForInitialLoadInChildFrame();
return;
default:
ASSERT_NOT_REACHED();
}
}
示例4: updateForCommit
void HistoryController::updateForCommit()
{
FrameLoader* frameLoader = m_frame->loader();
#if !LOG_DISABLED
if (frameLoader->documentLoader())
LOG(History, "WebCoreHistory: Updating History for commit in frame %s", frameLoader->documentLoader()->title().utf8().data());
#endif
FrameLoadType type = frameLoader->loadType();
if (isBackForwardLoadType(type) ||
((type == FrameLoadTypeReload || type == FrameLoadTypeReloadFromOrigin) && !frameLoader->provisionalDocumentLoader()->unreachableURL().isEmpty())) {
// Once committed, we want to use current item for saving DocState, and
// the provisional item for restoring state.
// Note previousItem must be set before we close the URL, which will
// happen when the data source is made non-provisional below
m_previousItem = m_currentItem;
ASSERT(m_provisionalItem);
m_currentItem = m_provisionalItem;
m_provisionalItem = 0;
}
}