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


C++ Loader::start方法代码示例

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


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

示例1: fetch

ScriptPromise FetchManager::fetch(ScriptState* scriptState, const FetchRequestData* request)
{
    RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
    ScriptPromise promise = resolver->promise();

    OwnPtr<Loader> ownLoader(adoptPtr(new Loader(m_executionContext, this, resolver.release(), request)));
    Loader* loader = m_loaders.add(ownLoader.release()).storedValue->get();
    loader->start();
    return promise;
}
开发者ID:335969568,项目名称:Blink-1,代码行数:10,代码来源:FetchManager.cpp

示例2: fetch

ScriptPromise FetchManager::fetch(ScriptState* scriptState, FetchRequestData* request)
{
    RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
    ScriptPromise promise = resolver->promise();

    request->setContext(WebURLRequest::RequestContextFetch);

    OwnPtrWillBeRawPtr<Loader> ownLoader = Loader::create(m_executionContext, this, resolver.release(), request);
    Loader* loader = m_loaders.add(ownLoader.release()).storedValue->get();
    loader->start();
    return promise;
}
开发者ID:alexanderbill,项目名称:blink-crosswalk,代码行数:12,代码来源:FetchManager.cpp

示例3: eventActivated

void CaptchaFormsPlugin::eventActivated(const QString& from)
{
    int index = findChalleng("sender", from);
    if(index == -1)
        return;

    QHash<QString, QString> dataFields = challenges_.at(index);
    QString id = dataFields.value("id");
    QPointer<CaptchaDialog> cd = new CaptchaDialog(id);
    cd->setBody(dataFields.value("body"));
    cd->setQuestion(dataFields.value("label"));
    connect(cd, SIGNAL(ok(QString, QString)), this, SLOT(submitChallenge(QString, QString)));
    connect(cd, SIGNAL(cancel(QString)), this, SLOT(cancelChallenge(QString)));
    dialogs_[id] = cd;


    if(dataFields.contains("data")) {
        QByteArray ba;
        ba.append(dataFields.value("data"));
        QPixmap pix = QPixmap::fromImage(QImage::fromData(QByteArray::fromBase64(ba)));
        cd->setPixmap(pix);
    }
    else {
        Loader *ld = new Loader(id, this);
        if(useProxy) {
            int acc = dataFields.value("account").toInt();
            QString host_ = accInfo->proxyHost(acc);
            if(!host_.isEmpty()) {
                ld->setProxy(host_, accInfo->proxyPort(acc), accInfo->proxyUser(acc), accInfo->proxyPassword(acc));
            }
        }
        else {
            Proxy p = appInfo->getProxyFor(name());
            ld->setProxy(p.host, p.port, p.user, p.pass);
        }
        QString url = dataFields.value("uri");
        if(url.isEmpty()) {
            QString str = dataFields.value("body");
            QRegExp re(".*(http://[^\"]+).*");
            if(re.indexIn(str) != -1)
                url = re.cap(1) + "/image";
        }
        ld->start(url);
        connect(ld, SIGNAL(data(QString,QByteArray)), SLOT(loaderData(QString, QByteArray)));
        connect(ld, SIGNAL(error(QString)), SLOT(loaderError(QString)));
    }
    cd->show();
}
开发者ID:psi-plus,项目名称:plugins,代码行数:48,代码来源:captchaformsplugin.cpp


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