Event construction helpers should return Ref instead of PassRefPtr.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 14 Dec 2014 12:23:31 +0000 (12:23 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 14 Dec 2014 12:23:31 +0000 (12:23 +0000)
<https://webkit.org/b/139625>

Reviewed by Antti Koivisto.

Change all the FooEvent::create() construction helpers to return Ref<FooEvent>
instead of PassRefPtr<FooEvent>.

This allows the compiler to omit null checks at each call site, since we know
that these functions always return valid objects.

* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
(WebCore::WebKitPlaybackTargetAvailabilityEvent::create):
* Modules/encryptedmedia/MediaKeyMessageEvent.h:
(WebCore::MediaKeyMessageEvent::create):
* Modules/encryptedmedia/MediaKeyNeededEvent.h:
(WebCore::MediaKeyNeededEvent::create):
* Modules/gamepad/GamepadEvent.h:
(WebCore::GamepadEvent::create):
* Modules/indexeddb/IDBVersionChangeEvent.h:
(WebCore::IDBVersionChangeEvent::create):
* Modules/indieui/UIRequestEvent.cpp:
(WebCore::UIRequestEvent::create):
* Modules/indieui/UIRequestEvent.h:
* Modules/mediastream/MediaStreamEvent.cpp:
(WebCore::MediaStreamEvent::create):
* Modules/mediastream/MediaStreamEvent.h:
* Modules/mediastream/MediaStreamTrackEvent.cpp:
(WebCore::MediaStreamTrackEvent::create):
* Modules/mediastream/MediaStreamTrackEvent.h:
* Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
(WebCore::RTCDTMFToneChangeEvent::create):
* Modules/mediastream/RTCDTMFToneChangeEvent.h:
* Modules/mediastream/RTCDataChannelEvent.cpp:
(WebCore::RTCDataChannelEvent::create):
* Modules/mediastream/RTCDataChannelEvent.h:
* Modules/mediastream/RTCIceCandidateEvent.cpp:
(WebCore::RTCIceCandidateEvent::create):
* Modules/mediastream/RTCIceCandidateEvent.h:
* Modules/speech/SpeechSynthesisEvent.cpp:
(WebCore::SpeechSynthesisEvent::create):
* Modules/speech/SpeechSynthesisEvent.h:
* Modules/webaudio/AudioProcessingEvent.cpp:
(WebCore::AudioProcessingEvent::create):
* Modules/webaudio/AudioProcessingEvent.h:
* Modules/webaudio/OfflineAudioCompletionEvent.cpp:
(WebCore::OfflineAudioCompletionEvent::create):
* Modules/webaudio/OfflineAudioCompletionEvent.h:
* Modules/websockets/CloseEvent.h:
(WebCore::CloseEvent::create):
* dom/AnimationEvent.h:
* dom/AutocompleteErrorEvent.h:
* dom/BeforeLoadEvent.h:
* dom/BeforeTextInsertedEvent.h:
* dom/BeforeUnloadEvent.h:
* dom/ClipboardEvent.h:
* dom/CompositionEvent.h:
* dom/CustomEvent.h:
* dom/DeviceMotionEvent.h:
* dom/DeviceOrientationEvent.h:
* dom/ErrorEvent.h:
* dom/Event.h:
(WebCore::Event::create):
* dom/FocusEvent.h:
* dom/HashChangeEvent.h:
* dom/KeyboardEvent.h:
* dom/MessageEvent.h:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::SimulatedMouseEvent::create):
* dom/MouseEvent.h:
(WebCore::MouseEvent::create):
* dom/MutationEvent.h:
* dom/OverflowEvent.h:
* dom/PageTransitionEvent.h:
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::create):
* dom/PopStateEvent.h:
* dom/ProgressEvent.h:
(WebCore::ProgressEvent::create):
* dom/TextEvent.cpp:
(WebCore::TextEvent::create):
(WebCore::TextEvent::createForPlainTextPaste):
(WebCore::TextEvent::createForFragmentPaste):
(WebCore::TextEvent::createForDrop):
(WebCore::TextEvent::createForDictation):
* dom/TextEvent.h:
* dom/TouchEvent.h:
* dom/TransitionEvent.h:
* dom/UIEvent.h:
(WebCore::UIEvent::create):
* dom/WebKitAnimationEvent.h:
* dom/WebKitTransitionEvent.h:
* dom/WheelEvent.h:
* html/MediaKeyEvent.h:
* html/canvas/WebGLContextEvent.h:
* html/track/TrackEvent.h:
* storage/StorageEvent.cpp:
(WebCore::StorageEvent::create):
* storage/StorageEvent.h:
* svg/SVGZoomEvent.h:
(WebCore::SVGZoomEvent::create):
* xml/XMLHttpRequestProgressEvent.h:
(WebCore::XMLHttpRequestProgressEvent::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177264 268f45cc-cd09-0410-ab3c-d52691b4dbfc

65 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h
Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.h
Source/WebCore/Modules/encryptedmedia/MediaKeyNeededEvent.h
Source/WebCore/Modules/gamepad/GamepadEvent.h
Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h
Source/WebCore/Modules/indieui/UIRequestEvent.cpp
Source/WebCore/Modules/indieui/UIRequestEvent.h
Source/WebCore/Modules/mediastream/MediaStreamEvent.cpp
Source/WebCore/Modules/mediastream/MediaStreamEvent.h
Source/WebCore/Modules/mediastream/MediaStreamTrackEvent.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrackEvent.h
Source/WebCore/Modules/mediastream/RTCDTMFToneChangeEvent.cpp
Source/WebCore/Modules/mediastream/RTCDTMFToneChangeEvent.h
Source/WebCore/Modules/mediastream/RTCDataChannelEvent.cpp
Source/WebCore/Modules/mediastream/RTCDataChannelEvent.h
Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.cpp
Source/WebCore/Modules/mediastream/RTCIceCandidateEvent.h
Source/WebCore/Modules/speech/SpeechSynthesisEvent.cpp
Source/WebCore/Modules/speech/SpeechSynthesisEvent.h
Source/WebCore/Modules/webaudio/AudioProcessingEvent.cpp
Source/WebCore/Modules/webaudio/AudioProcessingEvent.h
Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.cpp
Source/WebCore/Modules/webaudio/OfflineAudioCompletionEvent.h
Source/WebCore/Modules/websockets/CloseEvent.h
Source/WebCore/dom/AnimationEvent.h
Source/WebCore/dom/AutocompleteErrorEvent.h
Source/WebCore/dom/BeforeLoadEvent.h
Source/WebCore/dom/BeforeTextInsertedEvent.h
Source/WebCore/dom/BeforeUnloadEvent.h
Source/WebCore/dom/ClipboardEvent.h
Source/WebCore/dom/CompositionEvent.h
Source/WebCore/dom/CustomEvent.h
Source/WebCore/dom/DeviceMotionEvent.h
Source/WebCore/dom/DeviceOrientationEvent.h
Source/WebCore/dom/ErrorEvent.h
Source/WebCore/dom/Event.h
Source/WebCore/dom/FocusEvent.h
Source/WebCore/dom/HashChangeEvent.h
Source/WebCore/dom/KeyboardEvent.h
Source/WebCore/dom/MessageEvent.h
Source/WebCore/dom/MouseEvent.cpp
Source/WebCore/dom/MouseEvent.h
Source/WebCore/dom/MutationEvent.h
Source/WebCore/dom/OverflowEvent.h
Source/WebCore/dom/PageTransitionEvent.h
Source/WebCore/dom/PopStateEvent.cpp
Source/WebCore/dom/PopStateEvent.h
Source/WebCore/dom/ProgressEvent.h
Source/WebCore/dom/TextEvent.cpp
Source/WebCore/dom/TextEvent.h
Source/WebCore/dom/TouchEvent.h
Source/WebCore/dom/TransitionEvent.h
Source/WebCore/dom/UIEvent.h
Source/WebCore/dom/WebKitAnimationEvent.h
Source/WebCore/dom/WebKitTransitionEvent.h
Source/WebCore/dom/WheelEvent.h
Source/WebCore/html/MediaKeyEvent.h
Source/WebCore/html/canvas/WebGLContextEvent.h
Source/WebCore/html/track/TrackEvent.h
Source/WebCore/storage/StorageEvent.cpp
Source/WebCore/storage/StorageEvent.h
Source/WebCore/svg/SVGZoomEvent.h
Source/WebCore/xml/XMLHttpRequestProgressEvent.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 701ab79..9f4fe57 100644 (file)
@@ -1,3 +1,110 @@
+2014-12-14  Andreas Kling  <akling@apple.com>
+
+        Event construction helpers should return Ref instead of PassRefPtr.
+        <https://webkit.org/b/139625>
+
+        Reviewed by Antti Koivisto.
+
+        Change all the FooEvent::create() construction helpers to return Ref<FooEvent>
+        instead of PassRefPtr<FooEvent>.
+
+        This allows the compiler to omit null checks at each call site, since we know
+        that these functions always return valid objects.
+
+        * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
+        (WebCore::WebKitPlaybackTargetAvailabilityEvent::create):
+        * Modules/encryptedmedia/MediaKeyMessageEvent.h:
+        (WebCore::MediaKeyMessageEvent::create):
+        * Modules/encryptedmedia/MediaKeyNeededEvent.h:
+        (WebCore::MediaKeyNeededEvent::create):
+        * Modules/gamepad/GamepadEvent.h:
+        (WebCore::GamepadEvent::create):
+        * Modules/indexeddb/IDBVersionChangeEvent.h:
+        (WebCore::IDBVersionChangeEvent::create):
+        * Modules/indieui/UIRequestEvent.cpp:
+        (WebCore::UIRequestEvent::create):
+        * Modules/indieui/UIRequestEvent.h:
+        * Modules/mediastream/MediaStreamEvent.cpp:
+        (WebCore::MediaStreamEvent::create):
+        * Modules/mediastream/MediaStreamEvent.h:
+        * Modules/mediastream/MediaStreamTrackEvent.cpp:
+        (WebCore::MediaStreamTrackEvent::create):
+        * Modules/mediastream/MediaStreamTrackEvent.h:
+        * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
+        (WebCore::RTCDTMFToneChangeEvent::create):
+        * Modules/mediastream/RTCDTMFToneChangeEvent.h:
+        * Modules/mediastream/RTCDataChannelEvent.cpp:
+        (WebCore::RTCDataChannelEvent::create):
+        * Modules/mediastream/RTCDataChannelEvent.h:
+        * Modules/mediastream/RTCIceCandidateEvent.cpp:
+        (WebCore::RTCIceCandidateEvent::create):
+        * Modules/mediastream/RTCIceCandidateEvent.h:
+        * Modules/speech/SpeechSynthesisEvent.cpp:
+        (WebCore::SpeechSynthesisEvent::create):
+        * Modules/speech/SpeechSynthesisEvent.h:
+        * Modules/webaudio/AudioProcessingEvent.cpp:
+        (WebCore::AudioProcessingEvent::create):
+        * Modules/webaudio/AudioProcessingEvent.h:
+        * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
+        (WebCore::OfflineAudioCompletionEvent::create):
+        * Modules/webaudio/OfflineAudioCompletionEvent.h:
+        * Modules/websockets/CloseEvent.h:
+        (WebCore::CloseEvent::create):
+        * dom/AnimationEvent.h:
+        * dom/AutocompleteErrorEvent.h:
+        * dom/BeforeLoadEvent.h:
+        * dom/BeforeTextInsertedEvent.h:
+        * dom/BeforeUnloadEvent.h:
+        * dom/ClipboardEvent.h:
+        * dom/CompositionEvent.h:
+        * dom/CustomEvent.h:
+        * dom/DeviceMotionEvent.h:
+        * dom/DeviceOrientationEvent.h:
+        * dom/ErrorEvent.h:
+        * dom/Event.h:
+        (WebCore::Event::create):
+        * dom/FocusEvent.h:
+        * dom/HashChangeEvent.h:
+        * dom/KeyboardEvent.h:
+        * dom/MessageEvent.h:
+        * dom/MouseEvent.cpp:
+        (WebCore::MouseEvent::create):
+        (WebCore::SimulatedMouseEvent::create):
+        * dom/MouseEvent.h:
+        (WebCore::MouseEvent::create):
+        * dom/MutationEvent.h:
+        * dom/OverflowEvent.h:
+        * dom/PageTransitionEvent.h:
+        * dom/PopStateEvent.cpp:
+        (WebCore::PopStateEvent::create):
+        * dom/PopStateEvent.h:
+        * dom/ProgressEvent.h:
+        (WebCore::ProgressEvent::create):
+        * dom/TextEvent.cpp:
+        (WebCore::TextEvent::create):
+        (WebCore::TextEvent::createForPlainTextPaste):
+        (WebCore::TextEvent::createForFragmentPaste):
+        (WebCore::TextEvent::createForDrop):
+        (WebCore::TextEvent::createForDictation):
+        * dom/TextEvent.h:
+        * dom/TouchEvent.h:
+        * dom/TransitionEvent.h:
+        * dom/UIEvent.h:
+        (WebCore::UIEvent::create):
+        * dom/WebKitAnimationEvent.h:
+        * dom/WebKitTransitionEvent.h:
+        * dom/WheelEvent.h:
+        * html/MediaKeyEvent.h:
+        * html/canvas/WebGLContextEvent.h:
+        * html/track/TrackEvent.h:
+        * storage/StorageEvent.cpp:
+        (WebCore::StorageEvent::create):
+        * storage/StorageEvent.h:
+        * svg/SVGZoomEvent.h:
+        (WebCore::SVGZoomEvent::create):
+        * xml/XMLHttpRequestProgressEvent.h:
+        (WebCore::XMLHttpRequestProgressEvent::create):
+
 2014-12-14  Ryosuke Niwa  <rniwa@webkit.org>
 
         REGRESSION(r160182): Fragment parser doesn't close a form element with a close tag
index 493bd66..ece3df0 100644 (file)
@@ -44,19 +44,19 @@ class WebKitPlaybackTargetAvailabilityEvent : public Event {
 public:
     ~WebKitPlaybackTargetAvailabilityEvent() { }
 
-    static PassRefPtr<WebKitPlaybackTargetAvailabilityEvent> create()
+    static Ref<WebKitPlaybackTargetAvailabilityEvent> create()
     {
-        return adoptRef(new WebKitPlaybackTargetAvailabilityEvent);
+        return adoptRef(*new WebKitPlaybackTargetAvailabilityEvent);
     }
 
-    static PassRefPtr<WebKitPlaybackTargetAvailabilityEvent> create(const AtomicString& eventType, bool available)
+    static Ref<WebKitPlaybackTargetAvailabilityEvent> create(const AtomicString& eventType, bool available)
     {
-        return adoptRef(new WebKitPlaybackTargetAvailabilityEvent(eventType, available));
+        return adoptRef(*new WebKitPlaybackTargetAvailabilityEvent(eventType, available));
     }
 
-    static PassRefPtr<WebKitPlaybackTargetAvailabilityEvent> create(const AtomicString& eventType, const WebKitPlaybackTargetAvailabilityEventInit& initializer)
+    static Ref<WebKitPlaybackTargetAvailabilityEvent> create(const AtomicString& eventType, const WebKitPlaybackTargetAvailabilityEventInit& initializer)
     {
-        return adoptRef(new WebKitPlaybackTargetAvailabilityEvent(eventType, initializer));
+        return adoptRef(*new WebKitPlaybackTargetAvailabilityEvent(eventType, initializer));
     }
 
     String availability() const { return m_availability; }
index ac35203..bf586b2 100644 (file)
@@ -45,14 +45,14 @@ class MediaKeyMessageEvent : public Event {
 public:
     virtual ~MediaKeyMessageEvent();
 
-    static PassRefPtr<MediaKeyMessageEvent> create()
+    static Ref<MediaKeyMessageEvent> create()
     {
-        return adoptRef(new MediaKeyMessageEvent);
+        return adoptRef(*new MediaKeyMessageEvent);
     }
 
-    static PassRefPtr<MediaKeyMessageEvent> create(const AtomicString& type, const MediaKeyMessageEventInit& initializer)
+    static Ref<MediaKeyMessageEvent> create(const AtomicString& type, const MediaKeyMessageEventInit& initializer)
     {
-        return adoptRef(new MediaKeyMessageEvent(type, initializer));
+        return adoptRef(*new MediaKeyMessageEvent(type, initializer));
     }
 
     virtual EventInterface eventInterface() const override;
index a98e918..8806bc0 100644 (file)
@@ -43,14 +43,14 @@ class MediaKeyNeededEvent : public Event {
 public:
     virtual ~MediaKeyNeededEvent();
 
-    static PassRefPtr<MediaKeyNeededEvent> create()
+    static Ref<MediaKeyNeededEvent> create()
     {
-        return adoptRef(new MediaKeyNeededEvent);
+        return adoptRef(*new MediaKeyNeededEvent);
     }
 
-    static PassRefPtr<MediaKeyNeededEvent> create(const AtomicString& type, const MediaKeyNeededEventInit& initializer)
+    static Ref<MediaKeyNeededEvent> create(const AtomicString& type, const MediaKeyNeededEventInit& initializer)
     {
-        return adoptRef(new MediaKeyNeededEvent(type, initializer));
+        return adoptRef(*new MediaKeyNeededEvent(type, initializer));
     }
 
     virtual EventInterface eventInterface() const override;
index 142d2e4..81eb46e 100644 (file)
@@ -45,19 +45,19 @@ class GamepadEvent : public Event {
 public:
     ~GamepadEvent() { }
 
-    static PassRefPtr<GamepadEvent> create()
+    static Ref<GamepadEvent> create()
     {
-        return adoptRef(new GamepadEvent);
+        return adoptRef(*new GamepadEvent);
     }
 
-    static PassRefPtr<GamepadEvent> create(const AtomicString& eventType, Gamepad& gamepad)
+    static Ref<GamepadEvent> create(const AtomicString& eventType, Gamepad& gamepad)
     {
-        return adoptRef(new GamepadEvent(eventType, gamepad));
+        return adoptRef(*new GamepadEvent(eventType, gamepad));
     }
 
-    static PassRefPtr<GamepadEvent> create(const AtomicString& eventType, const GamepadEventInit& initializer)
+    static Ref<GamepadEvent> create(const AtomicString& eventType, const GamepadEventInit& initializer)
     {
-        return adoptRef(new GamepadEvent(eventType, initializer));
+        return adoptRef(*new GamepadEvent(eventType, initializer));
     }
 
     Gamepad* gamepad() const { return m_gamepad.get(); }
index c8d2008..1b2dd18 100644 (file)
@@ -38,9 +38,9 @@ namespace WebCore {
 
 class IDBVersionChangeEvent : public Event {
 public:
-    static PassRefPtr<IDBVersionChangeEvent> create(unsigned long long oldVersion = 0, unsigned long long newVersion = 0, IndexedDB::VersionNullness newVersionNullness = IndexedDB::VersionNullness::Null, const AtomicString& eventType = AtomicString())
+    static Ref<IDBVersionChangeEvent> create(unsigned long long oldVersion = 0, unsigned long long newVersion = 0, IndexedDB::VersionNullness newVersionNullness = IndexedDB::VersionNullness::Null, const AtomicString& eventType = AtomicString())
     {
-        return adoptRef(new IDBVersionChangeEvent(oldVersion, newVersion, newVersionNullness, eventType));
+        return adoptRef(*new IDBVersionChangeEvent(oldVersion, newVersion, newVersionNullness, eventType));
     }
 
     virtual ~IDBVersionChangeEvent();
index c19feb0..a4c1ec8 100644 (file)
@@ -36,19 +36,19 @@ UIRequestEventInit::UIRequestEventInit()
 {
 }
     
-PassRefPtr<UIRequestEvent> UIRequestEvent::create()
+Ref<UIRequestEvent> UIRequestEvent::create()
 {
-    return adoptRef(new UIRequestEvent);
+    return adoptRef(*new UIRequestEvent);
 }
     
-PassRefPtr<UIRequestEvent> UIRequestEvent::create(const AtomicString& type, const UIRequestEventInit& initializer)
+Ref<UIRequestEvent> UIRequestEvent::create(const AtomicString& type, const UIRequestEventInit& initializer)
 {
-    return adoptRef(new UIRequestEvent(type, initializer));
+    return adoptRef(*new UIRequestEvent(type, initializer));
 }
 
-PassRefPtr<UIRequestEvent> UIRequestEvent::create(const AtomicString& type, bool bubbles, bool cancelable, PassRefPtr<AbstractView> view, int detail, PassRefPtr<EventTarget> receiver)
+Ref<UIRequestEvent> UIRequestEvent::create(const AtomicString& type, bool bubbles, bool cancelable, PassRefPtr<AbstractView> view, int detail, PassRefPtr<EventTarget> receiver)
 {
-    return adoptRef(new UIRequestEvent(type, bubbles, cancelable, view, detail, receiver));
+    return adoptRef(*new UIRequestEvent(type, bubbles, cancelable, view, detail, receiver));
 }
 
 UIRequestEvent::UIRequestEvent(const AtomicString& type, const UIRequestEventInit& initializer)
index d83ae4e..7adc4f6 100644 (file)
@@ -41,10 +41,10 @@ struct UIRequestEventInit : public UIEventInit {
 
 class UIRequestEvent : public UIEvent {
 public:
-    static PassRefPtr<UIRequestEvent> create();
-    static PassRefPtr<UIRequestEvent> create(const AtomicString& type, bool bubbles, bool cancelable, PassRefPtr<AbstractView>, int detail, PassRefPtr<EventTarget> receiver);
+    static Ref<UIRequestEvent> create();
+    static Ref<UIRequestEvent> create(const AtomicString& type, bool bubbles, bool cancelable, PassRefPtr<AbstractView>, int detail, PassRefPtr<EventTarget> receiver);
     
-    static PassRefPtr<UIRequestEvent> create(const AtomicString& eventType, const UIRequestEventInit&);
+    static Ref<UIRequestEvent> create(const AtomicString& eventType, const UIRequestEventInit&);
     
     virtual ~UIRequestEvent();
     
index 92f6bb1..cbc0246 100644 (file)
@@ -37,19 +37,19 @@ MediaStreamEventInit::MediaStreamEventInit()
 {
 }
 
-PassRefPtr<MediaStreamEvent> MediaStreamEvent::create()
+Ref<MediaStreamEvent> MediaStreamEvent::create()
 {
-    return adoptRef(new MediaStreamEvent);
+    return adoptRef(*new MediaStreamEvent);
 }
 
-PassRefPtr<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream> stream)
+Ref<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream> stream)
 {
-    return adoptRef(new MediaStreamEvent(type, canBubble, cancelable, stream));
+    return adoptRef(*new MediaStreamEvent(type, canBubble, cancelable, stream));
 }
 
-PassRefPtr<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, const MediaStreamEventInit& initializer)
+Ref<MediaStreamEvent> MediaStreamEvent::create(const AtomicString& type, const MediaStreamEventInit& initializer)
 {
-    return adoptRef(new MediaStreamEvent(type, initializer));
+    return adoptRef(*new MediaStreamEvent(type, initializer));
 }
 
 MediaStreamEvent::MediaStreamEvent()
index bad394e..b61520e 100644 (file)
@@ -43,9 +43,9 @@ class MediaStreamEvent : public Event {
 public:
     virtual ~MediaStreamEvent();
 
-    static PassRefPtr<MediaStreamEvent> create();
-    static PassRefPtr<MediaStreamEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream>);
-    static PassRefPtr<MediaStreamEvent> create(const AtomicString& type, const MediaStreamEventInit& initializer);
+    static Ref<MediaStreamEvent> create();
+    static Ref<MediaStreamEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStream>);
+    static Ref<MediaStreamEvent> create(const AtomicString& type, const MediaStreamEventInit& initializer);
 
     MediaStream* stream() const;
 
index 6d884fc..efebebe 100644 (file)
@@ -37,19 +37,19 @@ MediaStreamTrackEventInit::MediaStreamTrackEventInit()
 {
 }
 
-PassRefPtr<MediaStreamTrackEvent> MediaStreamTrackEvent::create()
+Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create()
 {
-    return adoptRef(new MediaStreamTrackEvent);
+    return adoptRef(*new MediaStreamTrackEvent);
 }
 
-PassRefPtr<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack> track)
+Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack> track)
 {
-    return adoptRef(new MediaStreamTrackEvent(type, canBubble, cancelable, track));
+    return adoptRef(*new MediaStreamTrackEvent(type, canBubble, cancelable, track));
 }
 
-PassRefPtr<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, const MediaStreamTrackEventInit& initializer)
+Ref<MediaStreamTrackEvent> MediaStreamTrackEvent::create(const AtomicString& type, const MediaStreamTrackEventInit& initializer)
 {
-    return adoptRef(new MediaStreamTrackEvent(type, initializer));
+    return adoptRef(*new MediaStreamTrackEvent(type, initializer));
 }
 
 MediaStreamTrackEvent::MediaStreamTrackEvent()
index b0818ab..d875154 100644 (file)
@@ -44,9 +44,9 @@ class MediaStreamTrackEvent : public Event {
 public:
     virtual ~MediaStreamTrackEvent();
 
-    static PassRefPtr<MediaStreamTrackEvent> create();
-    static PassRefPtr<MediaStreamTrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack>);
-    static PassRefPtr<MediaStreamTrackEvent> create(const AtomicString& type, const MediaStreamTrackEventInit& initializer);
+    static Ref<MediaStreamTrackEvent> create();
+    static Ref<MediaStreamTrackEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<MediaStreamTrack>);
+    static Ref<MediaStreamTrackEvent> create(const AtomicString& type, const MediaStreamTrackEventInit& initializer);
 
     MediaStreamTrack* track() const;
 
index 526ef2c..cf37d4e 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create()
+Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create()
 {
-    return adoptRef(new RTCDTMFToneChangeEvent);
+    return adoptRef(*new RTCDTMFToneChangeEvent);
 }
 
-PassRefPtr<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const String& tone)
+Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const String& tone)
 {
-    return adoptRef(new RTCDTMFToneChangeEvent(tone));
+    return adoptRef(*new RTCDTMFToneChangeEvent(tone));
 }
 
