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

C++ TrackExceptionState类代码示例

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

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



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

示例1: makeSearchRange

static PassRefPtrWillBeRawPtr<Range> makeSearchRange(const Position& pos)
{
    Node* node = pos.deprecatedNode();
    if (!node)
        return nullptr;
    Document& document = node->document();
    if (!document.documentElement())
        return nullptr;
    Element* boundary = enclosingBlockFlowElement(*node);
    if (!boundary)
        return nullptr;

    RefPtrWillBeRawPtr<Range> searchRange(Range::create(document));
    TrackExceptionState exceptionState;

    Position start(pos.parentAnchoredEquivalent());
    searchRange->selectNodeContents(boundary, exceptionState);
    searchRange->setStart(start.containerNode(), start.offsetInContainerNode(), exceptionState);

    ASSERT(!exceptionState.hadException());
    if (exceptionState.hadException())
        return nullptr;

    return searchRange.release();
}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:25,代码来源:VisibleSelection.cpp


示例2: getClient

ScriptPromise Permissions::query(ScriptState* scriptState, const Dictionary& rawPermission)
{
    WebPermissionClient* client = getClient(scriptState->executionContext());
    if (!client)
        return ScriptPromise::rejectWithDOMException(scriptState, DOMException::create(InvalidStateError, "In its current state, the global scope can't query permissions."));

    TrackExceptionState exceptionState;
    PermissionDescriptor permission = NativeValueTraits<PermissionDescriptor>::nativeValue(scriptState->isolate(), rawPermission.v8Value(), exceptionState);

    if (exceptionState.hadException())
        return ScriptPromise::reject(scriptState, v8::Exception::TypeError(v8String(scriptState->isolate(), exceptionState.message())));

    ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
    ScriptPromise promise = resolver->promise();

    WebPermissionType type = getPermissionType(scriptState, rawPermission, permission, exceptionState);
    if (handleNotSupportedPermission(scriptState, rawPermission, resolver, type, exceptionState))
        return promise;

    // If the current origin is a file scheme, it will unlikely return a
    // meaningful value because most APIs are broken on file scheme and no
    // permission prompt will be shown even if the returned permission will most
    // likely be "prompt".
    client->queryPermission(type, KURL(KURL(), scriptState->executionContext()->securityOrigin()->toString()), new PermissionCallback(resolver, type));
    return promise;
}
开发者ID:Pluto-tv,项目名称:blink-crosswalk,代码行数:26,代码来源:Permissions.cpp


示例3: makeSearchRange

static PassRefPtr<Range> makeSearchRange(const Position& pos)
{
    Node* n = pos.deprecatedNode();
    if (!n)
        return 0;
    Document& d = n->document();
    Node* de = d.documentElement();
    if (!de)
        return 0;
    Node* boundary = n->enclosingBlockFlowElement();
    if (!boundary)
        return 0;

    RefPtr<Range> searchRange(Range::create(d));
    TrackExceptionState es;

    Position start(pos.parentAnchoredEquivalent());
    searchRange->selectNodeContents(boundary, es);
    searchRange->setStart(start.containerNode(), start.offsetInContainerNode(), es);

    ASSERT(!es.hadException());
    if (es.hadException())
        return 0;

    return searchRange.release();
}
开发者ID:halton,项目名称:blink-crosswalk,代码行数:26,代码来源:VisibleSelection.cpp


示例4: frameContentAsPlainText

static void frameContentAsPlainText(size_t maxChars, LocalFrame* frame, StringBuilder& output)
{
    Document* document = frame->document();
    if (!document)
        return;

    if (!frame->view())
        return;

    // Select the document body.
    RefPtr<Range> range(document->createRange());
    TrackExceptionState exceptionState;
    range->selectNodeContents(document, exceptionState);

    if (!exceptionState.had_exception()) {
        // The text iterator will walk nodes giving us text. This is similar to
        // the plainText() function in core/editing/TextIterator.h, but we implement the maximum
        // size and also copy the results directly into a wstring, avoiding the
        // string conversion.
        for (TextIterator it(range.get()); !it.atEnd(); it.advance()) {
            it.appendTextToStringBuilder(output, 0, maxChars - output.length());
            if (output.length() >= maxChars)
                return; // Filled up the buffer.
        }
    }
}
开发者ID:Jamesducque,项目名称:mojo,代码行数:26,代码来源:WebLocalFrameImpl.cpp


