Purge PassRefPtr in WebCore/html
authorgyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 May 2015 01:20:48 +0000 (01:20 +0000)
committergyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 May 2015 01:20:48 +0000 (01:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144543

Reviewed by Andreas Kling.

Change PassRefPtr in create() factory functions with Ref. In some functions,
it returns RefPtr when it might have a chance to return nullptr.

No new tests, no behavior changes.

* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::sendError):
* html/DOMFormData.h:
(WebCore::DOMFormData::create):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
* html/HTMLMediaElement.h:
* html/MediaError.h:
(WebCore::MediaError::create):
* html/MediaKeyError.h:
(WebCore::MediaKeyError::create):
* html/canvas/CanvasGradient.h:
* html/canvas/CanvasProxy.cpp:
(WebCore::CanvasProxy::create):
* html/canvas/CanvasProxy.h:
* html/canvas/WebGLActiveInfo.h:
(WebCore::WebGLActiveInfo::create):
* html/canvas/WebGLContextAttributes.h:
* html/canvas/WebGLContextGroup.h:
* html/canvas/WebGLProgram.h:
* html/canvas/WebGLQuery.h:
* html/canvas/WebGLRenderbuffer.h:
* html/canvas/WebGLSampler.h:
* html/canvas/WebGLShader.h:
* html/canvas/WebGLShaderPrecisionFormat.h:
* html/canvas/WebGLSync.h:
* html/canvas/WebGLTexture.h:
* html/canvas/WebGLTransformFeedback.h:
* html/canvas/WebGLUniformLocation.h:
* html/canvas/WebGLVertexArrayObjectOES.h:
* html/shadow/ImageControlsRootElement.cpp:
(WebCore::ImageControlsRootElement::maybeCreate):
* html/shadow/ImageControlsRootElement.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::create):
(WebCore::MediaControlPanelEnclosureElement::create):
(WebCore::MediaControlOverlayEnclosureElement::create):
(WebCore::MediaControlTimelineContainerElement::create):
(WebCore::MediaControlVolumeSliderContainerElement::create):
(WebCore::MediaControlStatusDisplayElement::create):
(WebCore::MediaControlPanelMuteButtonElement::create):
(WebCore::MediaControlVolumeSliderMuteButtonElement::create):
(WebCore::MediaControlPlayButtonElement::create):
(WebCore::MediaControlOverlayPlayButtonElement::create):
(WebCore::MediaControlSeekForwardButtonElement::create):
(WebCore::MediaControlSeekBackButtonElement::create):
(WebCore::MediaControlRewindButtonElement::create):
(WebCore::MediaControlReturnToRealtimeButtonElement::create):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
(WebCore::MediaControlClosedCaptionsContainerElement::create):
(WebCore::MediaControlClosedCaptionsTrackListElement::create):
(WebCore::MediaControlTimelineElement::create):
(WebCore::MediaControlPanelVolumeSliderElement::create):
(WebCore::MediaControlFullscreenVolumeSliderElement::create):
(WebCore::MediaControlFullscreenButtonElement::create):
(WebCore::MediaControlFullscreenVolumeMinButtonElement::create):
(WebCore::MediaControlFullscreenVolumeMaxButtonElement::create):
(WebCore::MediaControlTimeRemainingDisplayElement::create):
(WebCore::MediaControlCurrentTimeDisplayElement::create):
* html/shadow/MediaControlElements.h:
* html/shadow/MediaControlsApple.h:
(WebCore::MediaControlsAppleEventListener::create):
* html/shadow/MeterShadowElement.h:
(WebCore::MeterInnerElement::create):
(WebCore::MeterBarElement::create):
(WebCore::MeterValueElement::create):
* html/shadow/ProgressShadowElement.h:
(WebCore::ProgressInnerElement::create):
(WebCore::ProgressBarElement::create):
(WebCore::ProgressValueElement::create):
* html/shadow/mac/ImageControlsRootElementMac.cpp:
(WebCore::ImageControlsRootElement::maybeCreate):
* html/track/TextTrackCueList.h:
(WebCore::TextTrackCueList::create):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::create):
* html/track/VTTCue.h:
(WebCore::VTTCue::create):
* html/track/VTTRegion.h:
* html/track/VideoTrack.h:
* html/track/VideoTrackList.h:
* html/track/WebVTTElement.cpp:
(WebCore::WebVTTElement::create):
* html/track/WebVTTElement.h:
* html/track/WebVTTParser.h:
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerCreateResourceLoader):

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

42 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
Source/WebCore/html/DOMFormData.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/MediaError.h
Source/WebCore/html/MediaKeyError.h
Source/WebCore/html/canvas/CanvasGradient.h
Source/WebCore/html/canvas/CanvasProxy.cpp
Source/WebCore/html/canvas/CanvasProxy.h
Source/WebCore/html/canvas/WebGLActiveInfo.h
Source/WebCore/html/canvas/WebGLContextAttributes.h
Source/WebCore/html/canvas/WebGLContextGroup.h
Source/WebCore/html/canvas/WebGLProgram.h
Source/WebCore/html/canvas/WebGLQuery.h
Source/WebCore/html/canvas/WebGLRenderbuffer.h
Source/WebCore/html/canvas/WebGLSampler.h
Source/WebCore/html/canvas/WebGLShader.h
Source/WebCore/html/canvas/WebGLShaderPrecisionFormat.h
Source/WebCore/html/canvas/WebGLSync.h
Source/WebCore/html/canvas/WebGLTexture.h
Source/WebCore/html/canvas/WebGLTransformFeedback.h
Source/WebCore/html/canvas/WebGLUniformLocation.h
Source/WebCore/html/canvas/WebGLVertexArrayObjectOES.h
Source/WebCore/html/shadow/ImageControlsRootElement.cpp
Source/WebCore/html/shadow/ImageControlsRootElement.h
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MediaControlElements.h
Source/WebCore/html/shadow/MediaControlsApple.h
Source/WebCore/html/shadow/MeterShadowElement.h
Source/WebCore/html/shadow/ProgressShadowElement.h
Source/WebCore/html/shadow/mac/ImageControlsRootElementMac.cpp
Source/WebCore/html/track/TextTrackCueList.h
Source/WebCore/html/track/VTTCue.cpp
Source/WebCore/html/track/VTTCue.h
Source/WebCore/html/track/VTTRegion.h
Source/WebCore/html/track/VideoTrack.h
Source/WebCore/html/track/VideoTrackList.h
Source/WebCore/html/track/WebVTTElement.cpp
Source/WebCore/html/track/WebVTTElement.h
Source/WebCore/html/track/WebVTTParser.h
Source/WebCore/platform/graphics/MediaPlayer.h