-PassRefPtr<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer)
+Ref<RTCDTMFToneChangeEvent> RTCDTMFToneChangeEvent::create(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer)
 {
     ASSERT_UNUSED(type, type == eventNames().tonechangeEvent);
-    return adoptRef(new RTCDTMFToneChangeEvent(initializer));
+    return adoptRef(*new RTCDTMFToneChangeEvent(initializer));
 }
 
 RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent()
index 0693db6..01f36a8 100644 (file)
@@ -41,9 +41,9 @@ class RTCDTMFToneChangeEvent : public Event {
 public:
     virtual ~RTCDTMFToneChangeEvent();
 
-    static PassRefPtr<RTCDTMFToneChangeEvent> create();
-    static PassRefPtr<RTCDTMFToneChangeEvent> create(const String& tone);
-    static PassRefPtr<RTCDTMFToneChangeEvent> create(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer);
+    static Ref<RTCDTMFToneChangeEvent> create();
+    static Ref<RTCDTMFToneChangeEvent> create(const String& tone);
+    static Ref<RTCDTMFToneChangeEvent> create(const AtomicString& type, const RTCDTMFToneChangeEventInit& initializer);
 
     const String& tone() const;
 
index 1365813..61c9852 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<RTCDataChannelEvent> RTCDataChannelEvent::create()
+Ref<RTCDataChannelEvent> RTCDataChannelEvent::create()
 {
-    return adoptRef(new RTCDataChannelEvent);
+    return adoptRef(*new RTCDataChannelEvent);
 }
 
-PassRefPtr<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel> channel)
+Ref<RTCDataChannelEvent> RTCDataChannelEvent::create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel> channel)
 {
-    return adoptRef(new RTCDataChannelEvent(type, canBubble, cancelable, channel));
+    return adoptRef(*new RTCDataChannelEvent(type, canBubble, cancelable, channel));
 }
 
