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


C++ EventTarget::removeEventListener方法代码示例

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


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

示例1: gobjectDestroyed

void GObjectEventListener::gobjectDestroyed()
{
    ASSERT(m_coreTarget);

    // We must set m_coreTarget to null, because removeEventListener
    // may call the destructor as a side effect and we must be in the
    // proper state to prevent g_object_weak_unref.
    EventTarget* target = m_coreTarget;
    m_coreTarget = 0;
    target->removeEventListener(m_domEventName.data(), this, m_capture);
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:11,代码来源:GObjectEventListener.cpp

示例2: exceptionState

void V8EventTarget::removeEventListenerMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeEventListener", "EventTarget", info.Holder(), info.GetIsolate());
    if (UNLIKELY(info.Length() < 2)) {
        setMinimumArityTypeError(exceptionState, 2, info.Length());
        exceptionState.throwIfNeeded();
        return;
    }
    EventTarget* impl = V8EventTarget::toImpl(info.Holder());
    if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), callingDOMWindow(info.GetIsolate()), impl, exceptionState)) {
        exceptionState.throwIfNeeded();
        return;
    }
    V8StringResource<> type;
    RefPtrWillBeRawPtr<EventListener> listener;
    EventListenerOptionsOrBoolean options;
    {
        type = info[0];
        if (!type.prepare())
            return;
        listener = V8EventListenerList::getEventListener(ScriptState::current(info.GetIsolate()), info[1], false, ListenerFindOnly);
        // TODO(dtapuska): This custom binding code can be eliminated once
        // EventListenerOptions runtime enabled feature is removed.
        // http://crbug.com/545163
        if (UNLIKELY(info.Length() <= 2) || isUndefinedOrNull(info[2])) {
            removeEventListenerMethodPrologueCustom(info, impl);
            impl->removeEventListener(type, listener);
            removeEventListenerMethodEpilogueCustom(info, impl);
            return;
        }
        V8EventListenerOptionsOrBoolean::toImpl(info.GetIsolate(), info[2], options, UnionTypeConversionMode::NotNullable, exceptionState);
        if (exceptionState.throwIfNeeded())
            return;
    }
    removeEventListenerMethodPrologueCustom(info, impl);
    impl->removeEventListener(type, listener, options);
    removeEventListenerMethodEpilogueCustom(info, impl);
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:38,代码来源:V8EventTargetCustom.cpp

示例3: jsEventTargetRemoveEventListener

JSValue* jsEventTargetRemoveEventListener(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
    Node* eventNode = 0;
    EventTarget* eventTarget = 0;
    if (!retrieveEventTargetAndCorrespondingNode(exec, thisValue, eventNode, eventTarget))
        return throwError(exec, TypeError);

    Frame* frame = eventNode->document()->frame();
    if (!frame)
        return jsUndefined();

    if (JSEventListener* listener = toJSDOMWindow(frame)->findJSEventListener(args.at(exec, 1)))
        eventTarget->removeEventListener(args.at(exec, 0)->toString(exec), listener, args.at(exec, 2)->toBoolean(exec));

    return jsUndefined();
}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:16,代码来源:JSEventTargetBase.cpp


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