本文整理汇总了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);
}
示例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);
}
示例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();
}