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

C++ WebVector类代码示例

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

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



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

示例1: didReadDirectory

void WebFileSystemCallbacksImpl::didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore)
{
    ASSERT(m_callbacks);
    for (size_t i = 0; i < entries.size(); ++i)
        m_callbacks->didReadDirectoryEntry(entries[i].name, entries[i].isDirectory);
    m_callbacks->didReadDirectoryEntries(hasMore);
    if (!hasMore)
        delete this;
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:9,代码来源:WebFileSystemCallbacksImpl.cpp


示例2: setDocumentState

void WebHistoryItem::setDocumentState(const WebVector<WebString>& state)
{
    ensureMutable();
    // FIXME: would be nice to avoid the intermediate copy
    Vector<String> ds;
    for (size_t i = 0; i < state.size(); ++i)
        ds.append(state[i]);
    m_private->setDocumentState(ds);
}
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:9,代码来源:WebHistoryItem.cpp


示例3: onSuccess

void WebIDBCallbacksImpl::onSuccess(const WebVector<WebString>& webStringList)
{
    Vector<String> stringList;
    for (size_t i = 0; i < webStringList.size(); ++i)
        stringList.append(webStringList[i]);
    InspectorInstrumentationCookie cookie = InspectorInstrumentation::traceAsyncCallbackStarting(m_request->executionContext(), m_asyncOperationId);
    m_request->onSuccess(stringList);
    InspectorInstrumentation::traceAsyncCallbackCompleted(cookie);
}
开发者ID:JulienIsorce,项目名称:ChromiumGStreamerBackend,代码行数:9,代码来源:WebIDBCallbacksImpl.cpp


示例4: didChooseFile

void WebFileChooserCompletionImpl::didChooseFile(const WebVector<WebString>& fileNames)
{
    Vector<FileChooserFileInfo> fileInfo;
    for (size_t i = 0; i < fileNames.size(); ++i)
        fileInfo.append(FileChooserFileInfo(fileNames[i]));
    m_fileChooser->chooseFiles(fileInfo);
    // This object is no longer needed.
    delete this;
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:9,代码来源:WebFileChooserCompletionImpl.cpp


示例5: didReceiveResults

void SpeechRecognitionClientProxy::didReceiveResults(
    const WebSpeechRecognitionHandle& handle,
    const WebVector<WebSpeechRecognitionResult>& newFinalResults,
    const WebVector<WebSpeechRecognitionResult>& currentInterimResults) {
  SpeechRecognition* recognition(handle);

  HeapVector<Member<SpeechRecognitionResult>> finalResultsVector(
      newFinalResults.size());
  for (size_t i = 0; i < newFinalResults.size(); ++i)
    finalResultsVector[i] = Member<SpeechRecognitionResult>(newFinalResults[i]);

  HeapVector<Member<SpeechRecognitionResult>> interimResultsVector(
      currentInterimResults.size());
  for (size_t i = 0; i < currentInterimResults.size(); ++i)
    interimResultsVector[i] =
        Member<SpeechRecognitionResult>(currentInterimResults[i]);

  recognition->didReceiveResults(finalResultsVector, interimResultsVector);
}
开发者ID:mirror,项目名称:chromium,代码行数:19,代码来源:SpeechRecognitionClientProxy.cpp


示例6: parse

// Old style parser. Deprecated.
static bool parse(const Dictionary& constraintsDictionary, WebVector<WebMediaConstraint>& optional, WebVector<WebMediaConstraint>& mandatory)
{
    if (constraintsDictionary.isUndefinedOrNull())
        return true;

    Vector<String> names;
    bool ok = constraintsDictionary.getPropertyNames(names);
    if (!ok)
        return false;

    String mandatoryName("mandatory");
    String optionalName("optional");

    for (Vector<String>::iterator it = names.begin(); it != names.end(); ++it) {
        if (*it != mandatoryName && *it != optionalName)
            return false;
    }

    if (names.contains(mandatoryName)) {
        Dictionary mandatoryConstraintsDictionary;
        bool ok = constraintsDictionary.get(mandatoryName, mandatoryConstraintsDictionary);
        if (!ok || mandatoryConstraintsDictionary.isUndefinedOrNull())
            return false;
        ok = parseMandatoryConstraintsDictionary(mandatoryConstraintsDictionary, mandatory);
        if (!ok)
            return false;
    }

    Vector<WebMediaConstraint> optionalConstraintsVector;
    if (names.contains(optionalName)) {
        ArrayValue optionalConstraints;
        bool ok = DictionaryHelper::get(constraintsDictionary, optionalName, optionalConstraints);
        if (!ok || optionalConstraints.isUndefinedOrNull())
            return false;

        size_t numberOfConstraints;
        ok = optionalConstraints.length(numberOfConstraints);
        if (!ok)
            return false;

        for (size_t i = 0; i < numberOfConstraints; ++i) {
            Dictionary constraint;
            ok = optionalConstraints.get(i, constraint);
            if (!ok || constraint.isUndefinedOrNull())
                return false;
            ok = parseOptionalConstraintsVectorElement(constraint, optionalConstraintsVector);
            if (!ok)
                return false;
        }
        optional.assign(optionalConstraintsVector);
    }

    return true;
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:55,代码来源:MediaConstraintsImpl.cpp


示例7: getInputElements

void WebFormElement::getInputElements(WebVector<WebInputElement>& result) const
{
    const HTMLFormElement* form = constUnwrap<HTMLFormElement>();
    Vector<RefPtr<HTMLInputElement> > tempVector;
    for (size_t i = 0; i < form->formElements.size(); i++) {
        if (form->formElements[i]->hasLocalName(HTMLNames::inputTag))
            tempVector.append(static_cast<HTMLInputElement*>(
                form->formElements[i]));
    }
    result.assign(tempVector);
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:11,代码来源:WebFormElement.cpp


示例8: TEST_F

TEST_F(TextFinderTest, OverlappingMatches)
{
    document().body()->setInnerHTML("aababaa", ASSERT_NO_EXCEPTION);
    Node* textNode = document().body()->firstChild();

    int identifier = 0;
    WebString searchText(String("aba"));
    WebFindOptions findOptions; // Default.

    textFinder().resetMatchCount();
    textFinder().scopeStringMatches(identifier, searchText, findOptions, true);
    while (textFinder().scopingInProgress())
        runPendingTasks();

    // We shouldn't find overlapped matches.
    EXPECT_EQ(1, textFinder().totalMatchCount());
    WebVector<WebFloatRect> matchRects;
    textFinder().findMatchRects(matchRects);
    ASSERT_EQ(1u, matchRects.size());
    EXPECT_EQ(findInPageRect(textNode, 1, textNode, 4), matchRects[0]);
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:21,代码来源:TextFinderTest.cpp


示例9: result

// FIXME: Cleanup when the chromium code has switched to the split sources implementation.
void WebMediaStreamDescriptor::sources(WebVector<WebMediaStreamSource>& webSources) const
{
    size_t numberOfAudioSources = m_private->numberOfAudioComponents();
    size_t numberOfVideoSources = m_private->numberOfVideoComponents();
    WebVector<WebMediaStreamSource> result(numberOfAudioSources + numberOfVideoSources);
    size_t i = 0;
    for (size_t j = 0; j < numberOfAudioSources; ++i, ++j)
        result[i] = m_private->audioComponent(j)->source();
    for (size_t j = 0; j < numberOfVideoSources; ++i, ++j)
        result[i] = m_private->videoComponent(j)->source();
    webSources.swap(result);
}
开发者ID:dzhshf,项目名称:WebKit,代码行数:13,代码来源:WebMediaStreamDescriptor.cpp


示例10: initialize

// FIXME: Cleanup when the chromium code has switched to the split sources implementation.
void WebMediaStreamDescriptor::initialize(const WebString& label, const WebVector<WebMediaStreamSource>& sources)
{
    MediaStreamSourceVector audio, video;
    for (size_t i = 0; i < sources.size(); ++i) {
        MediaStreamSource* curr = sources[i];
        if (curr->type() == MediaStreamSource::TypeAudio)
            audio.append(curr);
        else if (curr->type() == MediaStreamSource::TypeVideo)
            video.append(curr);
    }
    m_private = MediaStreamDescriptor::create(label, audio, video);
}
开发者ID:pial003,项目名称:RespImg-WebCore,代码行数:13,代码来源:WebMediaStreamDescriptor.cpp


示例11: getFormControlElements

void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& result) const
{
    const HTMLFormElement* form = constUnwrap<HTMLFormElement>();
    Vector<RefPtr<HTMLFormControlElement> > formControlElements;

    const Vector<FormAssociatedElement*>& associatedElements = form->associatedElements();
    for (Vector<FormAssociatedElement*>::const_iterator it = associatedElements.begin(); it != associatedElements.end(); ++it) {
        if ((*it)->isFormControlElement())
            formControlElements.append(toHTMLFormControlElement(*it));
    }
    result.assign(formControlElements);
}
开发者ID:Tkkg1994,项目名称:Platfrom-kccat6,代码行数:12,代码来源:WebFormElement.cpp


示例12: verifyConstraints

bool MockConstraints::verifyConstraints(const WebMediaConstraints& constraints, WebString* failedConstraint)
{
    WebVector<WebMediaConstraint> mandatoryConstraints;
    constraints.getMandatoryConstraints(mandatoryConstraints);
    if (mandatoryConstraints.size()) {
        for (size_t i = 0; i < mandatoryConstraints.size(); ++i) {
            const WebMediaConstraint& curr = mandatoryConstraints[i];
            if (!isSupported(curr.m_name) || curr.m_value != "1") {
                if (failedConstraint)
                    *failedConstraint = curr.m_name;
                return false;
            }
        }
    }

    WebVector<WebMediaConstraint> optionalConstraints;
    constraints.getOptionalConstraints(optionalConstraints);
    if (optionalConstraints.size()) {
        for (size_t i = 0; i < optionalConstraints.size(); ++i) {
            const WebMediaConstraint& curr = optionalConstraints[i];
            if (!isValid(curr.m_name) || curr.m_value != "0") {
                if (failedConstraint)
                    *failedConstraint = curr.m_name;
                return false;
            }
        }
    }

    return true;
}
开发者ID:ChromiumWebApps,项目名称:chromium,代码行数:30,代码来源:MockConstraints.cpp


示例13: images

void WebDocument::images(WebVector<WebElement>& results)
{
    RefPtr<HTMLCollection> images = unwrap<Document>()->images();
    size_t sourceLength = images->length();
    Vector<WebElement> temp;
    temp.reserveCapacity(sourceLength);
    for (size_t i = 0; i < sourceLength; ++i) {
        Element* element = images->item(i);
        if (element && element->isHTMLElement())
            temp.append(WebElement(element));
    }
    results.assign(temp);
}
开发者ID:pozdnyakov,项目名称:blink-crosswalk-1,代码行数:13,代码来源:WebDocument.cpp


示例14: parseMandatoryConstraintsDictionary

static bool parseMandatoryConstraintsDictionary(const Dictionary& mandatoryConstraintsDictionary, WebVector<WebMediaConstraint>& mandatory)
{
    Vector<WebMediaConstraint> mandatoryConstraintsVector;
    HashMap<String, String> mandatoryConstraintsHashMap;
    bool ok = mandatoryConstraintsDictionary.getOwnPropertiesAsStringHashMap(mandatoryConstraintsHashMap);
    if (!ok)
        return false;

    for (const auto& iter : mandatoryConstraintsHashMap)
        mandatoryConstraintsVector.append(WebMediaConstraint(iter.key, iter.value));
    mandatory.assign(mandatoryConstraintsVector);
    return true;
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:13,代码来源:MediaConstraintsImpl.cpp


示例15: toCoreResults

static Vector<TextCheckingResult> toCoreResults(const WebVector<WebTextCheckingResult>& results)
{
    Vector<TextCheckingResult> coreResults;
    for (size_t i = 0; i < results.size(); ++i) { 
        TextCheckingResult coreResult;
        coreResult.type = toCoreCheckingType(results[i].error);
        coreResult.location = results[i].position;
        coreResult.length = results[i].length;
        coreResults.append(coreResult);
    }

    return coreResults;
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:13,代码来源:WebTextCheckingCompletionImpl.cpp


示例16: images

void WebDocument::images(WebVector<WebElement>& results)
{
    RefPtr<HTMLCollection> images = unwrap<Document>()->images();
    size_t sourceLength = images->length();
    Vector<WebElement> temp;
    temp.reserveCapacity(sourceLength);
    for (size_t i = 0; i < sourceLength; ++i) {
        Node* node = images->item(i);
        if (node && node->isHTMLElement())
            temp.append(WebElement(static_cast<Element*>(node)));
    }
    results.assign(temp);
}
开发者ID:kseo,项目名称:webkit,代码行数:13,代码来源:WebDocument.cpp


示例17: forms

void WebDocument::forms(WebVector<WebFormElement>& results) const {
  HTMLCollection* forms =
      const_cast<Document*>(constUnwrap<Document>())->forms();
  size_t sourceLength = forms->length();
  Vector<WebFormElement> temp;
  temp.reserveCapacity(sourceLength);
  for (size_t i = 0; i < sourceLength; ++i) {
    Element* element = forms->item(i);
    // Strange but true, sometimes node can be 0.
    if (element && element->isHTMLElement())
      temp.append(WebFormElement(toHTMLFormElement(element)));
  }
  results.assign(temp);
}
开发者ID:mirror,项目名称:chromium,代码行数:14,代码来源:WebDocument.cpp


示例18: forms

void WebDocument::forms(WebVector<WebFormElement>& results) const
{
    RefPtr<HTMLCollection> forms = const_cast<Document*>(constUnwrap<Document>())->forms();
    size_t sourceLength = forms->length();
    Vector<WebFormElement> temp;
    temp.reserveCapacity(sourceLength);
    for (size_t i = 0; i < sourceLength; ++i) {
        Node* node = forms->item(i);
        // Strange but true, sometimes node can be 0.
        if (node && node->isHTMLElement())
            temp.append(WebFormElement(static_cast<HTMLFormElement*>(node)));
    }
    results.assign(temp);
}
开发者ID:kseo,项目名称:webkit,代码行数:14,代码来源:WebDocument.cpp


示例19: getFormControlElements

void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& result) const
{
    const HTMLFormElement* form = constUnwrap<HTMLFormElement>();
    Vector<RefPtr<HTMLFormControlElement> > tempVector;
    // FIXME: We should move the for-loop condition into a variable instead of
    // re-evaluating size each time. Also, consider refactoring this code so that
    // we don't call form->associatedElements() multiple times.
    for (size_t i = 0; i < form->associatedElements().size(); i++) {
        if (form->associatedElements()[i]->hasLocalName(HTMLNames::inputTag)
            || form->associatedElements()[i]->hasLocalName(HTMLNames::selectTag))
            tempVector.append(form->associatedElements()[i]);
    }
    result.assign(tempVector);
}
开发者ID:achellies,项目名称:WinCEWebKit,代码行数:14,代码来源:WebFormElement.cpp


示例20: didAcceptIndices

void ExternalPopupMenu::didAcceptIndices(const WebVector<int>& indices)
{
    if (!m_popupMenuClient) {
        m_webExternalPopupMenu = 0;
        return;
    }

    // Calling methods on the PopupMenuClient might lead to this object being
    // derefed. This ensures it does not get deleted while we are running this
    // method.
    RefPtrWillBeRawPtr<ExternalPopupMenu> protect(this);

    m_popupMenuClient->popupDidHide();

    if (!indices.size())
        m_popupMenuClient->valueChanged(static_cast<unsigned>(-1), true);
    else {
        for (size_t i = 0; i < indices.size(); ++i)
            m_popupMenuClient->listBoxSelectItem(toPopupMenuItemIndex(indices[i], *m_popupMenuClient), (i > 0), false, (i == indices.size() - 1));
    }

    m_webExternalPopupMenu = 0;
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:23,代码来源:ExternalPopupMenu.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ WebView类代码示例发布时间:2022-05-31
下一篇:
C++ WebURLResponse类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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