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


C++ WebPage::sendSync方法代码示例

本文整理汇总了C++中WebPage::sendSync方法的典型用法代码示例。如果您正苦于以下问题:C++ WebPage::sendSync方法的具体用法?C++ WebPage::sendSync怎么用?C++ WebPage::sendSync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WebPage的用法示例。


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

示例1: dispatchDecidePolicyForResponse

void WebFrameLoaderClient::dispatchDecidePolicyForResponse(FramePolicyFunction function, const ResourceResponse& response, const ResourceRequest& request)
{
    WebPage* webPage = m_frame->page();
    if (!webPage)
        return;

    if (!request.url().string()) {
        (m_frame->coreFrame()->loader()->policyChecker()->*function)(PolicyUse);
        return;
    }

    RefPtr<APIObject> userData;

    // Notify the bundle client.
    WKBundlePagePolicyAction policy = webPage->injectedBundlePolicyClient().decidePolicyForResponse(webPage, m_frame, response, request, userData);
    if (policy == WKBundlePagePolicyActionUse) {
        (m_frame->coreFrame()->loader()->policyChecker()->*function)(PolicyUse);
        return;
    }

    uint64_t listenerID = m_frame->setUpPolicyListener(function);
    bool receivedPolicyAction;
    uint64_t policyAction;
    uint64_t downloadID;

    // Notify the UIProcess.
    if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForResponse(m_frame->frameID(), response, request, listenerID, InjectedBundleUserMessageEncoder(userData.get())), Messages::WebPageProxy::DecidePolicyForResponse::Reply(receivedPolicyAction, policyAction, downloadID)))
        return;

    // We call this synchronously because CFNetwork can only convert a loading connection to a download from its didReceiveResponse callback.
    if (receivedPolicyAction)
        m_frame->didReceivePolicyDecision(listenerID, static_cast<PolicyAction>(policyAction), downloadID);
}
开发者ID:,项目名称:,代码行数:33,代码来源:

示例2: establishConnection

void CompositingManager::establishConnection(WebPage& webPage)
{
    IPC::Attachment connectionHandle;
    webPage.sendSync(Messages::CompositingManagerProxy::EstablishConnection(),
        Messages::CompositingManagerProxy::EstablishConnection::Reply(connectionHandle));

    m_connectionFd = connectionHandle.releaseFileDescriptor();
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:8,代码来源:CompositingManager.cpp

示例3: establishConnection

void CompositingManager::establishConnection(WebPage& webPage, WTF::RunLoop& runLoop)
{
    IPC::Connection::SocketPair socketPair = IPC::Connection::createPlatformConnection();
    IPC::Connection::Identifier connectionIdentifier(socketPair.server);
    IPC::Attachment connectionClientPort(socketPair.client);

    m_connection = IPC::Connection::createServerConnection(connectionIdentifier, *this, runLoop);
    m_connection->open();
    webPage.sendSync(Messages::CompositingManagerProxy::EstablishConnection(connectionClientPort),
        Messages::CompositingManagerProxy::EstablishConnection::Reply(), webPage.pageID());
}
开发者ID:emutavchi,项目名称:WebKitForWayland,代码行数:11,代码来源:CompositingManager.cpp

示例4: canAuthenticateAgainstProtectionSpace

bool WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace(DocumentLoader*, unsigned long, const ProtectionSpace& protectionSpace)
{
    // FIXME: Authentication is a per-resource concept, but we don't do per-resource handling in the UIProcess at the API level quite yet.
    // Once we do, we might need to make sure authentication fits with our solution.
    
    WebPage* webPage = m_frame->page();
    if (!webPage)
        return false;
        
    bool canAuthenticate;
    if (!webPage->sendSync(Messages::WebPageProxy::CanAuthenticateAgainstProtectionSpaceInFrame(m_frame->frameID(), protectionSpace), Messages::WebPageProxy::CanAuthenticateAgainstProtectionSpaceInFrame::Reply(canAuthenticate)))
        return false;
    
    return canAuthenticate;
}
开发者ID:,项目名称:,代码行数:15,代码来源:

示例5: shouldGoToHistoryItem

bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem* item) const
{
    WebPage* webPage = m_frame->page();
    if (!webPage)
        return false;
    
    uint64_t itemID = WebBackForwardListProxy::idForItem(item);
    if (!itemID) {
        // We should never be considering navigating to an item that is not actually in the back/forward list.
        ASSERT_NOT_REACHED();
        return false;
    }
    
    bool shouldGoToBackForwardListItem;
    if (!webPage->sendSync(Messages::WebPageProxy::ShouldGoToBackForwardListItem(itemID), Messages::WebPageProxy::ShouldGoToBackForwardListItem::Reply(shouldGoToBackForwardListItem)))
        return false;
    
    return shouldGoToBackForwardListItem;
}
开发者ID:,项目名称:,代码行数:19,代码来源:

