Commit 31e0cbd9 authored by tkent@chromium.org's avatar tkent@chromium.org

Oilpan: Replace RefPtrs to Node and its subclasses in core/events/ with Oilpan transition types.

BUG=357163

Review URL: https://codereview.chromium.org/308073005

git-svn-id: svn://svn.chromium.org/blink/trunk@175126 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d552263c
......@@ -46,6 +46,7 @@ enum EventDispatchContinuation {
};
class EventDispatcher {
STACK_ALLOCATED();
public:
static bool dispatchEvent(Node*, PassRefPtr<EventDispatchMediator>);
static void dispatchScopedEvent(Node*, PassRefPtr<EventDispatchMediator>);
......@@ -66,8 +67,8 @@ private:
void dispatchEventAtBubbling(WindowEventContext&);
void dispatchEventPostProcess(void* preDispatchEventHandlerResult);
RefPtr<Node> m_node;
RefPtrWillBePersistent<Event> m_event;
RefPtrWillBeMember<Node> m_node;
RefPtrWillBeMember<Event> m_event;
RefPtr<FrameView> m_view;
#ifndef NDEBUG
bool m_eventDispatched;
......
......@@ -381,6 +381,7 @@ void EventPath::checkReachability(TreeScope& treeScope, TouchList& touchList)
void EventPath::trace(Visitor* visitor)
{
visitor->trace(m_nodeEventContexts);
visitor->trace(m_event);
}
......
......@@ -95,7 +95,7 @@ private:
static void checkReachability(TreeScope&, TouchList&);
#endif
Vector<NodeEventContext, 64> m_nodeEventContexts;
WillBeHeapVector<NodeEventContext, 64> m_nodeEventContexts;
Node* m_node;
RawPtrWillBeMember<Event> m_event;
Vector<RefPtr<TreeScopeEventContext> > m_treeScopeEventContexts;
......
......@@ -49,7 +49,7 @@ PassRefPtrWillBeRawPtr<MouseEvent> MouseEvent::create(const AtomicString& type,
return adoptRefWillBeNoop(new MouseEvent(type, initializer));
}
PassRefPtrWillBeRawPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, const PlatformMouseEvent& event, int detail, PassRefPtr<Node> relatedTarget)
PassRefPtrWillBeRawPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, const PlatformMouseEvent& event, int detail, PassRefPtrWillBeRawPtr<Node> relatedTarget)
{
ASSERT(event.type() == PlatformEvent::MouseMoved || event.button() != NoButton);
......
......@@ -61,7 +61,7 @@ public:
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
PassRefPtr<EventTarget> relatedTarget, PassRefPtrWillBeRawPtr<Clipboard>, bool isSimulated = false);
static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView>, const PlatformMouseEvent&, int detail, PassRefPtr<Node> relatedTarget);
static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView>, const PlatformMouseEvent&, int detail, PassRefPtrWillBeRawPtr<Node> relatedTarget);
static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& eventType, const MouseEventInit&);
......
......@@ -31,7 +31,7 @@ MutationEvent::MutationEvent()
ScriptWrappable::init(this);
}
MutationEvent::MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
MutationEvent::MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<Node> relatedNode,
const String& prevValue, const String& newValue,
const String& attrName, unsigned short attrChange)
: Event(type, canBubble, cancelable)
......@@ -48,7 +48,7 @@ MutationEvent::~MutationEvent()
{
}
void MutationEvent::initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
void MutationEvent::initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<Node> relatedNode,
const String& prevValue, const String& newValue,
const String& attrName, unsigned short attrChange)
{
......@@ -71,6 +71,7 @@ const AtomicString& MutationEvent::interfaceName() const
void MutationEvent::trace(Visitor* visitor)
{
visitor->trace(m_relatedNode);
Event::trace(visitor);
}
......
......@@ -44,13 +44,14 @@ namespace WebCore {
return adoptRefWillBeNoop(new MutationEvent);
}
static PassRefPtrWillBeRawPtr<MutationEvent> create(const AtomicString& type, bool canBubble, PassRefPtr<Node> relatedNode = nullptr,
static PassRefPtrWillBeRawPtr<MutationEvent> create(
const AtomicString& type, bool canBubble, PassRefPtrWillBeRawPtr<Node> relatedNode = nullptr,
const String& prevValue = String(), const String& newValue = String(), const String& attrName = String(), unsigned short attrChange = 0)
{
return adoptRefWillBeNoop(new MutationEvent(type, canBubble, false, relatedNode, prevValue, newValue, attrName, attrChange));
}
void initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
void initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<Node> relatedNode,
const String& prevValue, const String& newValue,
const String& attrName, unsigned short attrChange);
......@@ -66,11 +67,11 @@ namespace WebCore {
private:
MutationEvent();
MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
MutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<Node> relatedNode,
const String& prevValue, const String& newValue,
const String& attrName, unsigned short attrChange);
RefPtr<Node> m_relatedNode;
RefPtrWillBeMember<Node> m_relatedNode;
String m_prevValue;
String m_newValue;
String m_attrName;
......
......@@ -35,7 +35,7 @@
namespace WebCore {
NodeEventContext::NodeEventContext(PassRefPtr<Node> node, PassRefPtr<EventTarget> currentTarget)
NodeEventContext::NodeEventContext(PassRefPtrWillBeRawPtr<Node> node, PassRefPtr<EventTarget> currentTarget)
: m_node(node)
, m_currentTarget(currentTarget)
{
......@@ -46,6 +46,11 @@ NodeEventContext::~NodeEventContext()
{
}
void NodeEventContext::trace(Visitor* visitor)
{
visitor->trace(m_node);
}
void NodeEventContext::handleLocalEvents(Event* event) const
{
if (touchEventContext()) {
......
......@@ -39,10 +39,12 @@ class NodeList;
class TouchEventContext;
class NodeEventContext {
ALLOW_ONLY_INLINE_ALLOCATION();
public:
// FIXME: Use ContainerNode instead of Node.
NodeEventContext(PassRefPtr<Node>, PassRefPtr<EventTarget> currentTarget);
NodeEventContext(PassRefPtrWillBeRawPtr<Node>, PassRefPtr<EventTarget> currentTarget);
~NodeEventContext();
void trace(Visitor*);
Node* node() const { return m_node.get(); }
......@@ -57,7 +59,7 @@ public:
void handleLocalEvents(Event*) const;
private:
RefPtr<Node> m_node;
RefPtrWillBeMember<Node> m_node;
RefPtr<EventTarget> m_currentTarget;
RefPtr<TreeScopeEventContext> m_treeScopeEventContext;
};
......
......@@ -35,7 +35,7 @@
namespace WebCore {
WindowEventContext::WindowEventContext(Event* event, PassRefPtr<Node> node, const NodeEventContext* topNodeEventContext)
WindowEventContext::WindowEventContext(Event* event, PassRefPtrWillBeRawPtr<Node> node, const NodeEventContext* topNodeEventContext)
{
// We don't dispatch load events to the window. This quirk was originally
// added because Mozilla doesn't propagate load events to the window object.
......
......@@ -40,7 +40,7 @@ class NodeEventContext;
class WindowEventContext {
public:
WindowEventContext(Event*, PassRefPtr<Node>, const NodeEventContext*);
WindowEventContext(Event*, PassRefPtrWillBeRawPtr<Node>, const NodeEventContext*);
DOMWindow* window() const;
EventTarget* target() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment