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)
commitd52c2d938bcd5cf68d13d0dd25895eba2ab2bc99
treeba9f39ee0653721857a63f387718a4b01dd77c6e
parent6ab1f1a0ba0897722652cefc6c821d1b72398660
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):

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