示例5: drawNodeHighlight

void InspectorOverlay::drawNodeHighlight()
{
    if (!m_highlightNode)
        return;

    String selectors = m_nodeHighlightConfig.selectorList;
    RefPtrWillBeRawPtr<StaticElementList> elements = nullptr;
    TrackExceptionState exceptionState;
    ContainerNode* queryBase = m_highlightNode->containingShadowRoot();
    if (!queryBase)
        queryBase = m_highlightNode->ownerDocument();
    if (selectors.length())
        elements = queryBase->querySelectorAll(AtomicString(selectors), exceptionState);
    if (elements && !exceptionState.hadException()) {
        for (unsigned i = 0; i < elements->length(); ++i) {
            Element* element = elements->item(i);
            InspectorHighlight highlight(element, m_nodeHighlightConfig, false);
            RefPtr<JSONObject> highlightJSON = highlight.asJSONObject();
            evaluateInOverlay("drawHighlight", highlightJSON.release());
        }
    }

    bool appendElementInfo = m_highlightNode->isElementNode() && !m_omitTooltip && m_nodeHighlightConfig.showInfo && m_highlightNode->layoutObject() && m_highlightNode->document().frame();
    InspectorHighlight highlight(m_highlightNode.get(), m_nodeHighlightConfig, appendElementInfo);
    if (m_eventTargetNode)
        highlight.appendEventTargetQuads(m_eventTargetNode.get(), m_nodeHighlightConfig);

    RefPtr<JSONObject> highlightJSON = highlight.asJSONObject();
    evaluateInOverlay("drawHighlight", highlightJSON.release());
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:30,代码来源:InspectorOverlay.cpp


示例6: ASSERT

void MergeIdenticalElementsCommand::doUnapply()
{
    ASSERT(m_element1);
    ASSERT(m_element2);

    RefPtr<Node> atChild = m_atChild.release();

    ContainerNode* parent = m_element2->parentNode();
    if (!parent || !parent->rendererIsEditable())
        return;

    TrackExceptionState es;

    parent->insertBefore(m_element1.get(), m_element2.get(), es);
    if (es.hadException())
        return;

    Vector<RefPtr<Node> > children;
    for (Node* child = m_element2->firstChild(); child && child != atChild; child = child->nextSibling())
        children.append(child);

    size_t size = children.size();
    for (size_t i = 0; i < size; ++i)
        m_element1->appendChild(children[i].release(), es);
}
开发者ID:chunywang,项目名称:blink-crosswalk,代码行数:25,代码来源:MergeIdenticalElementsCommand.cpp


示例7: querySelector

WebElement WebNode::querySelector(const WebString& tag, WebExceptionCode& ec) const
{
    TrackExceptionState es;
    WebElement element(m_private->querySelector(tag, es));
    ec = es.code();
    return element;
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_WebKit,代码行数:7,代码来源:WebNode.cpp


示例8: setupTest

void TouchActionTest::runShadowDOMTest(std::string file) {
  TouchActionTrackingWebViewClient client;

  WebView* webView = setupTest(file, client);

  TrackExceptionState es;

  // Oilpan: see runTouchActionTest() comment why these are persistent
  // references.
  Persistent<Document> document =
      static_cast<Document*>(webView->mainFrame()->document());
  Persistent<StaticElementList> hostNodes =
      document->querySelectorAll("[shadow-host]", es);
  ASSERT_FALSE(es.hadException());
  ASSERT_GE(hostNodes->length(), 1u);

  for (unsigned index = 0; index < hostNodes->length(); index++) {
    ShadowRoot* shadowRoot = hostNodes->item(index)->openShadowRoot();
    runTestOnTree(shadowRoot, webView, client);
  }

  // Projections show up in the main document.
  runTestOnTree(document.get(), webView, client);

  // Explicitly reset to break dependency on locally scoped client.
  m_webViewHelper.reset();
}
开发者ID:mirror,项目名称:chromium,代码行数:27,代码来源:TouchActionTest.cpp


示例9: containsNode

bool DOMSelection::containsNode(const Node* n, bool allowPartial) const
{
    if (!m_frame)
        return false;

    FrameSelection& selection = m_frame->selection();

    if (!n || m_frame->document() != n->document() || selection.isNone())
        return false;

    unsigned nodeIndex = n->nodeIndex();
    RefPtrWillBeRawPtr<Range> selectedRange = selection.selection().toNormalizedRange();

    ContainerNode* parentNode = n->parentNode();
    if (!parentNode)
        return false;

    TrackExceptionState exceptionState;
    bool nodeFullySelected = Range::compareBoundaryPoints(parentNode, nodeIndex, selectedRange->startContainer(), selectedRange->startOffset(), exceptionState) >= 0 && !exceptionState.hadException()
        && Range::compareBoundaryPoints(parentNode, nodeIndex + 1, selectedRange->endContainer(), selectedRange->endOffset(), exceptionState) <= 0 && !exceptionState.hadException();
    if (exceptionState.hadException())
        return false;
    if (nodeFullySelected)
        return true;

    bool nodeFullyUnselected = (Range::compareBoundaryPoints(parentNode, nodeIndex, selectedRange->endContainer(), selectedRange->endOffset(), exceptionState) > 0 && !exceptionState.hadException())
        || (Range::compareBoundaryPoints(parentNode, nodeIndex + 1, selectedRange->startContainer(), selectedRange->startOffset(), exceptionState) < 0 && !exceptionState.hadException());
    ASSERT(!exceptionState.hadException());
    if (nodeFullyUnselected)
        return false;

    return allowPartial || n->isTextNode();
}
开发者ID:jeremyroman,项目名称:blink,代码行数:33,代码来源:DOMSelection.cpp


示例10: createEvent

WebDOMEvent WebDocument::createEvent(const WebString& eventType)
{
    TrackExceptionState exceptionState;
    WebDOMEvent event(unwrap<Document>()->createEvent(eventType, exceptionState));
    if (exceptionState.hadException())
        return WebDOMEvent();
    return event;
}
开发者ID:pozdnyakov,项目名称:blink-crosswalk-1,代码行数:8,代码来源:WebDocument.cpp


示例11: serialize

WebSerializedScriptValue WebSerializedScriptValue::serialize(v8::Local<v8::Value> value)
{
    TrackExceptionState exceptionState;
    WebSerializedScriptValue serializedValue = SerializedScriptValueFactory::instance().create(v8::Isolate::GetCurrent(), value, nullptr, nullptr, nullptr, exceptionState);
    if (exceptionState.hadException())
        return createInvalid();
    return serializedValue;
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:8,代码来源:WebSerializedScriptValue.cpp


示例12:

void SplitTextNodeCommand::insertText1AndTrimText2()
{
    TrackExceptionState exceptionState;
    m_text2->parentNode()->insertBefore(m_text1.get(), m_text2.get(), exceptionState);
    if (exceptionState.hadException())
        return;
    m_text2->deleteData(0, m_offset, exceptionState, CharacterData::DeprecatedRecalcStyleImmediatlelyForEditing);
}
开发者ID:Igalia,项目名称:blink,代码行数:8,代码来源:SplitTextNodeCommand.cpp


示例13: setAttribute

bool WebElement::setAttribute(const WebString& attrName, const WebString& attrValue)
{
    // TODO: Custom element callbacks need to be called on WebKit API methods that
    // mutate the DOM in any way.
    CustomElementCallbackDispatcher::CallbackDeliveryScope deliverCustomElementCallbacks;
    TrackExceptionState exceptionState;
    unwrap<Element>()->setAttribute(attrName, attrValue, exceptionState);
    return !exceptionState.hadException();
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:9,代码来源:WebElement.cpp


示例14: setEnd

bool setEnd(Range *r, const VisiblePosition &visiblePosition)
{
    if (!r)
        return false;
    Position p = visiblePosition.deepEquivalent().parentAnchoredEquivalent();
    TrackExceptionState exceptionState;
    r->setEnd(p.containerNode(), p.offsetInContainerNode(), exceptionState);
    return !exceptionState.hadException();
}
开发者ID:joone,项目名称:blink-crosswalk,代码行数:9,代码来源:VisiblePosition.cpp


示例15: setBaseValueAsString

void SVGStaticStringList::setBaseValueAsString(const String& value, SVGParsingError& parseError)
{
    TrackExceptionState es;

    m_value->setValueAsString(value, es);

    if (es.hadException())
        parseError = ParsingAttributeFailedError;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:9,代码来源:SVGStaticStringList.cpp


示例16: querySelector

WebElement WebNode::querySelector(const WebString& tag, WebExceptionCode& ec) const
{
    TrackExceptionState exceptionState;
    WebElement element;
    if (m_private->isContainerNode())
        element = toContainerNode(m_private.get())->querySelector(tag, exceptionState);
    ec = exceptionState.code();
    return element;
}
开发者ID:viettrungluu-cr,项目名称:mojo,代码行数:9,代码来源:WebNode.cpp


示例17: dictionary

v8::Handle<v8::Value> WebDocument::registerEmbedderCustomElement(const WebString& name, v8::Handle<v8::Value> options, WebExceptionCode& ec)
{
    v8::Isolate* isolate = v8::Isolate::GetCurrent();
    Document* document = unwrap<Document>();
    Dictionary dictionary(options, isolate);
    TrackExceptionState exceptionState;
    ScriptValue constructor = document->registerElement(ScriptState::current(isolate), name, dictionary, exceptionState, CustomElement::EmbedderNames);
    ec = exceptionState.code();
    if (exceptionState.hadException())
        return v8::Handle<v8::Value>();
    return constructor.v8Value();
}
开发者ID:pozdnyakov,项目名称:blink-crosswalk-1,代码行数:12,代码来源:WebDocument.cpp


示例18: ASSERT

SVGLength SVGLength::fromCSSPrimitiveValue(CSSPrimitiveValue* value)
{
    ASSERT(value);

    SVGLengthType svgType;
    switch (value->primitiveType()) {
    case CSSPrimitiveValue::CSS_NUMBER:
        svgType = LengthTypeNumber;
        break;
    case CSSPrimitiveValue::CSS_PERCENTAGE:
        svgType = LengthTypePercentage;
        break;
    case CSSPrimitiveValue::CSS_EMS:
        svgType = LengthTypeEMS;
        break;
    case CSSPrimitiveValue::CSS_EXS:
        svgType = LengthTypeEXS;
        break;
    case CSSPrimitiveValue::CSS_PX:
        svgType = LengthTypePX;
        break;
    case CSSPrimitiveValue::CSS_CM:
        svgType = LengthTypeCM;
        break;
    case CSSPrimitiveValue::CSS_MM:
        svgType = LengthTypeMM;
        break;
    case CSSPrimitiveValue::CSS_IN:
        svgType = LengthTypeIN;
        break;
    case CSSPrimitiveValue::CSS_PT:
        svgType = LengthTypePT;
        break;
    case CSSPrimitiveValue::CSS_PC:
        svgType = LengthTypePC;
        break;
    case CSSPrimitiveValue::CSS_UNKNOWN:
    default:
        svgType = LengthTypeUnknown;
        break;
    };

    if (svgType == LengthTypeUnknown)
        return SVGLength();

    TrackExceptionState exceptionState;
    SVGLength length;
    length.newValueSpecifiedUnits(svgType, value->getFloatValue(), exceptionState);
    if (exceptionState.hadException())
        return SVGLength();

    return length;
}
开发者ID:Igalia,项目名称:blink,代码行数:53,代码来源:SVGLength.cpp


示例19: forEachInternal

void HeaderMap::forEachInternal(PassOwnPtr<HeaderMapForEachCallback> callback, ScriptValue* thisArg)
{
    TrackExceptionState exceptionState;
    for (HashMap<String, String>::const_iterator it = m_headers.begin(); it != m_headers.end(); ++it) {
        if (thisArg)
            callback->handleItem(*thisArg, it->value, it->key, this);
        else
            callback->handleItem(it->value, it->key, this);
        if (exceptionState.hadException())
            break;
    }
}
开发者ID:smil-in-javascript,项目名称:blink,代码行数:12,代码来源:HeaderMap.cpp


示例20: forEachInternal

void Headers::forEachInternal(PassOwnPtr<HeadersForEachCallback> callback, ScriptValue* thisArg)
{
    TrackExceptionState exceptionState;
    for (size_t i = 0; i < m_headerList->size(); ++i) {
        if (thisArg)
            callback->handleItem(*thisArg, m_headerList->list()[i]->second, m_headerList->list()[i]->first, this);
        else
            callback->handleItem(m_headerList->list()[i]->second, m_headerList->list()[i]->first, this);
        if (exceptionState.hadException())
            break;
    }
}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:12,代码来源:Headers.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ TrackId类代码示例发布时间:2022-05-31
下一篇:
C++ TrackData类代码示例发布时间: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