-
 RTCDataChannelEvent::RTCDataChannelEvent()
 {
 }
index 41b0036..b322c2e 100644 (file)
@@ -37,8 +37,8 @@ class RTCDataChannelEvent : public Event {
 public:
     virtual ~RTCDataChannelEvent();
 
-    static PassRefPtr<RTCDataChannelEvent> create();
-    static PassRefPtr<RTCDataChannelEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel>);
+    static Ref<RTCDataChannelEvent> create();
+    static Ref<RTCDataChannelEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<RTCDataChannel>);
 
     RTCDataChannel* channel() const;
 
index 1c28e58..178c5e0 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<RTCIceCandidateEvent> RTCIceCandidateEvent::create()
+Ref<RTCIceCandidateEvent> RTCIceCandidateEvent::create()
 {
-    return adoptRef(new RTCIceCandidateEvent);
+    return adoptRef(*new RTCIceCandidateEvent);
 }
 
-PassRefPtr<RTCIceCandidateEvent> RTCIceCandidateEvent::create(bool canBubble, bool cancelable, PassRefPtr<RTCIceCandidate> candidate)
+Ref<RTCIceCandidateEvent> RTCIceCandidateEvent::create(bool canBubble, bool cancelable, PassRefPtr<RTCIceCandidate> candidate)
 {
-    return adoptRef(new RTCIceCandidateEvent(canBubble, cancelable, candidate));
+    return adoptRef(*new RTCIceCandidateEvent(canBubble, cancelable, candidate));
 }
 
 RTCIceCandidateEvent::RTCIceCandidateEvent()