index e6ee537..b6f997b 100644 (file)
@@ -1,3 +1,103 @@
+2015-05-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
+
+        Purge PassRefPtr in WebCore/html
+        https://bugs.webkit.org/show_bug.cgi?id=144543
+
+        Reviewed by Andreas Kling.
+
+        Change PassRefPtr in create() factory functions with Ref. In some functions,
+        it returns RefPtr when it might have a chance to return nullptr.
+
+        No new tests, no behavior changes.
+
+        * Modules/encryptedmedia/MediaKeySession.cpp:
+        (WebCore::MediaKeySession::sendError):
+        * html/DOMFormData.h:
+        (WebCore::DOMFormData::create):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
+        * html/HTMLMediaElement.h:
+        * html/MediaError.h:
+        (WebCore::MediaError::create):
+        * html/MediaKeyError.h:
+        (WebCore::MediaKeyError::create):
+        * html/canvas/CanvasGradient.h:
+        * html/canvas/CanvasProxy.cpp:
+        (WebCore::CanvasProxy::create):
+        * html/canvas/CanvasProxy.h:
+        * html/canvas/WebGLActiveInfo.h:
+        (WebCore::WebGLActiveInfo::create):
+        * html/canvas/WebGLContextAttributes.h:
+        * html/canvas/WebGLContextGroup.h:
+        * html/canvas/WebGLProgram.h:
+        * html/canvas/WebGLQuery.h:
+        * html/canvas/WebGLRenderbuffer.h:
+        * html/canvas/WebGLSampler.h:
+        * html/canvas/WebGLShader.h:
+        * html/canvas/WebGLShaderPrecisionFormat.h:
+        * html/canvas/WebGLSync.h:
+        * html/canvas/WebGLTexture.h:
+        * html/canvas/WebGLTransformFeedback.h:
+        * html/canvas/WebGLUniformLocation.h:
+        * html/canvas/WebGLVertexArrayObjectOES.h:
+        * html/shadow/ImageControlsRootElement.cpp:
+        (WebCore::ImageControlsRootElement::maybeCreate):
+        * html/shadow/ImageControlsRootElement.h:
+        * html/shadow/MediaControlElements.cpp:
+        (WebCore::MediaControlPanelElement::create):
+        (WebCore::MediaControlPanelEnclosureElement::create):
+        (WebCore::MediaControlOverlayEnclosureElement::create):
+        (WebCore::MediaControlTimelineContainerElement::create):
+        (WebCore::MediaControlVolumeSliderContainerElement::create):
+        (WebCore::MediaControlStatusDisplayElement::create):
+        (WebCore::MediaControlPanelMuteButtonElement::create):
+        (WebCore::MediaControlVolumeSliderMuteButtonElement::create):
+        (WebCore::MediaControlPlayButtonElement::create):
+        (WebCore::MediaControlOverlayPlayButtonElement::create):
+        (WebCore::MediaControlSeekForwardButtonElement::create):
+        (WebCore::MediaControlSeekBackButtonElement::create):
+        (WebCore::MediaControlRewindButtonElement::create):
+        (WebCore::MediaControlReturnToRealtimeButtonElement::create):
+        (WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
+        (WebCore::MediaControlClosedCaptionsContainerElement::create):
+        (WebCore::MediaControlClosedCaptionsTrackListElement::create):
+        (WebCore::MediaControlTimelineElement::create):
+        (WebCore::MediaControlPanelVolumeSliderElement::create):
+        (WebCore::MediaControlFullscreenVolumeSliderElement::create):
+        (WebCore::MediaControlFullscreenButtonElement::create):
+        (WebCore::MediaControlFullscreenVolumeMinButtonElement::create):
+        (WebCore::MediaControlFullscreenVolumeMaxButtonElement::create):
+        (WebCore::MediaControlTimeRemainingDisplayElement::create):
+        (WebCore::MediaControlCurrentTimeDisplayElement::create):
+        * html/shadow/MediaControlElements.h:
+        * html/shadow/MediaControlsApple.h:
+        (WebCore::MediaControlsAppleEventListener::create):
+        * html/shadow/MeterShadowElement.h:
+        (WebCore::MeterInnerElement::create):
+        (WebCore::MeterBarElement::create):
+        (WebCore::MeterValueElement::create):
+        * html/shadow/ProgressShadowElement.h:
+        (WebCore::ProgressInnerElement::create):
+        (WebCore::ProgressBarElement::create):
+        (WebCore::ProgressValueElement::create):
+        * html/shadow/mac/ImageControlsRootElementMac.cpp:
+        (WebCore::ImageControlsRootElement::maybeCreate):
+        * html/track/TextTrackCueList.h:
+        (WebCore::TextTrackCueList::create):
+        * html/track/VTTCue.cpp:
+        (WebCore::VTTCue::create):
+        * html/track/VTTCue.h:
+        (WebCore::VTTCue::create):
+        * html/track/VTTRegion.h:
+        * html/track/VideoTrack.h:
+        * html/track/VideoTrackList.h:
+        * html/track/WebVTTElement.cpp:
+        (WebCore::WebVTTElement::create):
+        * html/track/WebVTTElement.h:
+        * html/track/WebVTTParser.h:
+        * platform/graphics/MediaPlayer.h:
+        (WebCore::MediaPlayerClient::mediaPlayerCreateResourceLoader):
+
 2015-05-03  Simon Fraser  <simon.fraser@apple.com>
 
         Make some static data const
index 6312b48..deb1c03 100644 (file)
@@ -221,8 +221,8 @@ void MediaKeySession::sendMessage(Uint8Array* message, String destinationURL)
 
 void MediaKeySession::sendError(CDMSessionClient::MediaKeyErrorCode errorCode, unsigned long systemCode)
 {
-    RefPtr<MediaKeyError> error = MediaKeyError::create(errorCode, systemCode).get();
-    setError(error.get());
+    Ref<MediaKeyError> error = MediaKeyError::create(errorCode, systemCode).get();
+    setError(error.ptr());
 
     RefPtr<Event> keyerrorEvent = Event::create(eventNames().webkitkeyerrorEvent, false, false);
     keyerrorEvent->setTarget(this);
index 842e62b..63f9313 100644 (file)
@@ -44,8 +44,8 @@ class TextEncoding;
 
 class DOMFormData : public FormDataList, public RefCounted<DOMFormData> {
 public:
-    static PassRefPtr<DOMFormData> create(HTMLFormElement* form) { return adoptRef(new DOMFormData(form)); }
-    static PassRefPtr<DOMFormData> create(const TextEncoding& encoding) { return adoptRef(new DOMFormData(encoding)); }
+    static Ref<DOMFormData> create(HTMLFormElement* form) { return adoptRef(*new DOMFormData(form)); }
+    static Ref<DOMFormData> create(const TextEncoding& encoding) { return adoptRef(*new DOMFormData(encoding)); }
 
     void append(const String& name, const String& value);
     void append(const String& name, Blob*, const String& filename = String());
index c0cba48..d43de02 100644 (file)
@@ -5814,9 +5814,9 @@ CachedResourceLoader* HTMLMediaElement::mediaPlayerCachedResourceLoader()
     return &document().cachedResourceLoader();
 }
 
-PassRefPtr<PlatformMediaResourceLoader> HTMLMediaElement::mediaPlayerCreateResourceLoader(std::unique_ptr<PlatformMediaResourceLoaderClient> client)
+RefPtr<PlatformMediaResourceLoader> HTMLMediaElement::mediaPlayerCreateResourceLoader(std::unique_ptr<PlatformMediaResourceLoaderClient> client)
 {
-    return adoptRef(new MediaResourceLoader(document(), fastGetAttribute(HTMLNames::crossoriginAttr), WTF::move(client)));
+    return adoptRef(*new MediaResourceLoader(document(), fastGetAttribute(HTMLNames::crossoriginAttr), WTF::move(client)));
 }
 
 bool HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge& challenge)
index bf1101f..eed4264 100644 (file)
@@ -588,7 +588,7 @@ private:
     virtual bool mediaPlayerIsPaused() const override;
     virtual bool mediaPlayerIsLooping() const override;
     virtual CachedResourceLoader* mediaPlayerCachedResourceLoader() override;
-    virtual PassRefPtr<PlatformMediaResourceLoader> mediaPlayerCreateResourceLoader(std::unique_ptr<PlatformMediaResourceLoaderClient>) override;
+    virtual RefPtr<PlatformMediaResourceLoader> mediaPlayerCreateResourceLoader(std::unique_ptr<PlatformMediaResourceLoaderClient>) override;
 
 #if PLATFORM(WIN) && USE(AVFOUNDATION)
     virtual GraphicsDeviceAdapter* mediaPlayerGraphicsDeviceAdapter(const MediaPlayer*) const override;
index db22d00..9544e55 100644 (file)
@@ -45,7 +45,7 @@ public:
 #endif
     };
 
-    static PassRefPtr<MediaError> create(Code code) { return adoptRef(new MediaError(code)); }
+    static Ref<MediaError> create(Code code) { return adoptRef(*new MediaError(code)); }
 
     Code code() const { return m_code; }
 
index 6da5872..115c961 100644 (file)
@@ -46,7 +46,7 @@ public:
     };
     typedef unsigned short Code;
 
-    static PassRefPtr<MediaKeyError> create(Code code, unsigned long systemCode = 0) { return adoptRef(new MediaKeyError(code, systemCode)); }
+    static Ref<MediaKeyError> create(Code code, unsigned long systemCode = 0) { return adoptRef(*new MediaKeyError(code, systemCode)); }
 
     Code code() const { return m_code; }
     unsigned long systemCode() { return m_systemCode; }
index ac05aef..157a4ef 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "Gradient.h"
 #include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
index 3006ed6..baf0a08 100644 (file)
@@ -32,9 +32,9 @@
 
 namespace WebCore {
 
-PassRefPtr<CanvasProxy> CanvasProxy::create()
+Ref<CanvasProxy> CanvasProxy::create()
 {
-    return adoptRef(new CanvasProxy());
+    return adoptRef(*new CanvasProxy());
 }
 
 CanvasProxy::CanvasProxy()
index 2591f0e..cbc4e7f 100644 (file)
@@ -34,7 +34,7 @@ namespace WebCore {
 
 class CanvasProxy : public RefCounted<CanvasProxy> {
 public:
-    static PassRefPtr<CanvasProxy> create();
+    static Ref<CanvasProxy> create();
 
     virtual ~CanvasProxy();
 
index 0938a23..14758b9 100644 (file)
@@ -35,9 +35,9 @@ namespace WebCore {
 
 class WebGLActiveInfo : public RefCounted<WebGLActiveInfo> {
 public:
-    static PassRefPtr<WebGLActiveInfo> create(const String& name, GC3Denum type, GC3Dint size)
+    static Ref<WebGLActiveInfo> create(const String& name, GC3Denum type, GC3Dint size)
     {
-        return adoptRef(new WebGLActiveInfo(name, type, size));
+        return adoptRef(*new WebGLActiveInfo(name, type, size));
     }
     String name() const { return m_name; }
     GC3Denum type() const { return m_type; }
index 2d3852e..ac00d05 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "CanvasContextAttributes.h"
 #include "GraphicsContext3D.h"
-#include <wtf/PassRefPtr.h>
 
 namespace WebCore {
 
index de41924..311e280 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "WebGLRenderingContextBase.h"
 #include <wtf/HashSet.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
index d298d24..1d8bba1 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "WebGLShader.h"
 
-#include <wtf/PassRefPtr.h>
 #include <wtf/Vector.h>
 
 namespace WebCore {
index ca9cd8b..107ace9 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "WebGLSharedObject.h"
 
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
index 5b3c6d3..8b67791 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "WebGLSharedObject.h"
 
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
index ab5c150..c2719b2 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "WebGLSharedObject.h"
 
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
index 538f341..4931226 100644 (file)
@@ -28,8 +28,6 @@
 
 #include "WebGLSharedObject.h"
 
-#include <wtf/PassRefPtr.h>
-
 namespace WebCore {
 
 class WebGLShader final : public WebGLSharedObject {
index b38e70a..37027f0 100644 (file)
@@ -28,7 +28,6 @@
 #define WebGLShaderPrecisionFormat_h
 
 #include "GraphicsContext3D.h"
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
index 796f6d8..9d8419c 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "WebGLSharedObject.h"
 
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
index 620b03d..133622d 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "WebGLSharedObject.h"
 
-#include <wtf/PassRefPtr.h>
 #include <wtf/Vector.h>
 
 namespace WebCore {
index 5833f6c..d29bb36 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "WebGLSharedObject.h"
 
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
index b137fb6..bfe0f8f 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "WebGLProgram.h"
 
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
index 0548d1c..3a4ef28 100644 (file)
@@ -30,8 +30,6 @@
 #include "WebGLContextObject.h"
 #include "WebGLVertexArrayObjectBase.h"
 
-#include <wtf/PassRefPtr.h>
-
 namespace WebCore {
 
 class WebGLVertexArrayObjectOES final : public WebGLVertexArrayObjectBase {
index 65b5c31..f178dfa 100644 (file)
@@ -31,9 +31,9 @@
 namespace WebCore {
 
 #if !PLATFORM(MAC)
-PassRefPtr<ImageControlsRootElement> ImageControlsRootElement::maybeCreate(Document& document)
+Ref<ImageControlsRootElement> ImageControlsRootElement::maybeCreate(Document& document)
 {
-    return adoptRef(new ImageControlsRootElement(document));
+    return adoptRef(*new ImageControlsRootElement(document));
 }
 #endif
 
index a0c9cd5..14c1157 100644 (file)
@@ -38,7 +38,7 @@ class ImageControlsRootElement : public HTMLDivElement {
 public:
     virtual ~ImageControlsRootElement();
 
-    static PassRefPtr<ImageControlsRootElement> maybeCreate(Document&);
+    static RefPtr<ImageControlsRootElement> maybeCreate(Document&);
 
 protected:
     explicit ImageControlsRootElement(Document&);
index 5a66efd..fbc007a 100644 (file)
@@ -79,9 +79,9 @@ MediaControlPanelElement::MediaControlPanelElement(Document& document)
     setPseudo(AtomicString("-webkit-media-controls-panel", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlPanelElement> MediaControlPanelElement::create(Document& document)
+Ref<MediaControlPanelElement> MediaControlPanelElement::create(Document& document)
 {
-    return adoptRef(new MediaControlPanelElement(document));
+    return adoptRef(*new MediaControlPanelElement(document));
 }
 
 void MediaControlPanelElement::startDrag(const LayoutPoint& eventLocation)
@@ -261,9 +261,9 @@ MediaControlPanelEnclosureElement::MediaControlPanelEnclosureElement(Document& d
     setPseudo(AtomicString("-webkit-media-controls-enclosure", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlPanelEnclosureElement> MediaControlPanelEnclosureElement::create(Document& document)
+Ref<MediaControlPanelEnclosureElement> MediaControlPanelEnclosureElement::create(Document& document)
 {
-    return adoptRef(new MediaControlPanelEnclosureElement(document));
+    return adoptRef(*new MediaControlPanelEnclosureElement(document));
 }
 
 // ----------------------------
@@ -275,9 +275,9 @@ MediaControlOverlayEnclosureElement::MediaControlOverlayEnclosureElement(Documen
     setPseudo(AtomicString("-webkit-media-controls-overlay-enclosure", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlOverlayEnclosureElement> MediaControlOverlayEnclosureElement::create(Document& document)
+Ref<MediaControlOverlayEnclosureElement> MediaControlOverlayEnclosureElement::create(Document& document)
 {
-    return adoptRef(new MediaControlOverlayEnclosureElement(document));
+    return adoptRef(*new MediaControlOverlayEnclosureElement(document));
 }
 
 // ----------------------------
@@ -288,11 +288,11 @@ MediaControlTimelineContainerElement::MediaControlTimelineContainerElement(Docum
     setPseudo(AtomicString("-webkit-media-controls-timeline-container", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlTimelineContainerElement> MediaControlTimelineContainerElement::create(Document& document)
+Ref<MediaControlTimelineContainerElement> MediaControlTimelineContainerElement::create(Document& document)
 {
-    RefPtr<MediaControlTimelineContainerElement> element = adoptRef(new MediaControlTimelineContainerElement(document));
+    Ref<MediaControlTimelineContainerElement> element = adoptRef(*new MediaControlTimelineContainerElement(document));
     element->hide();
-    return element.release();
+    return element;
 }
 
 void MediaControlTimelineContainerElement::setTimeDisplaysHidden(bool hidden)
@@ -323,11 +323,11 @@ MediaControlVolumeSliderContainerElement::MediaControlVolumeSliderContainerEleme
     setPseudo(AtomicString("-webkit-media-controls-volume-slider-container", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlVolumeSliderContainerElement> MediaControlVolumeSliderContainerElement::create(Document& document)
+Ref<MediaControlVolumeSliderContainerElement> MediaControlVolumeSliderContainerElement::create(Document& document)
 {
-    RefPtr<MediaControlVolumeSliderContainerElement> element = adoptRef(new MediaControlVolumeSliderContainerElement(document));
+    Ref<MediaControlVolumeSliderContainerElement> element = adoptRef(*new MediaControlVolumeSliderContainerElement(document));
     element->hide();
-    return element.release();
+    return element;
 }
 
 RenderPtr<RenderElement> MediaControlVolumeSliderContainerElement::createElementRenderer(Ref<RenderStyle>&& style, const RenderTreePosition&)
@@ -361,11 +361,11 @@ MediaControlStatusDisplayElement::MediaControlStatusDisplayElement(Document& doc
     setPseudo(AtomicString("-webkit-media-controls-status-display", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlStatusDisplayElement> MediaControlStatusDisplayElement::create(Document& document)
+Ref<MediaControlStatusDisplayElement> MediaControlStatusDisplayElement::create(Document& document)
 {
-    RefPtr<MediaControlStatusDisplayElement> element = adoptRef(new MediaControlStatusDisplayElement(document));
+    Ref<MediaControlStatusDisplayElement> element = adoptRef(*new MediaControlStatusDisplayElement(document));
     element->hide();
-    return element.release();
+    return element;
 }
 
 void MediaControlStatusDisplayElement::update()
@@ -410,14 +410,14 @@ MediaControlPanelMuteButtonElement::MediaControlPanelMuteButtonElement(Document&
     setPseudo(AtomicString("-webkit-media-controls-mute-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlPanelMuteButtonElement> MediaControlPanelMuteButtonElement::create(Document& document, MediaControls* controls)
+Ref<MediaControlPanelMuteButtonElement> MediaControlPanelMuteButtonElement::create(Document& document, MediaControls* controls)
 {
     ASSERT(controls);
 
-    RefPtr<MediaControlPanelMuteButtonElement> button = adoptRef(new MediaControlPanelMuteButtonElement(document, controls));
+    Ref<MediaControlPanelMuteButtonElement> button = adoptRef(*new MediaControlPanelMuteButtonElement(document, controls));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
-    return button.release();
+    return button;
 }
 
 void MediaControlPanelMuteButtonElement::defaultEventHandler(Event* event)
@@ -436,12 +436,12 @@ MediaControlVolumeSliderMuteButtonElement::MediaControlVolumeSliderMuteButtonEle
     setPseudo(AtomicString("-webkit-media-controls-volume-slider-mute-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlVolumeSliderMuteButtonElement> MediaControlVolumeSliderMuteButtonElement::create(Document& document)
+Ref<MediaControlVolumeSliderMuteButtonElement> MediaControlVolumeSliderMuteButtonElement::create(Document& document)
 {
-    RefPtr<MediaControlVolumeSliderMuteButtonElement> button = adoptRef(new MediaControlVolumeSliderMuteButtonElement(document));
+    Ref<MediaControlVolumeSliderMuteButtonElement> button = adoptRef(*new MediaControlVolumeSliderMuteButtonElement(document));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
-    return button.release();
+    return button;
 }
 
 // ----------------------------
@@ -452,12 +452,12 @@ MediaControlPlayButtonElement::MediaControlPlayButtonElement(Document& document)
     setPseudo(AtomicString("-webkit-media-controls-play-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlPlayButtonElement> MediaControlPlayButtonElement::create(Document& document)
+Ref<MediaControlPlayButtonElement> MediaControlPlayButtonElement::create(Document& document)
 {
-    RefPtr<MediaControlPlayButtonElement> button = adoptRef(new MediaControlPlayButtonElement(document));
+    Ref<MediaControlPlayButtonElement> button = adoptRef(*new MediaControlPlayButtonElement(document));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
-    return button.release();
+    return button;
 }
 
 void MediaControlPlayButtonElement::defaultEventHandler(Event* event)
@@ -486,12 +486,12 @@ MediaControlOverlayPlayButtonElement::MediaControlOverlayPlayButtonElement(Docum
     setPseudo(AtomicString("-webkit-media-controls-overlay-play-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlOverlayPlayButtonElement> MediaControlOverlayPlayButtonElement::create(Document& document)
+Ref<MediaControlOverlayPlayButtonElement> MediaControlOverlayPlayButtonElement::create(Document& document)
 {
-    RefPtr<MediaControlOverlayPlayButtonElement> button = adoptRef(new MediaControlOverlayPlayButtonElement(document));
+    Ref<MediaControlOverlayPlayButtonElement> button = adoptRef(*new MediaControlOverlayPlayButtonElement(document));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
-    return button.release();
+    return button;
 }
 
 void MediaControlOverlayPlayButtonElement::defaultEventHandler(Event* event)
@@ -520,12 +520,12 @@ MediaControlSeekForwardButtonElement::MediaControlSeekForwardButtonElement(Docum
     setPseudo(AtomicString("-webkit-media-controls-seek-forward-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlSeekForwardButtonElement> MediaControlSeekForwardButtonElement::create(Document& document)
+Ref<MediaControlSeekForwardButtonElement> MediaControlSeekForwardButtonElement::create(Document& document)
 {
-    RefPtr<MediaControlSeekForwardButtonElement> button = adoptRef(new MediaControlSeekForwardButtonElement(document));
+    Ref<MediaControlSeekForwardButtonElement> button = adoptRef(*new MediaControlSeekForwardButtonElement(document));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
-    return button.release();
+    return button;
 }
 
 // ----------------------------
@@ -536,12 +536,12 @@ MediaControlSeekBackButtonElement::MediaControlSeekBackButtonElement(Document& d
     setPseudo(AtomicString("-webkit-media-controls-seek-back-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlSeekBackButtonElement> MediaControlSeekBackButtonElement::create(Document& document)
+Ref<MediaControlSeekBackButtonElement> MediaControlSeekBackButtonElement::create(Document& document)
 {
-    RefPtr<MediaControlSeekBackButtonElement> button = adoptRef(new MediaControlSeekBackButtonElement(document));
+    Ref<MediaControlSeekBackButtonElement> button = adoptRef(*new MediaControlSeekBackButtonElement(document));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
-    return button.release();
+    return button;
 }
 
 // ----------------------------
@@ -552,12 +552,12 @@ MediaControlRewindButtonElement::MediaControlRewindButtonElement(Document& docum
     setPseudo(AtomicString("-webkit-media-controls-rewind-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlRewindButtonElement> MediaControlRewindButtonElement::create(Document& document)
+Ref<MediaControlRewindButtonElement> MediaControlRewindButtonElement::create(Document& document)
 {
-    RefPtr<MediaControlRewindButtonElement> button = adoptRef(new MediaControlRewindButtonElement(document));
+    Ref<MediaControlRewindButtonElement> button = adoptRef(*new MediaControlRewindButtonElement(document));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
-    return button.release();
+    return button;
 }
 
 void MediaControlRewindButtonElement::defaultEventHandler(Event* event)
@@ -577,13 +577,13 @@ MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeButtonEle
     setPseudo(AtomicString("-webkit-media-controls-return-to-realtime-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlReturnToRealtimeButtonElement> MediaControlReturnToRealtimeButtonElement::create(Document& document)
+Ref<MediaControlReturnToRealtimeButtonElement> MediaControlReturnToRealtimeButtonElement::create(Document& document)
 {
-    RefPtr<MediaControlReturnToRealtimeButtonElement> button = adoptRef(new MediaControlReturnToRealtimeButtonElement(document));
+    Ref<MediaControlReturnToRealtimeButtonElement> button = adoptRef(*new MediaControlReturnToRealtimeButtonElement(document));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
     button->hide();
-    return button.release();
+    return button;
 }
 
 void MediaControlReturnToRealtimeButtonElement::defaultEventHandler(Event* event)
@@ -609,15 +609,15 @@ MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsB
     setPseudo(AtomicString("-webkit-media-controls-toggle-closed-captions-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> MediaControlToggleClosedCaptionsButtonElement::create(Document& document, MediaControls* controls)
+Ref<MediaControlToggleClosedCaptionsButtonElement> MediaControlToggleClosedCaptionsButtonElement::create(Document& document, MediaControls* controls)
 {
     ASSERT(controls);
 
-    RefPtr<MediaControlToggleClosedCaptionsButtonElement> button = adoptRef(new MediaControlToggleClosedCaptionsButtonElement(document, controls));
+    Ref<MediaControlToggleClosedCaptionsButtonElement> button = adoptRef(*new MediaControlToggleClosedCaptionsButtonElement(document, controls));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
     button->hide();
-    return button.release();
+    return button;
 }
 
 void MediaControlToggleClosedCaptionsButtonElement::updateDisplayType()
@@ -655,12 +655,12 @@ MediaControlClosedCaptionsContainerElement::MediaControlClosedCaptionsContainerE
     setPseudo(AtomicString("-webkit-media-controls-closed-captions-container", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlClosedCaptionsContainerElement> MediaControlClosedCaptionsContainerElement::create(Document& document)
+Ref<MediaControlClosedCaptionsContainerElement> MediaControlClosedCaptionsContainerElement::create(Document& document)
 {
-    RefPtr<MediaControlClosedCaptionsContainerElement> element = adoptRef(new MediaControlClosedCaptionsContainerElement(document));
+    Ref<MediaControlClosedCaptionsContainerElement> element = adoptRef(*new MediaControlClosedCaptionsContainerElement(document));
     element->setAttribute(dirAttr, "auto");
     element->hide();
-    return element.release();
+    return element;
 }
 
 // ----------------------------
@@ -677,11 +677,11 @@ MediaControlClosedCaptionsTrackListElement::MediaControlClosedCaptionsTrackListE
     setPseudo(AtomicString("-webkit-media-controls-closed-captions-track-list", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlClosedCaptionsTrackListElement> MediaControlClosedCaptionsTrackListElement::create(Document& document, MediaControls* controls)
+Ref<MediaControlClosedCaptionsTrackListElement> MediaControlClosedCaptionsTrackListElement::create(Document& document, MediaControls* controls)
 {
     ASSERT(controls);
-    RefPtr<MediaControlClosedCaptionsTrackListElement> element = adoptRef(new MediaControlClosedCaptionsTrackListElement(document, controls));
-    return element.release();
+    Ref<MediaControlClosedCaptionsTrackListElement> element = adoptRef(*new MediaControlClosedCaptionsTrackListElement(document, controls));
+    return element;
 }
 
 void MediaControlClosedCaptionsTrackListElement::defaultEventHandler(Event* event)
@@ -837,15 +837,15 @@ MediaControlTimelineElement::MediaControlTimelineElement(Document& document, Med
     setPseudo(AtomicString("-webkit-media-controls-timeline", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlTimelineElement> MediaControlTimelineElement::create(Document& document, MediaControls* controls)
+Ref<MediaControlTimelineElement> MediaControlTimelineElement::create(Document& document, MediaControls* controls)
 {
     ASSERT(controls);
 
-    RefPtr<MediaControlTimelineElement> timeline = adoptRef(new MediaControlTimelineElement(document, controls));
+    Ref<MediaControlTimelineElement> timeline = adoptRef(*new MediaControlTimelineElement(document, controls));
     timeline->ensureUserAgentShadowRoot();
     timeline->setType("range");
     timeline->setAttribute(precisionAttr, "float");
-    return timeline.release();
+    return timeline;
 }
 
 void MediaControlTimelineElement::defaultEventHandler(Event* event)
@@ -905,14 +905,14 @@ MediaControlPanelVolumeSliderElement::MediaControlPanelVolumeSliderElement(Docum
     setPseudo(AtomicString("-webkit-media-controls-volume-slider", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlPanelVolumeSliderElement> MediaControlPanelVolumeSliderElement::create(Document& document)
+Ref<MediaControlPanelVolumeSliderElement> MediaControlPanelVolumeSliderElement::create(Document& document)
 {
-    RefPtr<MediaControlPanelVolumeSliderElement> slider = adoptRef(new MediaControlPanelVolumeSliderElement(document));
+    Ref<MediaControlPanelVolumeSliderElement> slider = adoptRef(*new MediaControlPanelVolumeSliderElement(document));
     slider->ensureUserAgentShadowRoot();
     slider->setType("range");
     slider->setAttribute(precisionAttr, "float");
     slider->setAttribute(maxAttr, "1");
-    return slider.release();
+    return slider;
 }
 
 // ----------------------------
@@ -923,14 +923,14 @@ MediaControlFullscreenVolumeSliderElement::MediaControlFullscreenVolumeSliderEle
     setPseudo(AtomicString("-webkit-media-controls-fullscreen-volume-slider", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlFullscreenVolumeSliderElement> MediaControlFullscreenVolumeSliderElement::create(Document& document)
+Ref<MediaControlFullscreenVolumeSliderElement> MediaControlFullscreenVolumeSliderElement::create(Document& document)
 {
-    RefPtr<MediaControlFullscreenVolumeSliderElement> slider = adoptRef(new MediaControlFullscreenVolumeSliderElement(document));
+    Ref<MediaControlFullscreenVolumeSliderElement> slider = adoptRef(*new MediaControlFullscreenVolumeSliderElement(document));
     slider->ensureUserAgentShadowRoot();
     slider->setType("range");
     slider->setAttribute(precisionAttr, "float");
     slider->setAttribute(maxAttr, "1");
-    return slider.release();
+    return slider;
 }
 
 // ----------------------------
@@ -941,13 +941,13 @@ MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(Documen
     setPseudo(AtomicString("-webkit-media-controls-fullscreen-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlFullscreenButtonElement> MediaControlFullscreenButtonElement::create(Document& document)
+Ref<MediaControlFullscreenButtonElement> MediaControlFullscreenButtonElement::create(Document& document)
 {
-    RefPtr<MediaControlFullscreenButtonElement> button = adoptRef(new MediaControlFullscreenButtonElement(document));
+    Ref<MediaControlFullscreenButtonElement> button = adoptRef(*new MediaControlFullscreenButtonElement(document));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
     button->hide();
-    return button.release();
+    return button;
 }
 
 void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event)
@@ -985,12 +985,12 @@ MediaControlFullscreenVolumeMinButtonElement::MediaControlFullscreenVolumeMinBut
     setPseudo(AtomicString("-webkit-media-controls-fullscreen-volume-min-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlFullscreenVolumeMinButtonElement> MediaControlFullscreenVolumeMinButtonElement::create(Document& document)
+Ref<MediaControlFullscreenVolumeMinButtonElement> MediaControlFullscreenVolumeMinButtonElement::create(Document& document)
 {
-    RefPtr<MediaControlFullscreenVolumeMinButtonElement> button = adoptRef(new MediaControlFullscreenVolumeMinButtonElement(document));
+    Ref<MediaControlFullscreenVolumeMinButtonElement> button = adoptRef(*new MediaControlFullscreenVolumeMinButtonElement(document));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
-    return button.release();
+    return button;
 }
 
 void MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler(Event* event)
@@ -1011,12 +1011,12 @@ MediaControlFullscreenVolumeMaxButtonElement::MediaControlFullscreenVolumeMaxBut
     setPseudo(AtomicString("-webkit-media-controls-fullscreen-volume-max-button", AtomicString::ConstructFromLiteral));
 }
 
-PassRefPtr<MediaControlFullscreenVolumeMaxButtonElement> MediaControlFullscreenVolumeMaxButtonElement::create(Document& document)
+Ref<MediaControlFullscreenVolumeMaxButtonElement> MediaControlFullscreenVolumeMaxButtonElement::create(Document& document)
 {
-    RefPtr<MediaControlFullscreenVolumeMaxButtonElement> button = adoptRef(new MediaControlFullscreenVolumeMaxButtonElement(document));
+    Ref<MediaControlFullscreenVolumeMaxButtonElement> button = adoptRef(*new MediaControlFullscreenVolumeMaxButtonElement(document));
     button->ensureUserAgentShadowRoot();
     button->setType("button");
-    return button.release();
+    return button;
 }
 
 void MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler(Event* event)
@@ -1037,9 +1037,9 @@ MediaControlTimeRemainingDisplayElement::MediaControlTimeRemainingDisplayElement
     setPseudo(getMediaControlTimeRemainingDisplayElementShadowPseudoId());
 }
 
-PassRefPtr<MediaControlTimeRemainingDisplayElement> MediaControlTimeRemainingDisplayElement::create(Document& document)
+Ref<MediaControlTimeRemainingDisplayElement> MediaControlTimeRemainingDisplayElement::create(Document& document)
 {
-    return adoptRef(new MediaControlTimeRemainingDisplayElement(document));
+    return adoptRef(*new MediaControlTimeRemainingDisplayElement(document));
 }
 
 static const AtomicString& getMediaControlTimeRemainingDisplayElementShadowPseudoId()
@@ -1056,9 +1056,9 @@ MediaControlCurrentTimeDisplayElement::MediaControlCurrentTimeDisplayElement(Doc
     setPseudo(getMediaControlCurrentTimeDisplayElementShadowPseudoId());
 }
 
-PassRefPtr<MediaControlCurrentTimeDisplayElement> MediaControlCurrentTimeDisplayElement::create(Document& document)
+Ref<MediaControlCurrentTimeDisplayElement> MediaControlCurrentTimeDisplayElement::create(Document& document)
 {
-    return adoptRef(new MediaControlCurrentTimeDisplayElement(document));
+    return adoptRef(*new MediaControlCurrentTimeDisplayElement(document));
 }
 
 static const AtomicString& getMediaControlCurrentTimeDisplayElementShadowPseudoId()
index add06e2..86d9702 100644 (file)
@@ -40,7 +40,7 @@ namespace WebCore {
 
 class MediaControlPanelElement final : public MediaControlDivElement {
 public:
-    static PassRefPtr<MediaControlPanelElement> create(Document&);
+    static Ref<MediaControlPanelElement> create(Document&);
 
     void setCanBeDragged(bool);
     void setIsDisplayed(bool);
@@ -83,7 +83,7 @@ private:
 
 class MediaControlPanelEnclosureElement final : public MediaControlDivElement {
 public:
-    static PassRefPtr<MediaControlPanelEnclosureElement> create(Document&);
+    static Ref<MediaControlPanelEnclosureElement> create(Document&);
 
 private:
     explicit MediaControlPanelEnclosureElement(Document&);
@@ -93,7 +93,7 @@ private:
 
 class MediaControlOverlayEnclosureElement final : public MediaControlDivElement {
 public:
-    static PassRefPtr<MediaControlOverlayEnclosureElement> create(Document&);
+    static Ref<MediaControlOverlayEnclosureElement> create(Document&);
 
 private:
     explicit MediaControlOverlayEnclosureElement(Document&);
@@ -103,7 +103,7 @@ private:
 
 class MediaControlTimelineContainerElement final : public MediaControlDivElement {
 public:
-    static PassRefPtr<MediaControlTimelineContainerElement> create(Document&);
+    static Ref<MediaControlTimelineContainerElement> create(Document&);
 
     void setTimeDisplaysHidden(bool);
 
@@ -117,7 +117,7 @@ private:
 
 class MediaControlVolumeSliderContainerElement final : public MediaControlDivElement {
 public:
-    static PassRefPtr<MediaControlVolumeSliderContainerElement> create(Document&);
+    static Ref<MediaControlVolumeSliderContainerElement> create(Document&);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseMoveEvents() override { return true; }
@@ -135,7 +135,7 @@ private:
 
 class MediaControlStatusDisplayElement final : public MediaControlDivElement {
 public:
-    static PassRefPtr<MediaControlStatusDisplayElement> create(Document&);
+    static Ref<MediaControlStatusDisplayElement> create(Document&);
 
     void update();
 
@@ -150,7 +150,7 @@ private:
 
 class MediaControlPanelMuteButtonElement final : public MediaControlMuteButtonElement {
 public:
-    static PassRefPtr<MediaControlPanelMuteButtonElement> create(Document&, MediaControls*);
+    static Ref<MediaControlPanelMuteButtonElement> create(Document&, MediaControls*);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseMoveEvents() override { return true; }
@@ -168,7 +168,7 @@ private:
 
 class MediaControlVolumeSliderMuteButtonElement final : public MediaControlMuteButtonElement {
 public:
-    static PassRefPtr<MediaControlVolumeSliderMuteButtonElement> create(Document&);
+    static Ref<MediaControlVolumeSliderMuteButtonElement> create(Document&);
 
 private:
     explicit MediaControlVolumeSliderMuteButtonElement(Document&);
@@ -179,7 +179,7 @@ private:
 
 class MediaControlPlayButtonElement final : public MediaControlInputElement {
 public:
-    static PassRefPtr<MediaControlPlayButtonElement> create(Document&);
+    static Ref<MediaControlPlayButtonElement> create(Document&);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseClickEvents() override { return true; }
@@ -197,7 +197,7 @@ private:
 
 class MediaControlOverlayPlayButtonElement final : public MediaControlInputElement {
 public:
-    static PassRefPtr<MediaControlOverlayPlayButtonElement> create(Document&);
+    static Ref<MediaControlOverlayPlayButtonElement> create(Document&);
 
     virtual void updateDisplayType() override;
 
@@ -211,7 +211,7 @@ private:
 
 class MediaControlSeekForwardButtonElement final : public MediaControlSeekButtonElement {
 public:
-    static PassRefPtr<MediaControlSeekForwardButtonElement> create(Document&);
+    static Ref<MediaControlSeekForwardButtonElement> create(Document&);
 
 private:
     explicit MediaControlSeekForwardButtonElement(Document&);
@@ -223,7 +223,7 @@ private:
 
 class MediaControlSeekBackButtonElement final : public MediaControlSeekButtonElement {
 public:
-    static PassRefPtr<MediaControlSeekBackButtonElement> create(Document&);
+    static Ref<MediaControlSeekBackButtonElement> create(Document&);
 
 private:
     explicit MediaControlSeekBackButtonElement(Document&);
@@ -235,7 +235,7 @@ private:
 
 class MediaControlRewindButtonElement final : public MediaControlInputElement {
 public:
-    static PassRefPtr<MediaControlRewindButtonElement> create(Document&);
+    static Ref<MediaControlRewindButtonElement> create(Document&);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseClickEvents() override { return true; }
@@ -251,7 +251,7 @@ private:
 
 class MediaControlReturnToRealtimeButtonElement final : public MediaControlInputElement {
 public:
-    static PassRefPtr<MediaControlReturnToRealtimeButtonElement> create(Document&);
+    static Ref<MediaControlReturnToRealtimeButtonElement> create(Document&);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseClickEvents() override { return true; }
@@ -267,7 +267,7 @@ private:
 
 class MediaControlToggleClosedCaptionsButtonElement final : public MediaControlInputElement {
 public:
-    static PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> create(Document&, MediaControls*);
+    static Ref<MediaControlToggleClosedCaptionsButtonElement> create(Document&, MediaControls*);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseClickEvents() override { return true; }
@@ -289,7 +289,7 @@ private:
 
 class MediaControlClosedCaptionsContainerElement final : public MediaControlDivElement {
 public:
-    static PassRefPtr<MediaControlClosedCaptionsContainerElement> create(Document&);
+    static Ref<MediaControlClosedCaptionsContainerElement> create(Document&);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseClickEvents() override { return true; }
@@ -303,7 +303,7 @@ private:
 
 class MediaControlClosedCaptionsTrackListElement final : public MediaControlDivElement {
 public:
-    static PassRefPtr<MediaControlClosedCaptionsTrackListElement> create(Document&, MediaControls*);
+    static Ref<MediaControlClosedCaptionsTrackListElement> create(Document&, MediaControls*);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseClickEvents() override { return true; }
@@ -331,7 +331,7 @@ private:
 
 class MediaControlTimelineElement final : public MediaControlInputElement {
 public:
-    static PassRefPtr<MediaControlTimelineElement> create(Document&, MediaControls*);
+    static Ref<MediaControlTimelineElement> create(Document&, MediaControls*);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseClickEvents() override;
@@ -352,7 +352,7 @@ private:
 
 class MediaControlFullscreenButtonElement final : public MediaControlInputElement {
 public:
-    static PassRefPtr<MediaControlFullscreenButtonElement> create(Document&);
+    static Ref<MediaControlFullscreenButtonElement> create(Document&);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseClickEvents() override { return true; }
@@ -370,7 +370,7 @@ private:
 
 class MediaControlPanelVolumeSliderElement final : public MediaControlVolumeSliderElement {
 public:
-    static PassRefPtr<MediaControlPanelVolumeSliderElement> create(Document&);
+    static Ref<MediaControlPanelVolumeSliderElement> create(Document&);
 
 private:
     explicit MediaControlPanelVolumeSliderElement(Document&);
@@ -379,7 +379,7 @@ private:
 
 class MediaControlFullscreenVolumeSliderElement final : public MediaControlVolumeSliderElement {
 public:
-    static PassRefPtr<MediaControlFullscreenVolumeSliderElement> create(Document&);
+    static Ref<MediaControlFullscreenVolumeSliderElement> create(Document&);
 
 private:
     explicit MediaControlFullscreenVolumeSliderElement(Document&);
@@ -389,7 +389,7 @@ private:
 
 class MediaControlFullscreenVolumeMinButtonElement final : public MediaControlInputElement {
 public:
-    static PassRefPtr<MediaControlFullscreenVolumeMinButtonElement> create(Document&);
+    static Ref<MediaControlFullscreenVolumeMinButtonElement> create(Document&);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseClickEvents() override { return true; }
@@ -404,7 +404,7 @@ private:
 
 class MediaControlFullscreenVolumeMaxButtonElement final : public MediaControlInputElement {
 public:
-    static PassRefPtr<MediaControlFullscreenVolumeMaxButtonElement> create(Document&);
+    static Ref<MediaControlFullscreenVolumeMaxButtonElement> create(Document&);
 
 #if !PLATFORM(IOS)
     virtual bool willRespondToMouseClickEvents() override { return true; }
@@ -421,7 +421,7 @@ private:
 
 class MediaControlTimeRemainingDisplayElement final : public MediaControlTimeDisplayElement {
 public:
-    static PassRefPtr<MediaControlTimeRemainingDisplayElement> create(Document&);
+    static Ref<MediaControlTimeRemainingDisplayElement> create(Document&);
 
 private:
     explicit MediaControlTimeRemainingDisplayElement(Document&);
@@ -431,7 +431,7 @@ private:
 
 class MediaControlCurrentTimeDisplayElement final : public MediaControlTimeDisplayElement {
 public:
-    static PassRefPtr<MediaControlCurrentTimeDisplayElement> create(Document&);
+    static Ref<MediaControlCurrentTimeDisplayElement> create(Document&);
 
 private:
     explicit MediaControlCurrentTimeDisplayElement(Document&);
index d2da627..2f84759 100644 (file)
@@ -37,7 +37,7 @@ class MediaControlsApple;
 
 class MediaControlsAppleEventListener : public EventListener {
 public:
-    static PassRefPtr<MediaControlsAppleEventListener> create(MediaControlsApple* mediaControls) { return adoptRef(new MediaControlsAppleEventListener(mediaControls)); }
+    static Ref<MediaControlsAppleEventListener> create(MediaControlsApple* mediaControls) { return adoptRef(*new MediaControlsAppleEventListener(mediaControls)); }
     static const MediaControlsAppleEventListener* cast(const EventListener* listener)
     {
         return listener->type() == MediaControlsAppleEventListenerType
index 3f151da..4f9b304 100644 (file)
@@ -53,7 +53,7 @@ private:
 
 class MeterInnerElement final : public MeterShadowElement {
 public:
-    static PassRefPtr<MeterInnerElement> create(Document&);
+    static Ref<MeterInnerElement> create(Document&);
 
 private:
     MeterInnerElement(Document&);
@@ -62,14 +62,14 @@ private:
     virtual RenderPtr<RenderElement> createElementRenderer(Ref<RenderStyle>&&, const RenderTreePosition&) override;
 };
 
-inline PassRefPtr<MeterInnerElement> MeterInnerElement::create(Document& document)
+inline Ref<MeterInnerElement> MeterInnerElement::create(Document& document)
 {
-    return adoptRef(new MeterInnerElement(document));
+    return adoptRef(*new MeterInnerElement(document));
 }
 
 class MeterBarElement final : public MeterShadowElement {
 public:
-    static PassRefPtr<MeterBarElement> create(Document&);
+    static Ref<MeterBarElement> create(Document&);
 
 private:
     MeterBarElement(Document& document)
@@ -80,14 +80,14 @@ private:
     }
 };
 
-inline PassRefPtr<MeterBarElement> MeterBarElement::create(Document& document)
+inline Ref<MeterBarElement> MeterBarElement::create(Document& document)
 {
-    return adoptRef(new MeterBarElement(document));
+    return adoptRef(*new MeterBarElement(document));
 }
 
 class MeterValueElement final : public MeterShadowElement {
 public:
-    static PassRefPtr<MeterValueElement> create(Document&);
+    static Ref<MeterValueElement> create(Document&);
     void setWidthPercentage(double);
     void updatePseudo() { setPseudo(valuePseudoId()); }
 
@@ -101,9 +101,9 @@ private:
     const AtomicString& valuePseudoId() const;
 };
 
-inline PassRefPtr<MeterValueElement> MeterValueElement::create(Document& document)
+inline Ref<MeterValueElement> MeterValueElement::create(Document& document)
 {
-    return adoptRef(new MeterValueElement(document));
+    return adoptRef(*new MeterValueElement(document));
 }
 
 }
index dda3d7f..97f824f 100644 (file)
@@ -52,7 +52,7 @@ private:
 
 class ProgressInnerElement final : public ProgressShadowElement {
 public:
-    static PassRefPtr<ProgressInnerElement> create(Document&);
+    static Ref<ProgressInnerElement> create(Document&);
 
 private:
     ProgressInnerElement(Document&);
@@ -61,40 +61,40 @@ private:
     virtual bool rendererIsNeeded(const RenderStyle&) override;
 };
 
-inline PassRefPtr<ProgressInnerElement> ProgressInnerElement::create(Document& document)
+inline Ref<ProgressInnerElement> ProgressInnerElement::create(Document& document)
 {
-    RefPtr<ProgressInnerElement> result = adoptRef(new ProgressInnerElement(document));
+    Ref<ProgressInnerElement> result = adoptRef(*new ProgressInnerElement(document));
     result->setPseudo(AtomicString("-webkit-progress-inner-element", AtomicString::ConstructFromLiteral));
     return result;
 }
 
 class ProgressBarElement final : public ProgressShadowElement {
 public:
-    static PassRefPtr<ProgressBarElement> create(Document&);
+    static Ref<ProgressBarElement> create(Document&);
 
 private:
     ProgressBarElement(Document&);
 };
 
-inline PassRefPtr<ProgressBarElement> ProgressBarElement::create(Document& document)
+inline Ref<ProgressBarElement> ProgressBarElement::create(Document& document)
 {
-    RefPtr<ProgressBarElement> result = adoptRef(new ProgressBarElement(document));
+    Ref<ProgressBarElement> result = adoptRef(*new ProgressBarElement(document));
     result->setPseudo(AtomicString("-webkit-progress-bar", AtomicString::ConstructFromLiteral));
     return result;
 }
 
 class ProgressValueElement final : public ProgressShadowElement {
 public:
-    static PassRefPtr<ProgressValueElement> create(Document&);
+    static Ref<ProgressValueElement> create(Document&);
     void setWidthPercentage(double);
 
 private:
     ProgressValueElement(Document&);
 };
 
-inline PassRefPtr<ProgressValueElement> ProgressValueElement::create(Document& document)
+inline Ref<ProgressValueElement> ProgressValueElement::create(Document& document)
 {
-    RefPtr<ProgressValueElement> result = adoptRef(new ProgressValueElement(document));
+    Ref<ProgressValueElement> result = adoptRef(*new ProgressValueElement(document));
     result->setPseudo(AtomicString("-webkit-progress-value", AtomicString::ConstructFromLiteral));
     return result;
 }
index b6eeccc..a44a5de 100644 (file)
@@ -80,12 +80,12 @@ void RenderImageControls::computeLogicalHeight(LayoutUnit logicalHeight, LayoutU
     computedValues.m_extent = downcast<RenderImage>(*renderer).logicalHeight();
 }
 
-PassRefPtr<ImageControlsRootElement> ImageControlsRootElement::maybeCreate(Document& document)
+RefPtr<ImageControlsRootElement> ImageControlsRootElement::maybeCreate(Document& document)
 {
     if (!document.page())
         return nullptr;
 
-    RefPtr<ImageControlsRootElementMac> controls = adoptRef(new ImageControlsRootElementMac(document));
+    RefPtr<ImageControlsRootElementMac> controls = adoptRef(*new ImageControlsRootElementMac(document));
     controls->setAttribute(HTMLNames::classAttr, "x-webkit-image-controls");
 
     controls->appendChild(ImageControlsButtonElementMac::maybeCreate(document));
index 2b2e2cc..f837229 100644 (file)
@@ -37,9 +37,9 @@ namespace WebCore {
 
 class TextTrackCueList : public RefCounted<TextTrackCueList> {
 public:
-    static PassRefPtr<TextTrackCueList> create()
+    static Ref<TextTrackCueList> create()
     {
-        return adoptRef(new TextTrackCueList);
+        return adoptRef(*new TextTrackCueList);
     }
 
     ~TextTrackCueList() { }
index 5b3592d..34a2ee7 100644 (file)
@@ -247,9 +247,9 @@ const AtomicString& VTTCue::cueBackdropShadowPseudoId()
     return cueBackdropShadowPseudoId;
 }
 
-PassRefPtr<VTTCue> VTTCue::create(ScriptExecutionContext& context, const WebVTTCueData& data)
+Ref<VTTCue> VTTCue::create(ScriptExecutionContext& context, const WebVTTCueData& data)
 {
-    return adoptRef(new VTTCue(context, data));
+    return adoptRef(*new VTTCue(context, data));
 }
 
 VTTCue::VTTCue(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content)
index e50dc71..e3243ea 100644 (file)
@@ -74,17 +74,17 @@ protected:
 
 class VTTCue : public TextTrackCue {
 public:
-    static PassRefPtr<VTTCue> create(ScriptExecutionContext& context, double start, double end, const String& content)
+    static Ref<VTTCue> create(ScriptExecutionContext& context, double start, double end, const String& content)
     {
         return create(context, MediaTime::createWithDouble(start), MediaTime::createWithDouble(end), content);
     }
 
-    static PassRefPtr<VTTCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content)
+    static Ref<VTTCue> create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content)
     {
-        return adoptRef(new VTTCue(context, start, end, content));
+        return adoptRef(*new VTTCue(context, start, end, content));
     }
 
-    static PassRefPtr<VTTCue> create(ScriptExecutionContext&, const WebVTTCueData&);
+    static Ref<VTTCue> create(ScriptExecutionContext&, const WebVTTCueData&);
 
     static const AtomicString& cueBackdropShadowPseudoId();
 
index ea58b84..4fa598b 100644 (file)
@@ -48,9 +48,9 @@ class VTTScanner;
 
 class VTTRegion final : public RefCounted<VTTRegion>, public ContextDestructionObserver {
 public:
-    static PassRefPtr<VTTRegion> create(ScriptExecutionContext& context)
+    static Ref<VTTRegion> create(ScriptExecutionContext& context)
     {
-        return adoptRef(new VTTRegion(context));
+        return adoptRef(*new VTTRegion(context));
     }
 
     virtual ~VTTRegion();
index 80c21c6..1672daf 100644 (file)
@@ -48,9 +48,9 @@ public:
 
 class VideoTrack final : public TrackBase, public VideoTrackPrivateClient {
 public:
-    static PassRefPtr<VideoTrack> create(VideoTrackClient* client, PassRefPtr<VideoTrackPrivate> trackPrivate)
+    static Ref<VideoTrack> create(VideoTrackClient* client, PassRefPtr<VideoTrackPrivate> trackPrivate)
     {
-        return adoptRef(new VideoTrack(client, trackPrivate));
+        return adoptRef(*new VideoTrack(client, trackPrivate));
     }
     virtual ~VideoTrack();
 
index c7b27c1..4d1d67e 100644 (file)
@@ -36,9 +36,9 @@ class VideoTrack;
 
 class VideoTrackList final : public TrackListBase {
 public:
-    static PassRefPtr<VideoTrackList> create(HTMLMediaElement* owner, ScriptExecutionContext* context)
+    static Ref<VideoTrackList> create(HTMLMediaElement* owner, ScriptExecutionContext* context)
     {
-        return adoptRef(new VideoTrackList(owner, context));
+        return adoptRef(*new VideoTrackList(owner, context));
     }
     virtual ~VideoTrackList();
 
index 485acbb..4a2f31b 100644 (file)
@@ -75,9 +75,9 @@ WebVTTElement::WebVTTElement(WebVTTNodeType nodeType, Document& document)
 {
 }
 
-PassRefPtr<WebVTTElement> WebVTTElement::create(WebVTTNodeType nodeType, Document& document)
+Ref<WebVTTElement> WebVTTElement::create(WebVTTNodeType nodeType, Document& document)
 {
-    return adoptRef(new WebVTTElement(nodeType, document));
+    return adoptRef(*new WebVTTElement(nodeType, document));
 }
 
 RefPtr<Element> WebVTTElement::cloneElementWithoutAttributesAndChildren(Document& targetDocument)
index b7219bc..1be7636 100644 (file)
@@ -46,7 +46,7 @@ enum WebVTTNodeType {
 
 class WebVTTElement final : public Element {
 public:
-    static PassRefPtr<WebVTTElement> create(const WebVTTNodeType, Document&);
+    static Ref<WebVTTElement> create(const WebVTTNodeType, Document&);
     PassRefPtr<HTMLElement> createEquivalentHTMLElement(Document&);
 
     virtual RefPtr<Element> cloneElementWithoutAttributesAndChildren(Document&) override;
index c347ae0..cfaf018 100644 (file)
@@ -67,7 +67,7 @@ public:
 class WebVTTCueData final : public RefCounted<WebVTTCueData> {
 public:
 
-    static PassRefPtr<WebVTTCueData> create() { return adoptRef(new WebVTTCueData()); }
+    static Ref<WebVTTCueData> create() { return adoptRef(*new WebVTTCueData()); }
     ~WebVTTCueData() { }
 
     MediaTime startTime() const { return m_startTime; }
index 9d41dbc..c20241c 100644 (file)
@@ -244,7 +244,7 @@ public:
     virtual bool mediaPlayerIsPaused() const { return true; }
     virtual bool mediaPlayerIsLooping() const { return false; }
     virtual CachedResourceLoader* mediaPlayerCachedResourceLoader() { return 0; }
-    virtual PassRefPtr<PlatformMediaResourceLoader> mediaPlayerCreateResourceLoader(std::unique_ptr<PlatformMediaResourceLoaderClient>) { return nullptr; }
+    virtual RefPtr<PlatformMediaResourceLoader> mediaPlayerCreateResourceLoader(std::unique_ptr<PlatformMediaResourceLoaderClient>) { return nullptr; }
     virtual bool doesHaveAttribute(const AtomicString&, AtomicString* = 0) const { return false; }
 
 #if ENABLE(VIDEO_TRACK)