Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / events / Event.h
index 19344d8..2b6fb67 100644 (file)
@@ -27,7 +27,7 @@
 #include "bindings/v8/ScriptWrappable.h"
 #include "core/dom/DOMTimeStamp.h"
 #include "core/events/EventPath.h"
-#include "heap/Handle.h"
+#include "platform/heap/Handle.h"
 #include "wtf/RefCounted.h"
 #include "wtf/text/AtomicString.h"
 
@@ -35,6 +35,7 @@ namespace WebCore {
 
 class EventTarget;
 class EventDispatcher;
+class ExecutionContext;
 class HTMLIFrameElement;
 
 struct EventInit {
@@ -46,7 +47,7 @@ public:
     bool cancelable;
 };
 
-class Event : public RefCountedWillBeRefCountedGarbageCollected<Event>,  public ScriptWrappable {
+class Event : public RefCountedWillBeGarbageCollectedFinalized<Event>,  public ScriptWrappable {
 public:
     enum PhaseType {
         NONE                = 0,
@@ -76,7 +77,7 @@ public:
 
     static PassRefPtrWillBeRawPtr<Event> create()
     {
-        return adoptRefWillBeRefCountedGarbageCollected(new Event);
+        return adoptRefWillBeNoop(new Event);
     }
 
     // A factory for a simple event. The event doesn't bubble, and isn't
@@ -84,24 +85,24 @@ public:
     // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#fire-a-simple-event
     static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type)
     {
-        return adoptRefWillBeRefCountedGarbageCollected(new Event(type, false, false));
+        return adoptRefWillBeNoop(new Event(type, false, false));
     }
     static PassRefPtrWillBeRawPtr<Event> createCancelable(const AtomicString& type)
     {
-        return adoptRefWillBeRefCountedGarbageCollected(new Event(type, false, true));
+        return adoptRefWillBeNoop(new Event(type, false, true));
     }
     static PassRefPtrWillBeRawPtr<Event> createBubble(const AtomicString& type)
     {
-        return adoptRefWillBeRefCountedGarbageCollected(new Event(type, true, false));
+        return adoptRefWillBeNoop(new Event(type, true, false));
     }
     static PassRefPtrWillBeRawPtr<Event> createCancelableBubble(const AtomicString& type)
     {
-        return adoptRefWillBeRefCountedGarbageCollected(new Event(type, true, true));
+        return adoptRefWillBeNoop(new Event(type, true, true));
     }
 
     static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type, const EventInit& initializer)
     {
-        return adoptRefWillBeRefCountedGarbageCollected(new Event(type, initializer));
+        return adoptRefWillBeNoop(new Event(type, initializer));
     }
 
     virtual ~Event();
@@ -130,8 +131,8 @@ public:
     // IE Extensions
     EventTarget* srcElement() const { return target(); } // MSIE extension - "the object that fired the event"
 
-    bool legacyReturnValue() const { return !defaultPrevented(); }
-    void setLegacyReturnValue(bool returnValue) { setDefaultPrevented(!returnValue); }
+    bool legacyReturnValue(ExecutionContext*) const;
+    void setLegacyReturnValue(ExecutionContext*, bool returnValue);
 
     virtual const AtomicString& interfaceName() const;
     bool hasInterface(const AtomicString&) const;
@@ -158,7 +159,7 @@ public:
     bool immediatePropagationStopped() const { return m_immediatePropagationStopped; }
 
     bool defaultPrevented() const { return m_defaultPrevented; }
-    void preventDefault()
+    virtual void preventDefault()
     {
         if (m_cancelable)
             m_defaultPrevented = true;
@@ -172,7 +173,7 @@ public:
     void setCancelBubble(bool cancel) { m_cancelBubble = cancel; }
 
     Event* underlyingEvent() const { return m_underlyingEvent.get(); }
-    void setUnderlyingEvent(PassRefPtr<Event>);
+    void setUnderlyingEvent(PassRefPtrWillBeRawPtr<Event>);
 
     EventPath& eventPath() { ASSERT(m_eventPath); return *m_eventPath; }
     EventPath& ensureEventPath();
@@ -206,8 +207,8 @@ private:
     EventTarget* m_currentTarget;
     RefPtr<EventTarget> m_target;
     DOMTimeStamp m_createTime;
-    RefPtr<Event> m_underlyingEvent;
-    OwnPtr<EventPath> m_eventPath;
+    RefPtrWillBeMember<Event> m_underlyingEvent;
+    OwnPtrWillBeMember<EventPath> m_eventPath;
 };
 
 #define DEFINE_EVENT_TYPE_CASTS(typeName) \