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


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

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


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

示例1: dispatchEvent

void DOMWindowEventQueue::dispatchEvent(Event* event) {
  EventTarget* eventTarget = event->target();
  InspectorInstrumentation::AsyncTask asyncTask(
      eventTarget->getExecutionContext(), event);
  if (LocalDOMWindow* window = eventTarget->toLocalDOMWindow())
    window->dispatchEvent(event, nullptr);
  else
    eventTarget->dispatchEvent(event);
}
开发者ID:mirror,项目名称:chromium,代码行数:9,代码来源:DOMWindowEventQueue.cpp

示例2: cancelAllEvents

void GenericEventQueue::cancelAllEvents()
{
    m_timer.stop();

    for (const auto& pendingEvent : m_pendingEvents) {
        Event* event = pendingEvent.get();
        TRACE_EVENT_ASYNC_END2("event", "GenericEventQueue:enqueueEvent", event, "type", event->type().ascii(), "status", "cancelled");
        EventTarget* target = event->target() ? event->target() : m_owner.get();
        InspectorInstrumentation::asyncTaskCanceled(target->getExecutionContext(), event);
    }
    m_pendingEvents.clear();
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:12,代码来源:GenericEventQueue.cpp

示例3: cancelEvent

bool GenericEventQueue::cancelEvent(Event* event)
{
    bool found = m_pendingEvents.contains(event);

    if (found) {
        EventTarget* target = event->target() ? event->target() : m_owner.get();
        InspectorInstrumentation::asyncTaskCanceled(target->getExecutionContext(), event);
        m_pendingEvents.remove(m_pendingEvents.find(event));
        TRACE_EVENT_ASYNC_END2("event", "GenericEventQueue:enqueueEvent", event, "type", event->type().ascii(), "status", "cancelled");
    }

    if (m_pendingEvents.isEmpty())
        m_timer.stop();

    return found;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:16,代码来源:GenericEventQueue.cpp

示例4: timerFired

void GenericEventQueue::timerFired(Timer<GenericEventQueue>*)
{
    ASSERT(!m_timer.isActive());
    ASSERT(!m_pendingEvents.isEmpty());

    HeapVector<Member<Event>> pendingEvents;
    m_pendingEvents.swap(pendingEvents);

    for (const auto& pendingEvent : pendingEvents) {
        Event* event = pendingEvent.get();
        EventTarget* target = event->target() ? event->target() : m_owner.get();
        CString type(event->type().ascii());
        InspectorInstrumentation::AsyncTask asyncTask(target->getExecutionContext(), event);
        TRACE_EVENT_ASYNC_STEP_INTO1("event", "GenericEventQueue:enqueueEvent", event, "dispatch", "type", type);
        target->dispatchEvent(pendingEvent);
        TRACE_EVENT_ASYNC_END1("event", "GenericEventQueue:enqueueEvent", event, "type", type);
    }
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:18,代码来源:GenericEventQueue.cpp

示例5: enqueueEvent

bool GenericEventQueue::enqueueEvent(Event* event)
{
    if (m_isClosed)
        return false;

    if (event->target() == m_owner)
        event->setTarget(nullptr);

    TRACE_EVENT_ASYNC_BEGIN1("event", "GenericEventQueue:enqueueEvent", event, "type", event->type().ascii());
    EventTarget* target = event->target() ? event->target() : m_owner.get();
    InspectorInstrumentation::asyncTaskScheduled(target->getExecutionContext(), event->type(), event);
    m_pendingEvents.append(event);

    if (!m_timer.isActive())
        m_timer.startOneShot(0, BLINK_FROM_HERE);

    return true;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:18,代码来源:GenericEventQueue.cpp


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