index 4666368..df90ac0 100644 (file)
@@ -37,8 +37,8 @@ class RTCIceCandidateEvent : public Event {
 public:
     virtual ~RTCIceCandidateEvent();
 
-    static PassRefPtr<RTCIceCandidateEvent> create();
-    static PassRefPtr<RTCIceCandidateEvent> create(bool canBubble, bool cancelable, PassRefPtr<RTCIceCandidate>);
+    static Ref<RTCIceCandidateEvent> create();
+    static Ref<RTCIceCandidateEvent> create(bool canBubble, bool cancelable, PassRefPtr<RTCIceCandidate>);
 
     RTCIceCandidate* candidate() const;
 
index b510d83..2fc3004 100644 (file)
 
 namespace WebCore {
     
-PassRefPtr<SpeechSynthesisEvent> SpeechSynthesisEvent::create()
+Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create()
 {
-    return adoptRef(new SpeechSynthesisEvent());
+    return adoptRef(*new SpeechSynthesisEvent());
 }
 
-PassRefPtr<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomicString& type, unsigned long charIndex, float elapsedTime, const String& name)
+Ref<SpeechSynthesisEvent> SpeechSynthesisEvent::create(const AtomicString& type, unsigned long charIndex, float elapsedTime, const String& name)
 {
-    return adoptRef(new SpeechSynthesisEvent(type, charIndex, elapsedTime, name));
+    return adoptRef(*new SpeechSynthesisEvent(type, charIndex, elapsedTime, name));
 }
 
 SpeechSynthesisEvent::SpeechSynthesisEvent()
index f97a8b9..b509640 100644 (file)
@@ -35,8 +35,8 @@ namespace WebCore {
     
 class SpeechSynthesisEvent : public Event {
 public:
-    static PassRefPtr<SpeechSynthesisEvent> create();
-    static PassRefPtr<SpeechSynthesisEvent> create(const AtomicString& type, unsigned long charIndex, float elapsedTime, const String& name);
+    static Ref<SpeechSynthesisEvent> create();
+    static Ref<SpeechSynthesisEvent> create(const AtomicString& type, unsigned long charIndex, float elapsedTime, const String& name);
     
     unsigned long charIndex() const { return m_charIndex; }
     float elapsedTime() const { return m_elapsedTime; }
index be8fece..82387ce 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<AudioProcessingEvent> AudioProcessingEvent::create()
+Ref<AudioProcessingEvent> AudioProcessingEvent::create()
 {
-    return adoptRef(new AudioProcessingEvent);
+    return adoptRef(*new AudioProcessingEvent);
 }
 
-PassRefPtr<AudioProcessingEvent> AudioProcessingEvent::create(PassRefPtr<AudioBuffer> inputBuffer, PassRefPtr<AudioBuffer> outputBuffer, double playbackTime)
+Ref<AudioProcessingEvent> AudioProcessingEvent::create(PassRefPtr<AudioBuffer> inputBuffer, PassRefPtr<AudioBuffer> outputBuffer, double playbackTime)
 {
-    return adoptRef(new AudioProcessingEvent(inputBuffer, outputBuffer, playbackTime));
+    return adoptRef(*new AudioProcessingEvent(inputBuffer, outputBuffer, playbackTime));
 }
 
 AudioProcessingEvent::AudioProcessingEvent()
index 96c88f3..80740e7 100644 (file)
@@ -36,8 +36,8 @@ class AudioBuffer;
     
 class AudioProcessingEvent : public Event {
 public:
-    static PassRefPtr<AudioProcessingEvent> create();
-    static PassRefPtr<AudioProcessingEvent> create(PassRefPtr<AudioBuffer> inputBuffer, PassRefPtr<AudioBuffer> outputBuffer, double playbackTime);
+    static Ref<AudioProcessingEvent> create();
+    static Ref<AudioProcessingEvent> create(PassRefPtr<AudioBuffer> inputBuffer, PassRefPtr<AudioBuffer> outputBuffer, double playbackTime);
     
     virtual ~AudioProcessingEvent();
 
index 7db5d78..edd8fa9 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create()
+Ref<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create()
 {
-    return adoptRef(new OfflineAudioCompletionEvent);
+    return adoptRef(*new OfflineAudioCompletionEvent);
 }
 
-PassRefPtr<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create(PassRefPtr<AudioBuffer> renderedBuffer)
+Ref<OfflineAudioCompletionEvent> OfflineAudioCompletionEvent::create(PassRefPtr<AudioBuffer> renderedBuffer)
 {
-    return adoptRef(new OfflineAudioCompletionEvent(renderedBuffer));
+    return adoptRef(*new OfflineAudioCompletionEvent(renderedBuffer));
 }
 
 OfflineAudioCompletionEvent::OfflineAudioCompletionEvent()
index 72a7b79..ed24f41 100644 (file)
@@ -36,8 +36,8 @@ class AudioBuffer;
     
 class OfflineAudioCompletionEvent : public Event {
 public:
-    static PassRefPtr<OfflineAudioCompletionEvent> create();
-    static PassRefPtr<OfflineAudioCompletionEvent> create(PassRefPtr<AudioBuffer> renderedBuffer);
+    static Ref<OfflineAudioCompletionEvent> create();
+    static Ref<OfflineAudioCompletionEvent> create(PassRefPtr<AudioBuffer> renderedBuffer);
     
     virtual ~OfflineAudioCompletionEvent();
 
index fda51d8..88fff36 100644 (file)
@@ -50,19 +50,19 @@ struct CloseEventInit : public EventInit {
 
 class CloseEvent : public Event {
 public:
-    static PassRefPtr<CloseEvent> create()
+    static Ref<CloseEvent> create()
     {
-        return adoptRef(new CloseEvent());
+        return adoptRef(*new CloseEvent());
     }
 
-    static PassRefPtr<CloseEvent> create(bool wasClean, unsigned short code, const String& reason)
+    static Ref<CloseEvent> create(bool wasClean, unsigned short code, const String& reason)
     {
-        return adoptRef(new CloseEvent(wasClean, code, reason));
+        return adoptRef(*new CloseEvent(wasClean, code, reason));
     }
 
-    static PassRefPtr<CloseEvent> create(const AtomicString& type, const CloseEventInit& initializer)
+    static Ref<CloseEvent> create(const AtomicString& type, const CloseEventInit& initializer)
     {
-        return adoptRef(new CloseEvent(type, initializer));
+        return adoptRef(*new CloseEvent(type, initializer));
     }
 
     bool wasClean() const { return m_wasClean; }
index fbf1306..7397002 100644 (file)
@@ -39,17 +39,17 @@ struct AnimationEventInit : public EventInit {
 
 class AnimationEvent final : public Event {
 public:
-    static PassRefPtr<AnimationEvent> create()
+    static Ref<AnimationEvent> create()
     {
-        return adoptRef(new AnimationEvent);
+        return adoptRef(*new AnimationEvent);
     }
-    static PassRefPtr<AnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime)
+    static Ref<AnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime)
     {
-        return adoptRef(new AnimationEvent(type, animationName, elapsedTime));
+        return adoptRef(*new AnimationEvent(type, animationName, elapsedTime));
     }
-    static PassRefPtr<AnimationEvent> create(const AtomicString& type, const AnimationEventInit& initializer)
+    static Ref<AnimationEvent> create(const AtomicString& type, const AnimationEventInit& initializer)
     {
-        return adoptRef(new AnimationEvent(type, initializer));
+        return adoptRef(*new AnimationEvent(type, initializer));
     }
 
     virtual ~AnimationEvent();
index 493eb4f..29197ed 100644 (file)
@@ -38,19 +38,19 @@ struct AutocompleteErrorEventInit : public EventInit {
 
 class AutocompleteErrorEvent final : public Event {
 public:
-    static PassRefPtr<AutocompleteErrorEvent> create()
+    static Ref<AutocompleteErrorEvent> create()
     {
         return adoptRef(new AutocompleteErrorEvent);
     }
 
-    static PassRefPtr<AutocompleteErrorEvent> create(const String& reason)
+    static Ref<AutocompleteErrorEvent> create(const String& reason)
     {
-        return adoptRef(new AutocompleteErrorEvent(reason));
+        return adoptRef(*new AutocompleteErrorEvent(reason));
     }
 
-    static PassRefPtr<AutocompleteErrorEvent> create(const AtomicString& eventType, const AutocompleteErrorEventInit& initializer)
+    static Ref<AutocompleteErrorEvent> create(const AtomicString& eventType, const AutocompleteErrorEventInit& initializer)
     {
-        return adoptRef(new AutocompleteErrorEvent(eventType, initializer));
+        return adoptRef(*new AutocompleteErrorEvent(eventType, initializer));
     }
 
     const String& reason() const { return m_reason; }
index 79373df..0d95bb3 100644 (file)
@@ -42,19 +42,19 @@ struct BeforeLoadEventInit : public EventInit {
 
 class BeforeLoadEvent final : public Event {
 public:
-    static PassRefPtr<BeforeLoadEvent> create()
+    static Ref<BeforeLoadEvent> create()
     {
-        return adoptRef(new BeforeLoadEvent);
+        return adoptRef(*new BeforeLoadEvent);
     }
 
-    static PassRefPtr<BeforeLoadEvent> create(const String& url)
+    static Ref<BeforeLoadEvent> create(const String& url)
     {
-        return adoptRef(new BeforeLoadEvent(url));
+        return adoptRef(*new BeforeLoadEvent(url));
     }
 
-    static PassRefPtr<BeforeLoadEvent> create(const AtomicString& type, const BeforeLoadEventInit& initializer)
+    static Ref<BeforeLoadEvent> create(const AtomicString& type, const BeforeLoadEventInit& initializer)
     {
-        return adoptRef(new BeforeLoadEvent(type, initializer));
+        return adoptRef(*new BeforeLoadEvent(type, initializer));
     }
 
     const String& url() const { return m_url; }
index 1e4b35d..3483a11 100644 (file)
@@ -34,9 +34,9 @@ class BeforeTextInsertedEvent final : public Event {
 public:
     virtual ~BeforeTextInsertedEvent();
 
-    static PassRefPtr<BeforeTextInsertedEvent> create(const String& text)
+    static Ref<BeforeTextInsertedEvent> create(const String& text)
     {
-        return adoptRef(new BeforeTextInsertedEvent(text));
+        return adoptRef(*new BeforeTextInsertedEvent(text));
     }
 
     virtual EventInterface eventInterface() const override;
index 5876696..aef90bf 100644 (file)
@@ -33,9 +33,9 @@ class BeforeUnloadEvent final : public Event {
 public:
     virtual ~BeforeUnloadEvent();
 
-    static PassRefPtr<BeforeUnloadEvent> create()
+    static Ref<BeforeUnloadEvent> create()
     {
-        return adoptRef(new BeforeUnloadEvent);
+        return adoptRef(*new BeforeUnloadEvent);
     }
 
     String returnValue() const { return m_returnValue; }
index db84c43..0f16a70 100644 (file)
@@ -34,13 +34,13 @@ namespace WebCore {
     public:
         virtual ~ClipboardEvent();
 
-        static PassRefPtr<ClipboardEvent> create()
+        static Ref<ClipboardEvent> create()
         {
-            return adoptRef(new ClipboardEvent);
+            return adoptRef(*new ClipboardEvent);
         }
-        static PassRefPtr<ClipboardEvent> create(const AtomicString& type, bool canBubbleArg, bool cancelableArg, PassRefPtr<DataTransfer> clipboardArg)
+        static Ref<ClipboardEvent> create(const AtomicString& type, bool canBubbleArg, bool cancelableArg, PassRefPtr<DataTransfer> clipboardArg)
         {
-            return adoptRef(new ClipboardEvent(type, canBubbleArg, cancelableArg, clipboardArg));
+            return adoptRef(*new ClipboardEvent(type, canBubbleArg, cancelableArg, clipboardArg));
         }
 
         virtual DataTransfer* internalDataTransfer() const override { return m_dataTransfer.get(); }
index fd1dd96..d7d9f10 100644 (file)
@@ -39,19 +39,19 @@ struct CompositionEventInit : UIEventInit {
 
 class CompositionEvent final : public UIEvent {
 public:
-    static PassRefPtr<CompositionEvent> create()
+    static Ref<CompositionEvent> create()
     {
-        return adoptRef(new CompositionEvent);
+        return adoptRef(*new CompositionEvent);
     }
 
-    static PassRefPtr<CompositionEvent> create(const AtomicString& type, PassRefPtr<AbstractView> view, const String& data)
+    static Ref<CompositionEvent> create(const AtomicString& type, PassRefPtr<AbstractView> view, const String& data)
     {
-        return adoptRef(new CompositionEvent(type, view, data));
+        return adoptRef(*new CompositionEvent(type, view, data));
     }
 
-    static PassRefPtr<CompositionEvent> create(const AtomicString& type, const CompositionEventInit& initializer)
+    static Ref<CompositionEvent> create(const AtomicString& type, const CompositionEventInit& initializer)
     {
-        return adoptRef(new CompositionEvent(type, initializer));
+        return adoptRef(*new CompositionEvent(type, initializer));
     }
 
     virtual ~CompositionEvent();
index a3ae28b..9940fb2 100644 (file)
@@ -42,14 +42,14 @@ class CustomEvent final : public Event {
 public:
     virtual ~CustomEvent();
 
-    static PassRefPtr<CustomEvent> create()
+    static Ref<CustomEvent> create()
     {
-        return adoptRef(new CustomEvent);
+        return adoptRef(*new CustomEvent);
     }
 
-    static PassRefPtr<CustomEvent> create(const AtomicString& type, const CustomEventInit& initializer)
+    static Ref<CustomEvent> create(const AtomicString& type, const CustomEventInit& initializer)
     {
-        return adoptRef(new CustomEvent(type, initializer));
+        return adoptRef(*new CustomEvent(type, initializer));
     }
 
     void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, const Deprecated::ScriptValue& detail);
index f78a29e..9ea5da4 100644 (file)
@@ -35,13 +35,13 @@ class DeviceMotionData;
 class DeviceMotionEvent final : public Event {
 public:
     virtual ~DeviceMotionEvent();
-    static PassRefPtr<DeviceMotionEvent> create()
+    static Ref<DeviceMotionEvent> create()
     {
-        return adoptRef(new DeviceMotionEvent);
+        return adoptRef(*new DeviceMotionEvent);
     }
-    static PassRefPtr<DeviceMotionEvent> create(const AtomicString& eventType, DeviceMotionData* deviceMotionData)
+    static Ref<DeviceMotionEvent> create(const AtomicString& eventType, DeviceMotionData* deviceMotionData)
     {
-        return adoptRef(new DeviceMotionEvent(eventType, deviceMotionData));
+        return adoptRef(*new DeviceMotionEvent(eventType, deviceMotionData));
     }
 
     void initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceMotionData*);
index 2e7d941..e044ef9 100644 (file)
@@ -35,13 +35,13 @@ class DeviceOrientationData;
 class DeviceOrientationEvent final : public Event {
 public:
     virtual ~DeviceOrientationEvent();
-    static PassRefPtr<DeviceOrientationEvent> create()
+    static Ref<DeviceOrientationEvent> create()
     {
-        return adoptRef(new DeviceOrientationEvent);
+        return adoptRef(*new DeviceOrientationEvent);
     }
-    static PassRefPtr<DeviceOrientationEvent> create(const AtomicString& eventType, DeviceOrientationData* orientation)
+    static Ref<DeviceOrientationEvent> create(const AtomicString& eventType, DeviceOrientationData* orientation)
     {
-        return adoptRef(new DeviceOrientationEvent(eventType, orientation));
+        return adoptRef(*new DeviceOrientationEvent(eventType, orientation));
     }
 
     void initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceOrientationData*);
index b51d7a6..01c6100 100644 (file)
@@ -47,17 +47,17 @@ struct ErrorEventInit : public EventInit {
 
 class ErrorEvent final : public Event {
 public:
-    static PassRefPtr<ErrorEvent> create()
+    static Ref<ErrorEvent> create()
     {
-        return adoptRef(new ErrorEvent);
+        return adoptRef(*new ErrorEvent);
     }
-    static PassRefPtr<ErrorEvent> create(const String& message, const String& fileName, unsigned lineNumber, unsigned columnNumber)
+    static Ref<ErrorEvent> create(const String& message, const String& fileName, unsigned lineNumber, unsigned columnNumber)
     {
-        return adoptRef(new ErrorEvent(message, fileName, lineNumber, columnNumber));
+        return adoptRef(*new ErrorEvent(message, fileName, lineNumber, columnNumber));
     }
-    static PassRefPtr<ErrorEvent> create(const AtomicString& type, const ErrorEventInit& initializer)
+    static Ref<ErrorEvent> create(const AtomicString& type, const ErrorEventInit& initializer)
     {
-        return adoptRef(new ErrorEvent(type, initializer));
+        return adoptRef(*new ErrorEvent(type, initializer));
     }
     virtual ~ErrorEvent();
 
index 67f426e..a7c8cd2 100644 (file)
@@ -83,18 +83,18 @@ public:
         CHANGE              = 32768
     };
 
-    static PassRefPtr<Event> create()
+    static Ref<Event> create()
     {
-        return adoptRef(new Event);
+        return adoptRef(*new Event);
     }
-    WEBCORE_EXPORT static PassRefPtr<Event> create(const AtomicString& type, bool canBubble, bool cancelable)
+    WEBCORE_EXPORT static Ref<Event> create(const AtomicString& type, bool canBubble, bool cancelable)
     {
-        return adoptRef(new Event(type, canBubble, cancelable));
+        return adoptRef(*new Event(type, canBubble, cancelable));
     }
 
-    static PassRefPtr<Event> create(const AtomicString& type, const EventInit& initializer)
+    static Ref<Event> create(const AtomicString& type, const EventInit& initializer)
     {
-        return adoptRef(new Event(type, initializer));
+        return adoptRef(*new Event(type, initializer));
     }
 
     virtual ~Event();
index f8088a8..7e84dd8 100644 (file)
@@ -41,19 +41,19 @@ struct FocusEventInit : public UIEventInit {
 
 class FocusEvent final : public UIEvent {
 public:
-    static PassRefPtr<FocusEvent> create()
+    static Ref<FocusEvent> create()
     {
-        return adoptRef(new FocusEvent);
+        return adoptRef(*new FocusEvent);
     }
 
-    static PassRefPtr<FocusEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, int detail, PassRefPtr<EventTarget> relatedTarget)
+    static Ref<FocusEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, int detail, PassRefPtr<EventTarget> relatedTarget)
     {
-        return adoptRef(new FocusEvent(type, canBubble, cancelable, view, detail, relatedTarget));
+        return adoptRef(*new FocusEvent(type, canBubble, cancelable, view, detail, relatedTarget));
     }
 
-    static PassRefPtr<FocusEvent> create(const AtomicString& type, const FocusEventInit& initializer)
+    static Ref<FocusEvent> create(const AtomicString& type, const FocusEventInit& initializer)
     {
-        return adoptRef(new FocusEvent(type, initializer));
+        return adoptRef(*new FocusEvent(type, initializer));
     }
 
     virtual EventTarget* relatedTarget() const override { return m_relatedTarget.get(); }
index 7e2ab53..e267633 100644 (file)
@@ -37,19 +37,19 @@ struct HashChangeEventInit : public EventInit {
 
 class HashChangeEvent final : public Event {
 public:
-    static PassRefPtr<HashChangeEvent> create()
+    static Ref<HashChangeEvent> create()
     {
-        return adoptRef(new HashChangeEvent);
+        return adoptRef(*new HashChangeEvent);
     }
 
-    static PassRefPtr<HashChangeEvent> create(const String& oldURL, const String& newURL)
+    static Ref<HashChangeEvent> create(const String& oldURL, const String& newURL)
     {
-        return adoptRef(new HashChangeEvent(oldURL, newURL));
+        return adoptRef(*new HashChangeEvent(oldURL, newURL));
     }
 
-    static PassRefPtr<HashChangeEvent> create(const AtomicString& type, const HashChangeEventInit& initializer)
+    static Ref<HashChangeEvent> create(const AtomicString& type, const HashChangeEventInit& initializer)
     {
-        return adoptRef(new HashChangeEvent(type, initializer));
+        return adoptRef(*new HashChangeEvent(type, initializer));
     }
 
     void initHashChangeEvent(const AtomicString& eventType, bool canBubble, bool cancelable, const String& oldURL, const String& newURL)
index 3712e83..7a8777e 100644 (file)
@@ -57,19 +57,19 @@ public:
         // DOM_KEY_LOCATION_JOYSTICK   = 0x05
     };
         
-    static PassRefPtr<KeyboardEvent> create()
+    static Ref<KeyboardEvent> create()
     {
-        return adoptRef(new KeyboardEvent);
+        return adoptRef(*new KeyboardEvent);
     }
 
-    static PassRefPtr<KeyboardEvent> create(const PlatformKeyboardEvent& platformEvent, AbstractView* view)
+    static Ref<KeyboardEvent> create(const PlatformKeyboardEvent& platformEvent, AbstractView* view)
     {
-        return adoptRef(new KeyboardEvent(platformEvent, view));
+        return adoptRef(*new KeyboardEvent(platformEvent, view));
     }
 
-    static PassRefPtr<KeyboardEvent> create(const AtomicString& type, const KeyboardEventInit& initializer)
+    static Ref<KeyboardEvent> create(const AtomicString& type, const KeyboardEventInit& initializer)
     {
-        return adoptRef(new KeyboardEvent(type, initializer));
+        return adoptRef(*new KeyboardEvent(type, initializer));
     }
 
     virtual ~KeyboardEvent();
index cba4c1f..9eb39dd 100644 (file)
@@ -53,33 +53,33 @@ struct MessageEventInit : public EventInit {
 
 class MessageEvent final : public Event {
 public:
-    static PassRefPtr<MessageEvent> create()
+    static Ref<MessageEvent> create()
     {
-        return adoptRef(new MessageEvent);
+        return adoptRef(*new MessageEvent);
     }
-    static PassRefPtr<MessageEvent> create(std::unique_ptr<MessagePortArray> ports, const Deprecated::ScriptValue& data = Deprecated::ScriptValue(), const String& origin = String(), const String& lastEventId = String(), PassRefPtr<EventTarget> source = 0)
+    static Ref<MessageEvent> create(std::unique_ptr<MessagePortArray> ports, const Deprecated::ScriptValue& data = Deprecated::ScriptValue(), const String& origin = String(), const String& lastEventId = String(), PassRefPtr<EventTarget> source = 0)
     {
-        return adoptRef(new MessageEvent(data, origin, lastEventId, source, WTF::move(ports)));
+        return adoptRef(*new MessageEvent(data, origin, lastEventId, source, WTF::move(ports)));
     }
-    static PassRefPtr<MessageEvent> create(std::unique_ptr<MessagePortArray> ports, PassRefPtr<SerializedScriptValue> data, const String& origin = String(), const String& lastEventId = String(), PassRefPtr<EventTarget> source = 0)
+    static Ref<MessageEvent> create(std::unique_ptr<MessagePortArray> ports, PassRefPtr<SerializedScriptValue> data, const String& origin = String(), const String& lastEventId = String(), PassRefPtr<EventTarget> source = 0)
     {
-        return adoptRef(new MessageEvent(data, origin, lastEventId, source, WTF::move(ports)));
+        return adoptRef(*new MessageEvent(data, origin, lastEventId, source, WTF::move(ports)));
     }
-    static PassRefPtr<MessageEvent> create(const String& data, const String& origin = String())
+    static Ref<MessageEvent> create(const String& data, const String& origin = String())
     {
-        return adoptRef(new MessageEvent(data, origin));
+        return adoptRef(*new MessageEvent(data, origin));
     }
-    static PassRefPtr<MessageEvent> create(PassRefPtr<Blob> data, const String& origin = String())
+    static Ref<MessageEvent> create(PassRefPtr<Blob> data, const String& origin = String())
     {
-        return adoptRef(new MessageEvent(data, origin));
+        return adoptRef(*new MessageEvent(data, origin));
     }
-    static PassRefPtr<MessageEvent> create(PassRefPtr<ArrayBuffer> data, const String& origin = String())
+    static Ref<MessageEvent> create(PassRefPtr<ArrayBuffer> data, const String& origin = String())
     {
-        return adoptRef(new MessageEvent(data, origin));
+        return adoptRef(*new MessageEvent(data, origin));
     }
-    static PassRefPtr<MessageEvent> create(const AtomicString& type, const MessageEventInit& initializer)
+    static Ref<MessageEvent> create(const AtomicString& type, const MessageEventInit& initializer)
     {
-        return adoptRef(new MessageEvent(type, initializer));
+        return adoptRef(*new MessageEvent(type, initializer));
     }
     virtual ~MessageEvent();
 
index 1875089..7b7cbd1 100644 (file)
@@ -47,12 +47,12 @@ MouseEventInit::MouseEventInit()
 {
 }
 
-PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& type, const MouseEventInit& initializer)
+Ref<MouseEvent> MouseEvent::create(const AtomicString& type, const MouseEventInit& initializer)
 {
-    return adoptRef(new MouseEvent(type, initializer));
+    return adoptRef(*new MouseEvent(type, initializer));
 }
 
-PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtr<AbstractView> view, const PlatformMouseEvent& event, int detail, PassRefPtr<Node> relatedTarget)
+Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtr<AbstractView> view, const PlatformMouseEvent& event, int detail, PassRefPtr<Node> relatedTarget)
 {
     ASSERT(event.type() == PlatformEvent::MouseMoved || event.button() != NoButton);
 
@@ -69,7 +69,7 @@ PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRef
         relatedTarget);
 }
 
-PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView> view,
+Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView> view,
     int detail, int screenX, int screenY, int pageX, int pageY,
 #if ENABLE(POINTER_LOCK)
     int movementX, int movementY,
@@ -86,7 +86,7 @@ PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubb
         ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, 0, false);
 }
 
-PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView> view,
+Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView> view,
     int detail, int screenX, int screenY, int pageX, int pageY,
 #if ENABLE(POINTER_LOCK)
     int movementX, int movementY,
@@ -94,7 +94,7 @@ PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubb
     bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
     PassRefPtr<EventTarget> relatedTarget, PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
 {
-    return adoptRef(new MouseEvent(type, canBubble, cancelable, timestamp, view,
+    return adoptRef(*new MouseEvent(type, canBubble, cancelable, timestamp, view,
         detail, screenX, screenY, pageX, pageY,
 #if ENABLE(POINTER_LOCK)
         movementX, movementY,
@@ -257,9 +257,9 @@ PassRefPtr<Event> MouseEvent::cloneFor(HTMLIFrameElement* iframe) const
     return clonedMouseEvent.release();
 }
 
-PassRefPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const AtomicString& eventType, PassRefPtr<AbstractView> view, PassRefPtr<Event> underlyingEvent, Element* target)
+Ref<SimulatedMouseEvent> SimulatedMouseEvent::create(const AtomicString& eventType, PassRefPtr<AbstractView> view, PassRefPtr<Event> underlyingEvent, Element* target)
 {
-    return adoptRef(new SimulatedMouseEvent(eventType, view, underlyingEvent, target));
+    return adoptRef(*new SimulatedMouseEvent(eventType, view, underlyingEvent, target));
 }
 
 SimulatedMouseEvent::~SimulatedMouseEvent()
index 1fa8a3a..9deb803 100644 (file)
@@ -48,12 +48,12 @@ struct MouseEventInit : public UIEventInit {
 
 class MouseEvent : public MouseRelatedEvent {
 public:
-    static PassRefPtr<MouseEvent> create()
+    static Ref<MouseEvent> create()
     {
-        return adoptRef(new MouseEvent);
+        return adoptRef(*new MouseEvent);
     }
 
-    WEBCORE_EXPORT static PassRefPtr<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView>,
+    WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView>,
         int detail, int screenX, int screenY, int pageX, int pageY,
 #if ENABLE(POINTER_LOCK)
         int movementX, int movementY,
@@ -61,7 +61,7 @@ public:
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
         PassRefPtr<EventTarget> relatedTarget);
 
-    WEBCORE_EXPORT static PassRefPtr<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView>,
+    WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView>,
         int detail, int screenX, int screenY, int pageX, int pageY,
 #if ENABLE(POINTER_LOCK)
         int movementX, int movementY,
@@ -69,9 +69,9 @@ public:
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
         PassRefPtr<EventTarget> relatedTarget, PassRefPtr<DataTransfer>, bool isSimulated = false);
 
-    WEBCORE_EXPORT static PassRefPtr<MouseEvent> create(const AtomicString& eventType, PassRefPtr<AbstractView>, const PlatformMouseEvent&, int detail, PassRefPtr<Node> relatedTarget);
+    WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& eventType, PassRefPtr<AbstractView>, const PlatformMouseEvent&, int detail, PassRefPtr<Node> relatedTarget);
 
-    static PassRefPtr<MouseEvent> create(const AtomicString& eventType, const MouseEventInit&);
+    static Ref<MouseEvent> create(const AtomicString& eventType, const MouseEventInit&);
 
     virtual ~MouseEvent();
 
@@ -127,7 +127,7 @@ private:
 
 class SimulatedMouseEvent final : public MouseEvent {
 public:
-    static PassRefPtr<SimulatedMouseEvent> create(const AtomicString& eventType, PassRefPtr<AbstractView>, PassRefPtr<Event> underlyingEvent, Element* target);
+    static Ref<SimulatedMouseEvent> create(const AtomicString& eventType, PassRefPtr<AbstractView>, PassRefPtr<Event> underlyingEvent, Element* target);
     virtual ~SimulatedMouseEvent();
 
 private:
index 4d05314..58f6cb5 100644 (file)
@@ -39,15 +39,15 @@ namespace WebCore {
             REMOVAL         = 3
         };
 
-        static PassRefPtr<MutationEvent> create()
+        static Ref<MutationEvent> create()
         {
-            return adoptRef(new MutationEvent);
+            return adoptRef(*new MutationEvent);
         }
 
-        static PassRefPtr<MutationEvent> create(const AtomicString& type, bool canBubble, PassRefPtr<Node> relatedNode = 0,
+        static Ref<MutationEvent> create(const AtomicString& type, bool canBubble, PassRefPtr<Node> relatedNode = 0,
             const String& prevValue = String(), const String& newValue = String(), const String& attrName = String(), unsigned short attrChange = 0)
         {
-            return adoptRef(new MutationEvent(type, canBubble, false, relatedNode, prevValue, newValue, attrName, attrChange));
+            return adoptRef(*new MutationEvent(type, canBubble, false, relatedNode, prevValue, newValue, attrName, attrChange));
         }
 
         void initMutationEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<Node> relatedNode,
index d4cd337..20edc88 100644 (file)
@@ -46,17 +46,17 @@ public:
         BOTH       = 2
     };
 
-    static PassRefPtr<OverflowEvent> create()
+    static Ref<OverflowEvent> create()
     {
-        return adoptRef(new OverflowEvent);
+        return adoptRef(*new OverflowEvent);
     }
-    static PassRefPtr<OverflowEvent> create(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow)
+    static Ref<OverflowEvent> create(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow)
     {
-        return adoptRef(new OverflowEvent(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow));
+        return adoptRef(*new OverflowEvent(horizontalOverflowChanged, horizontalOverflow, verticalOverflowChanged, verticalOverflow));
     }
-    static PassRefPtr<OverflowEvent> create(const AtomicString& type, const OverflowEventInit& initializer)
+    static Ref<OverflowEvent> create(const AtomicString& type, const OverflowEventInit& initializer)
     {
-        return adoptRef(new OverflowEvent(type, initializer));
+        return adoptRef(*new OverflowEvent(type, initializer));
     }
 
     void initOverflowEvent(unsigned short orient, bool horizontalOverflow, bool verticalOverflow);
index 8883dc4..327aeab 100644 (file)
@@ -38,17 +38,17 @@ struct PageTransitionEventInit : public EventInit {
 
 class PageTransitionEvent final : public Event {
 public:
-    static PassRefPtr<PageTransitionEvent> create()
+    static Ref<PageTransitionEvent> create()
     {
-        return adoptRef(new PageTransitionEvent);
+        return adoptRef(*new PageTransitionEvent);
     }
-    static PassRefPtr<PageTransitionEvent> create(const AtomicString& type, bool persisted)
+    static Ref<PageTransitionEvent> create(const AtomicString& type, bool persisted)
     {
-        return adoptRef(new PageTransitionEvent(type, persisted));
+        return adoptRef(*new PageTransitionEvent(type, persisted));
     }
-    static PassRefPtr<PageTransitionEvent> create(const AtomicString& type, const PageTransitionEventInit& initializer)
+    static Ref<PageTransitionEvent> create(const AtomicString& type, const PageTransitionEventInit& initializer)
     {
-        return adoptRef(new PageTransitionEvent(type, initializer));
+        return adoptRef(*new PageTransitionEvent(type, initializer));
     }
 
     virtual ~PageTransitionEvent();
index 0ff5238..dffa43d 100644 (file)
@@ -64,19 +64,19 @@ PopStateEvent::~PopStateEvent()
 {
 }
 
-PassRefPtr<PopStateEvent> PopStateEvent::create()
+Ref<PopStateEvent> PopStateEvent::create()
 {
-    return adoptRef(new PopStateEvent);
+    return adoptRef(*new PopStateEvent);
 }
 
-PassRefPtr<PopStateEvent> PopStateEvent::create(PassRefPtr<SerializedScriptValue> serializedState, PassRefPtr<History> history)
+Ref<PopStateEvent> PopStateEvent::create(PassRefPtr<SerializedScriptValue> serializedState, PassRefPtr<History> history)
 {
-    return adoptRef(new PopStateEvent(serializedState, history));
+    return adoptRef(*new PopStateEvent(serializedState, history));
 }
 
-PassRefPtr<PopStateEvent> PopStateEvent::create(const AtomicString& type, const PopStateEventInit& initializer)
+Ref<PopStateEvent> PopStateEvent::create(const AtomicString& type, const PopStateEventInit& initializer)
 {
-    return adoptRef(new PopStateEvent(type, initializer));
+    return adoptRef(*new PopStateEvent(type, initializer));
 }
 
 EventInterface PopStateEvent::eventInterface() const
index b67627c..a1e1940 100644 (file)
@@ -44,9 +44,9 @@ class SerializedScriptValue;
 class PopStateEvent final : public Event {
 public:
     virtual ~PopStateEvent();
-    static PassRefPtr<PopStateEvent> create();
-    static PassRefPtr<PopStateEvent> create(PassRefPtr<SerializedScriptValue>, PassRefPtr<History>);
-    static PassRefPtr<PopStateEvent> create(const AtomicString&, const PopStateEventInit&);
+    static Ref<PopStateEvent> create();
+    static Ref<PopStateEvent> create(PassRefPtr<SerializedScriptValue>, PassRefPtr<History>);
+    static Ref<PopStateEvent> create(const AtomicString&, const PopStateEventInit&);
 
     PassRefPtr<SerializedScriptValue> serializedState() const { return m_serializedState; }
     const Deprecated::ScriptValue& state() const { return m_state; }
index f9f1d45..05ec715 100644 (file)
@@ -40,17 +40,17 @@ struct ProgressEventInit : public EventInit {
 
 class ProgressEvent : public Event {
 public:
-    static PassRefPtr<ProgressEvent> create()
+    static Ref<ProgressEvent> create()
     {
-        return adoptRef(new ProgressEvent);
+        return adoptRef(*new ProgressEvent);
     }
-    static PassRefPtr<ProgressEvent> create(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total)
+    static Ref<ProgressEvent> create(const AtomicString& type, bool lengthComputable, unsigned long long loaded, unsigned long long total)
     {
-        return adoptRef(new ProgressEvent(type, lengthComputable, loaded, total));
+        return adoptRef(*new ProgressEvent(type, lengthComputable, loaded, total));
     }
-    static PassRefPtr<ProgressEvent> create(const AtomicString& type, const ProgressEventInit& initializer)
+    static Ref<ProgressEvent> create(const AtomicString& type, const ProgressEventInit& initializer)
     {
-        return adoptRef(new ProgressEvent(type, initializer));
+        return adoptRef(*new ProgressEvent(type, initializer));
     }
 
     bool lengthComputable() const { return m_lengthComputable; }
index 4a31411..69644a5 100644 (file)
 
 namespace WebCore {
 
-PassRefPtr<TextEvent> TextEvent::create()
+Ref<TextEvent> TextEvent::create()
 {
-    return adoptRef(new TextEvent);
+    return adoptRef(*new TextEvent);
 }
 
-PassRefPtr<TextEvent> TextEvent::create(PassRefPtr<AbstractView> view, const String& data, TextEventInputType inputType)
+Ref<TextEvent> TextEvent::create(PassRefPtr<AbstractView> view, const String& data, TextEventInputType inputType)
 {
-    return adoptRef(new TextEvent(view, data, inputType));
+    return adoptRef(*new TextEvent(view, data, inputType));
 }
 
-PassRefPtr<TextEvent> TextEvent::createForPlainTextPaste(PassRefPtr<AbstractView> view, const String& data, bool shouldSmartReplace)
+Ref<TextEvent> TextEvent::createForPlainTextPaste(PassRefPtr<AbstractView> view, const String& data, bool shouldSmartReplace)
 {
-    return adoptRef(new TextEvent(view, data, 0, shouldSmartReplace, false, MailBlockquoteHandling::RespectBlockquote));
+    return adoptRef(*new TextEvent(view, data, 0, shouldSmartReplace, false, MailBlockquoteHandling::RespectBlockquote));
 }
 
-PassRefPtr<TextEvent> TextEvent::createForFragmentPaste(PassRefPtr<AbstractView> view, PassRefPtr<DocumentFragment> data, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling mailBlockquoteHandling)
+Ref<TextEvent> TextEvent::createForFragmentPaste(PassRefPtr<AbstractView> view, PassRefPtr<DocumentFragment> data, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling mailBlockquoteHandling)
 {
-    return adoptRef(new TextEvent(view, "", data, shouldSmartReplace, shouldMatchStyle, mailBlockquoteHandling));
+    return adoptRef(*new TextEvent(view, "", data, shouldSmartReplace, shouldMatchStyle, mailBlockquoteHandling));
 }
 
-PassRefPtr<TextEvent> TextEvent::createForDrop(PassRefPtr<AbstractView> view, const String& data)
+Ref<TextEvent> TextEvent::createForDrop(PassRefPtr<AbstractView> view, const String& data)
 {
-    return adoptRef(new TextEvent(view, data, TextEventInputDrop));
+    return adoptRef(*new TextEvent(view, data, TextEventInputDrop));
 }
 
-PassRefPtr<TextEvent> TextEvent::createForDictation(PassRefPtr<AbstractView> view, const String& data, const Vector<DictationAlternative>& dictationAlternatives)
+Ref<TextEvent> TextEvent::createForDictation(PassRefPtr<AbstractView> view, const String& data, const Vector<DictationAlternative>& dictationAlternatives)
 {
-    return adoptRef(new TextEvent(view, data, dictationAlternatives));
+    return adoptRef(*new TextEvent(view, data, dictationAlternatives));
 }
 
 TextEvent::TextEvent()
index aef573a..df08b19 100644 (file)
@@ -40,12 +40,12 @@ namespace WebCore {
     class TextEvent final : public UIEvent {
     public:
 
-        static PassRefPtr<TextEvent> create();
-        static PassRefPtr<TextEvent> create(PassRefPtr<AbstractView>, const String& data, TextEventInputType = TextEventInputKeyboard);
-        static PassRefPtr<TextEvent> createForPlainTextPaste(PassRefPtr<AbstractView>, const String& data, bool shouldSmartReplace);
-        static PassRefPtr<TextEvent> createForFragmentPaste(PassRefPtr<AbstractView>, PassRefPtr<DocumentFragment> data, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling);
-        static PassRefPtr<TextEvent> createForDrop(PassRefPtr<AbstractView>, const String& data);
-        static PassRefPtr<TextEvent> createForDictation(PassRefPtr<AbstractView>, const String& data, const Vector<DictationAlternative>& dictationAlternatives);
+        static Ref<TextEvent> create();
+        static Ref<TextEvent> create(PassRefPtr<AbstractView>, const String& data, TextEventInputType = TextEventInputKeyboard);
+        static Ref<TextEvent> createForPlainTextPaste(PassRefPtr<AbstractView>, const String& data, bool shouldSmartReplace);
+        static Ref<TextEvent> createForFragmentPaste(PassRefPtr<AbstractView>, PassRefPtr<DocumentFragment> data, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling);
+        static Ref<TextEvent> createForDrop(PassRefPtr<AbstractView>, const String& data);
+        static Ref<TextEvent> createForDictation(PassRefPtr<AbstractView>, const String& data, const Vector<DictationAlternative>& dictationAlternatives);
 
         virtual ~TextEvent();
     
index aa06795..bcf09a1 100644 (file)
@@ -40,9 +40,9 @@ class TouchEvent final : public MouseRelatedEvent {
 public:
     virtual ~TouchEvent();
 
-    static PassRefPtr<TouchEvent> create()
+    static Ref<TouchEvent> create()
     {
-        return adoptRef(new TouchEvent);
+        return adoptRef(*new TouchEvent);
     }
     static PassRefPtr<TouchEvent> create(TouchList* touches, 
             TouchList* targetTouches, TouchList* changedTouches, 
index 3eadb22..42a8fed 100644 (file)
@@ -41,17 +41,17 @@ struct TransitionEventInit : public EventInit {
 
 class TransitionEvent final : public Event {
 public:
-    static PassRefPtr<TransitionEvent> create()
+    static Ref<TransitionEvent> create()
     {
-        return adoptRef(new TransitionEvent);
+        return adoptRef(*new TransitionEvent);
     }
-    static PassRefPtr<TransitionEvent> create(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement)
+    static Ref<TransitionEvent> create(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement)
     {
-        return adoptRef(new TransitionEvent(type, propertyName, elapsedTime, pseudoElement));
+        return adoptRef(*new TransitionEvent(type, propertyName, elapsedTime, pseudoElement));
     }
-    static PassRefPtr<TransitionEvent> create(const AtomicString& type, const TransitionEventInit& initializer)
+    static Ref<TransitionEvent> create(const AtomicString& type, const TransitionEventInit& initializer)
     {
-        return adoptRef(new TransitionEvent(type, initializer));
+        return adoptRef(*new TransitionEvent(type, initializer));
     }
 
     virtual ~TransitionEvent();
index f9fe144..6690fef 100644 (file)
@@ -41,17 +41,17 @@ struct UIEventInit : public EventInit {
 
 class UIEvent : public Event {
 public:
-    static PassRefPtr<UIEvent> create()
+    static Ref<UIEvent> create()
     {
-        return adoptRef(new UIEvent);
+        return adoptRef(*new UIEvent);
     }
-    static PassRefPtr<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, int detail)
+    static Ref<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, int detail)
     {
-        return adoptRef(new UIEvent(type, canBubble, cancelable, view, detail));
+        return adoptRef(*new UIEvent(type, canBubble, cancelable, view, detail));
     }
-    static PassRefPtr<UIEvent> create(const AtomicString& type, const UIEventInit& initializer)
+    static Ref<UIEvent> create(const AtomicString& type, const UIEventInit& initializer)
     {
-        return adoptRef(new UIEvent(type, initializer));
+        return adoptRef(*new UIEvent(type, initializer));
     }
     virtual ~UIEvent();
 
index 2a317f4..dbc9780 100644 (file)
@@ -39,17 +39,17 @@ struct WebKitAnimationEventInit : public EventInit {
 
 class WebKitAnimationEvent final : public Event {
 public:
-    static PassRefPtr<WebKitAnimationEvent> create()
+    static Ref<WebKitAnimationEvent> create()
     {
-        return adoptRef(new WebKitAnimationEvent);
+        return adoptRef(*new WebKitAnimationEvent);
     }
-    static PassRefPtr<WebKitAnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime)
+    static Ref<WebKitAnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime)
     {
-        return adoptRef(new WebKitAnimationEvent(type, animationName, elapsedTime));
+        return adoptRef(*new WebKitAnimationEvent(type, animationName, elapsedTime));
     }
-    static PassRefPtr<WebKitAnimationEvent> create(const AtomicString& type, const WebKitAnimationEventInit& initializer)
+    static Ref<WebKitAnimationEvent> create(const AtomicString& type, const WebKitAnimationEventInit& initializer)
     {
-        return adoptRef(new WebKitAnimationEvent(type, initializer));
+        return adoptRef(*new WebKitAnimationEvent(type, initializer));
     }
 
     virtual ~WebKitAnimationEvent();
index c1df372..afd9749 100644 (file)
@@ -40,17 +40,17 @@ struct WebKitTransitionEventInit : public EventInit {
 
 class WebKitTransitionEvent final : public Event {
 public:
-    static PassRefPtr<WebKitTransitionEvent> create()
+    static Ref<WebKitTransitionEvent> create()
     {
-        return adoptRef(new WebKitTransitionEvent);
+        return adoptRef(*new WebKitTransitionEvent);
     }
-    static PassRefPtr<WebKitTransitionEvent> create(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement)
+    static Ref<WebKitTransitionEvent> create(const AtomicString& type, const String& propertyName, double elapsedTime, const String& pseudoElement)
     {
-        return adoptRef(new WebKitTransitionEvent(type, propertyName, elapsedTime, pseudoElement));
+        return adoptRef(*new WebKitTransitionEvent(type, propertyName, elapsedTime, pseudoElement));
     }
-    static PassRefPtr<WebKitTransitionEvent> create(const AtomicString& type, const WebKitTransitionEventInit& initializer)
+    static Ref<WebKitTransitionEvent> create(const AtomicString& type, const WebKitTransitionEventInit& initializer)
     {
-        return adoptRef(new WebKitTransitionEvent(type, initializer));
+        return adoptRef(*new WebKitTransitionEvent(type, initializer));
     }
 
     virtual ~WebKitTransitionEvent();
index 94ccf43..5d15bbd 100644 (file)
@@ -54,19 +54,19 @@ public:
         DOM_DELTA_PAGE
     };
 
-    static PassRefPtr<WheelEvent> create()
+    static Ref<WheelEvent> create()
     {
-        return adoptRef(new WheelEvent);
+        return adoptRef(*new WheelEvent);
     }
 
-    static PassRefPtr<WheelEvent> create(const AtomicString& type, const WheelEventInit& initializer)
+    static Ref<WheelEvent> create(const AtomicString& type, const WheelEventInit& initializer)
     {
-        return adoptRef(new WheelEvent(type, initializer));
+        return adoptRef(*new WheelEvent(type, initializer));
     }
 
-    static PassRefPtr<WheelEvent> create(const PlatformWheelEvent& event, PassRefPtr<AbstractView> view)
+    static Ref<WheelEvent> create(const PlatformWheelEvent& event, PassRefPtr<AbstractView> view)
     {
-        return adoptRef(new WheelEvent(event, view));
+        return adoptRef(*new WheelEvent(event, view));
     }
 
     void initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView>,
index 80aef0c..774de30 100644 (file)
@@ -49,14 +49,14 @@ class MediaKeyEvent final : public Event {
 public:
     virtual ~MediaKeyEvent();
 
-    static PassRefPtr<MediaKeyEvent> create()
+    static Ref<MediaKeyEvent> create()
     {
-        return adoptRef(new MediaKeyEvent);
+        return adoptRef(*new MediaKeyEvent);
     }
 
-    static PassRefPtr<MediaKeyEvent> create(const AtomicString& type, const MediaKeyEventInit& initializer)
+    static Ref<MediaKeyEvent> create(const AtomicString& type, const MediaKeyEventInit& initializer)
     {
-        return adoptRef(new MediaKeyEvent(type, initializer));
+        return adoptRef(*new MediaKeyEvent(type, initializer));
     }
 
     virtual EventInterface eventInterface() const override;
index d7529f0..20565e6 100644 (file)
@@ -38,17 +38,17 @@ struct WebGLContextEventInit : public EventInit {
 
 class WebGLContextEvent final : public Event {
 public:
-    static PassRefPtr<WebGLContextEvent> create()
+    static Ref<WebGLContextEvent> create()
     {
-        return adoptRef(new WebGLContextEvent);
+        return adoptRef(*new WebGLContextEvent);
     }
-    static PassRefPtr<WebGLContextEvent> create(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage)
+    static Ref<WebGLContextEvent> create(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage)
     {
-        return adoptRef(new WebGLContextEvent(type, canBubble, cancelable, statusMessage));
+        return adoptRef(*new WebGLContextEvent(type, canBubble, cancelable, statusMessage));
     }
-    static PassRefPtr<WebGLContextEvent> create(const AtomicString& type, const WebGLContextEventInit& initializer)
+    static Ref<WebGLContextEvent> create(const AtomicString& type, const WebGLContextEventInit& initializer)
     {
-        return adoptRef(new WebGLContextEvent(type, initializer));
+        return adoptRef(*new WebGLContextEvent(type, initializer));
     }
     virtual ~WebGLContextEvent();
 
index aae7d82..ca40831 100644 (file)
@@ -43,14 +43,14 @@ class TrackEvent final : public Event {
 public:
     virtual ~TrackEvent();
 
-    static PassRefPtr<TrackEvent> create()
+    static Ref<TrackEvent> create()
     {
-        return adoptRef(new TrackEvent);
+        return adoptRef(*new TrackEvent);
     }
 
-    static PassRefPtr<TrackEvent> create(const AtomicString& type, const TrackEventInit& initializer)
+    static Ref<TrackEvent> create(const AtomicString& type, const TrackEventInit& initializer)
     {
-        return adoptRef(new TrackEvent(type, initializer));
+        return adoptRef(*new TrackEvent(type, initializer));
     }
 
     virtual EventInterface eventInterface() const override;
index e7d73d5..ed1171b 100644 (file)
@@ -35,9 +35,9 @@ StorageEventInit::StorageEventInit()
 {
 }
 
-PassRefPtr<StorageEvent> StorageEvent::create()
+Ref<StorageEvent> StorageEvent::create()
 {
-    return adoptRef(new StorageEvent);
+    return adoptRef(*new StorageEvent);
 }
 
 StorageEvent::StorageEvent()
@@ -48,14 +48,14 @@ StorageEvent::~StorageEvent()
 {
 }
 
-PassRefPtr<StorageEvent> StorageEvent::create(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea)
+Ref<StorageEvent> StorageEvent::create(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea)
 {
-    return adoptRef(new StorageEvent(type, key, oldValue, newValue, url, storageArea));
+    return adoptRef(*new StorageEvent(type, key, oldValue, newValue, url, storageArea));
 }
 
-PassRefPtr<StorageEvent> StorageEvent::create(const AtomicString& type, const StorageEventInit& initializer)
+Ref<StorageEvent> StorageEvent::create(const AtomicString& type, const StorageEventInit& initializer)
 {
-    return adoptRef(new StorageEvent(type, initializer));
+    return adoptRef(*new StorageEvent(type, initializer));
 }
 
 StorageEvent::StorageEvent(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea)
index 783a626..962a427 100644 (file)
@@ -45,9 +45,9 @@ struct StorageEventInit : public EventInit {
 
 class StorageEvent : public Event {
 public:
-    static PassRefPtr<StorageEvent> create();
-    static PassRefPtr<StorageEvent> create(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea);
-    static PassRefPtr<StorageEvent> create(const AtomicString&, const StorageEventInit&);
+    static Ref<StorageEvent> create();
+    static Ref<StorageEvent> create(const AtomicString& type, const String& key, const String& oldValue, const String& newValue, const String& url, Storage* storageArea);
+    static Ref<StorageEvent> create(const AtomicString&, const StorageEventInit&);
     virtual ~StorageEvent();
 
     const String& key() const { return m_key; }
index 4d1bf18..a03abda 100644 (file)
@@ -30,7 +30,7 @@ namespace WebCore {
 
 class SVGZoomEvent : public UIEvent {
 public:
-    static PassRefPtr<SVGZoomEvent> create() { return adoptRef(new SVGZoomEvent); }
+    static Ref<SVGZoomEvent> create() { return adoptRef(*new SVGZoomEvent); }
 
     // 'SVGZoomEvent' functions
     FloatRect zoomRectScreen() const;
index 4d58150..967026e 100644 (file)
@@ -33,13 +33,13 @@ namespace WebCore {
 
 class XMLHttpRequestProgressEvent : public ProgressEvent {
 public:
-    static PassRefPtr<XMLHttpRequestProgressEvent> create()
+    static Ref<XMLHttpRequestProgressEvent> create()
     {
-        return adoptRef(new XMLHttpRequestProgressEvent);
+        return adoptRef(*new XMLHttpRequestProgressEvent);
     }
-    static PassRefPtr<XMLHttpRequestProgressEvent> create(const AtomicString& type, bool lengthComputable = false, unsigned long long loaded = 0, unsigned long long total = 0)
+    static Ref<XMLHttpRequestProgressEvent> create(const AtomicString& type, bool lengthComputable = false, unsigned long long loaded = 0, unsigned long long total = 0)
     {
-        return adoptRef(new XMLHttpRequestProgressEvent(type, lengthComputable, loaded, total));
+        return adoptRef(*new XMLHttpRequestProgressEvent(type, lengthComputable, loaded, total));
     }
 
     // Those 2 synonyms are included for compatibility with Firefox.
index 49a9c34..befd785 100644 (file)
@@ -2252,7 +2252,7 @@ void WebPage::setInitialFocus(bool forward, bool isKeyboardEventValid, const Web
     if (isKeyboardEventValid && event.type() == WebEvent::KeyDown) {
         PlatformKeyboardEvent platformEvent(platform(event));
         platformEvent.disambiguateKeyDownEvent(PlatformEvent::RawKeyDown);
-        m_page->focusController().setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, KeyboardEvent::create(platformEvent, frame.document()->defaultView()).get());
+        m_page->focusController().setInitialFocus(forward ? FocusDirectionForward : FocusDirectionBackward, &KeyboardEvent::create(platformEvent, frame.document()->defaultView()).get());
         return;
     }