示例6: onSslErrors

void QtNetworkAccessManager::onSslErrors(QNetworkReply* reply, const QList<QSslError>& qSslErrors)
{
#ifndef QT_NO_SSL
    WebPage* webPage = obtainOriginatingWebPage(reply->request());

    // FIXME: This check can go away once our Qt version is up-to-date. See: QTBUG-23512.
    if (!webPage)
        return;

    String hostname = reply->url().host();
    bool ignoreErrors = false;

    if (webPage->sendSync(
        Messages::WebPageProxy::CertificateVerificationRequest(hostname),
        Messages::WebPageProxy::CertificateVerificationRequest::Reply(ignoreErrors))) {
        if (ignoreErrors)
            reply->ignoreSslErrors(qSslErrors);
    }
#endif
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:20,代码来源:QtNetworkAccessManager.cpp

示例7: onAuthenticationRequired

void QtNetworkAccessManager::onAuthenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator)
{
    WebPage* webPage = obtainOriginatingWebPage(reply->request());

    // FIXME: This check can go away once our Qt version is up-to-date. See: QTBUG-23512.
    if (!webPage)
        return;

    String hostname = reply->url().toString(QUrl::RemovePath | QUrl::RemoveQuery | QUrl::RemoveFragment | QUrl::StripTrailingSlash);
    String realm = authenticator->realm();
    String prefilledUsername = authenticator->user();
    String username;
    String password;

    if (webPage->sendSync(
        Messages::WebPageProxy::AuthenticationRequiredRequest(hostname, realm, prefilledUsername),
        Messages::WebPageProxy::AuthenticationRequiredRequest::Reply(username, password))) {
        if (!username.isEmpty())
            authenticator->setUser(username);
        if (!password.isEmpty())
            authenticator->setPassword(password);
    }
}
开发者ID:Moondee,项目名称:Artemis,代码行数:23,代码来源:QtNetworkAccessManager.cpp

示例8: onProxyAuthenticationRequired

void QtNetworkAccessManager::onProxyAuthenticationRequired(const QNetworkProxy& proxy, QAuthenticator* authenticator)
{
    // FIXME: Check if there is a better way to get a reference to the page.
    WebPage* webPage = m_webProcess->focusedWebPage();

    if (!webPage)
        return;

    String hostname = proxy.hostName();
    uint16_t port = static_cast<uint16_t>(proxy.port());
    String prefilledUsername = authenticator->user();
    String username;
    String password;

    if (webPage->sendSync(
         Messages::WebPageProxy::ProxyAuthenticationRequiredRequest(hostname, port, prefilledUsername),
         Messages::WebPageProxy::ProxyAuthenticationRequiredRequest::Reply(username, password))) {
         if (!username.isEmpty())
             authenticator->setUser(username);
         if (!password.isEmpty())
             authenticator->setPassword(password);
     }

}
开发者ID:Moondee,项目名称:Artemis,代码行数:24,代码来源:QtNetworkAccessManager.cpp

示例9: dispatchDecidePolicyForNavigationAction

void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const NavigationAction& navigationAction, const ResourceRequest& request, PassRefPtr<FormState> formState)
{
    WebPage* webPage = m_frame->page();
    if (!webPage)
        return;

    // Always ignore requests with empty URLs. 
    if (request.isEmpty()) { 
        (m_frame->coreFrame()->loader()->policyChecker()->*function)(PolicyIgnore); 
        return; 
    }

    RefPtr<APIObject> userData;

    RefPtr<InjectedBundleNavigationAction> action = InjectedBundleNavigationAction::create(m_frame, navigationAction, formState);

    // Notify the bundle client.
    WKBundlePagePolicyAction policy = webPage->injectedBundlePolicyClient().decidePolicyForNavigationAction(webPage, m_frame, action.get(), request, userData);
    if (policy == WKBundlePagePolicyActionUse) {
        (m_frame->coreFrame()->loader()->policyChecker()->*function)(PolicyUse);
        return;
    }
    
    uint64_t listenerID = m_frame->setUpPolicyListener(function);
    bool receivedPolicyAction;
    uint64_t policyAction;
    uint64_t downloadID;

    // Notify the UIProcess.
    if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForNavigationAction(m_frame->frameID(), action->navigationType(), action->modifiers(), action->mouseButton(), request, listenerID, InjectedBundleUserMessageEncoder(userData.get())), Messages::WebPageProxy::DecidePolicyForNavigationAction::Reply(receivedPolicyAction, policyAction, downloadID)))
        return;

    // We call this synchronously because WebCore cannot gracefully handle a frame load without a synchronous navigation policy reply.
    if (receivedPolicyAction)
        m_frame->didReceivePolicyDecision(listenerID, static_cast<PolicyAction>(policyAction), downloadID);
}
开发者ID:,项目名称:,代码行数:36,代码来源:


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