Changeset 200789 in webkit


Ignore:
Timestamp:
May 12, 2016, 2:13:13 PM (9 years ago)
Author:
Chris Dumez
Message:

Drop toJS() overload taking a PassRefPtr<> parameter
https://bugs.webkit.org/show_bug.cgi?id=157627

Reviewed by Alex Christensen.

Update our implementation stop stop returning PassRefPtrs to the
JS bindings and drop the toJS() overload taking a PassRefPtr<>
parameter

  • Modules/mediasource/SourceBuffer.cpp:

(WebCore::SourceBuffer::buffered):

  • Modules/mediasource/SourceBuffer.h:
  • Modules/webaudio/AudioBuffer.cpp:

(WebCore::AudioBuffer::getChannelData):

  • Modules/webaudio/AudioBuffer.h:
  • animation/DocumentTimeline.cpp:

(WebCore::DocumentTimeline::create):

  • animation/DocumentTimeline.h:
  • bindings/js/JSDOMBinding.h:

(WebCore::toJS): Deleted.
(WebCore::toJSNewlyCreated): Deleted.

  • css/CSSPrimitiveValue.cpp:

(WebCore::CSSPrimitiveValue::getRGBColorValue):

  • css/CSSPrimitiveValue.h:
  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::error):

  • html/HTMLMediaElement.h:
  • html/LabelableElement.cpp:

(WebCore::LabelableElement::labels):

  • html/LabelableElement.h:
  • html/canvas/WebGLGetInfo.cpp:

(WebCore::WebGLGetInfo::getWebGLBuffer):
(WebCore::WebGLGetInfo::getWebGLFloatArray):
(WebCore::WebGLGetInfo::getWebGLFramebuffer):
(WebCore::WebGLGetInfo::getWebGLIntArray):
(WebCore::WebGLGetInfo::getWebGLProgram):
(WebCore::WebGLGetInfo::getWebGLRenderbuffer):
(WebCore::WebGLGetInfo::getWebGLTexture):
(WebCore::WebGLGetInfo::getWebGLUnsignedByteArray):
(WebCore::WebGLGetInfo::getWebGLUnsignedIntArray):
(WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
(WebCore::WebGLGetInfo::getWebGLVertexArrayObject):

  • html/canvas/WebGLGetInfo.h:
  • html/canvas/WebGLRenderingContextBase.cpp:

(WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData):
(WebCore::WebGLRenderingContextBase::createBuffer):
(WebCore::WebGLRenderingContextBase::createFramebuffer):
(WebCore::WebGLRenderingContextBase::createTexture):
(WebCore::WebGLRenderingContextBase::createProgram):
(WebCore::WebGLRenderingContextBase::createRenderbuffer):
(WebCore::WebGLRenderingContextBase::createShader):
(WebCore::WebGLRenderingContextBase::getActiveAttrib):
(WebCore::WebGLRenderingContextBase::getActiveUniform):
(WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
(WebCore::WebGLRenderingContextBase::getUniformLocation):
(WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
(WebCore::WebGLRenderingContextBase::videoFrameToImage):

  • html/canvas/WebGLRenderingContextBase.h:
  • html/track/TextTrackCue.cpp:

(WebCore::TextTrackCue::create):

  • html/track/TextTrackCue.h:
  • html/track/VTTCue.cpp:

(WebCore::VTTCueBox::create):

  • html/track/VTTCue.h:
  • page/DOMSelection.cpp:

(WebCore::DOMSelection::getRangeAt):

  • page/DOMSelection.h:
  • page/DOMWindow.cpp:

(WebCore::DOMWindow::matchMedia):
(WebCore::DOMWindow::styleMedia):
(WebCore::DOMWindow::getComputedStyle):
(WebCore::DOMWindow::getMatchedCSSRules):
(WebCore::DOMWindow::webkitConvertPointFromNodeToPage):
(WebCore::DOMWindow::webkitConvertPointFromPageToNode):
(WebCore::DOMWindow::open):

  • page/DOMWindow.h:
  • page/Location.cpp:

(WebCore::Location::ancestorOrigins):

  • page/Location.h:
Location:
trunk/Source/WebCore
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r200788 r200789  
     12016-05-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Drop toJS() overload taking a PassRefPtr<> parameter
     4        https://bugs.webkit.org/show_bug.cgi?id=157627
     5
     6        Reviewed by Alex Christensen.
     7
     8        Update our implementation stop stop returning PassRefPtrs to the
     9        JS bindings and drop the toJS() overload taking a PassRefPtr<>
     10        parameter
     11
     12        * Modules/mediasource/SourceBuffer.cpp:
     13        (WebCore::SourceBuffer::buffered):
     14        * Modules/mediasource/SourceBuffer.h:
     15        * Modules/webaudio/AudioBuffer.cpp:
     16        (WebCore::AudioBuffer::getChannelData):
     17        * Modules/webaudio/AudioBuffer.h:
     18        * animation/DocumentTimeline.cpp:
     19        (WebCore::DocumentTimeline::create):
     20        * animation/DocumentTimeline.h:
     21        * bindings/js/JSDOMBinding.h:
     22        (WebCore::toJS): Deleted.
     23        (WebCore::toJSNewlyCreated): Deleted.
     24        * css/CSSPrimitiveValue.cpp:
     25        (WebCore::CSSPrimitiveValue::getRGBColorValue):
     26        * css/CSSPrimitiveValue.h:
     27        * html/HTMLMediaElement.cpp:
     28        (WebCore::HTMLMediaElement::error):
     29        * html/HTMLMediaElement.h:
     30        * html/LabelableElement.cpp:
     31        (WebCore::LabelableElement::labels):
     32        * html/LabelableElement.h:
     33        * html/canvas/WebGLGetInfo.cpp:
     34        (WebCore::WebGLGetInfo::getWebGLBuffer):
     35        (WebCore::WebGLGetInfo::getWebGLFloatArray):
     36        (WebCore::WebGLGetInfo::getWebGLFramebuffer):
     37        (WebCore::WebGLGetInfo::getWebGLIntArray):
     38        (WebCore::WebGLGetInfo::getWebGLProgram):
     39        (WebCore::WebGLGetInfo::getWebGLRenderbuffer):
     40        (WebCore::WebGLGetInfo::getWebGLTexture):
     41        (WebCore::WebGLGetInfo::getWebGLUnsignedByteArray):
     42        (WebCore::WebGLGetInfo::getWebGLUnsignedIntArray):
     43        (WebCore::WebGLGetInfo::getWebGLVertexArrayObjectOES):
     44        (WebCore::WebGLGetInfo::getWebGLVertexArrayObject):
     45        * html/canvas/WebGLGetInfo.h:
     46        * html/canvas/WebGLRenderingContextBase.cpp:
     47        (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData):
     48        (WebCore::WebGLRenderingContextBase::createBuffer):
     49        (WebCore::WebGLRenderingContextBase::createFramebuffer):
     50        (WebCore::WebGLRenderingContextBase::createTexture):
     51        (WebCore::WebGLRenderingContextBase::createProgram):
     52        (WebCore::WebGLRenderingContextBase::createRenderbuffer):
     53        (WebCore::WebGLRenderingContextBase::createShader):
     54        (WebCore::WebGLRenderingContextBase::getActiveAttrib):
     55        (WebCore::WebGLRenderingContextBase::getActiveUniform):
     56        (WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
     57        (WebCore::WebGLRenderingContextBase::getUniformLocation):
     58        (WebCore::WebGLRenderingContextBase::drawImageIntoBuffer):
     59        (WebCore::WebGLRenderingContextBase::videoFrameToImage):
     60        * html/canvas/WebGLRenderingContextBase.h:
     61        * html/track/TextTrackCue.cpp:
     62        (WebCore::TextTrackCue::create):
     63        * html/track/TextTrackCue.h:
     64        * html/track/VTTCue.cpp:
     65        (WebCore::VTTCueBox::create):
     66        * html/track/VTTCue.h:
     67        * page/DOMSelection.cpp:
     68        (WebCore::DOMSelection::getRangeAt):
     69        * page/DOMSelection.h:
     70        * page/DOMWindow.cpp:
     71        (WebCore::DOMWindow::matchMedia):
     72        (WebCore::DOMWindow::styleMedia):
     73        (WebCore::DOMWindow::getComputedStyle):
     74        (WebCore::DOMWindow::getMatchedCSSRules):
     75        (WebCore::DOMWindow::webkitConvertPointFromNodeToPage):
     76        (WebCore::DOMWindow::webkitConvertPointFromPageToNode):
     77        (WebCore::DOMWindow::open):
     78        * page/DOMWindow.h:
     79        * page/Location.cpp:
     80        (WebCore::Location::ancestorOrigins):
     81        * page/Location.h:
     82
    1832016-05-12  Ryosuke Niwa  <rniwa@webkit.org>
    284
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp

    r200626 r200789  
    131131}
    132132
    133 PassRefPtr<TimeRanges> SourceBuffer::buffered(ExceptionCode& ec) const
     133RefPtr<TimeRanges> SourceBuffer::buffered(ExceptionCode& ec) const
    134134{
    135135    // Section 3.1 buffered attribute steps.
  • trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h

    r200361 r200789  
    6767    // SourceBuffer.idl methods
    6868    bool updating() const { return m_updating; }
    69     PassRefPtr<TimeRanges> buffered(ExceptionCode&) const;
     69    RefPtr<TimeRanges> buffered(ExceptionCode&) const;
    7070    const RefPtr<TimeRanges>& buffered() const;
    7171    double timestampOffset() const;
  • trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.cpp

    r199007 r200789  
    5454}
    5555
    56 const PassRefPtr<RTCStatsReport> RTCStatsReport::local()
     56RTCStatsReport& RTCStatsReport::local()
    5757{
    58     return this;
     58    return *this;
    5959}
    6060
    61 const PassRefPtr<RTCStatsReport> RTCStatsReport::remote()
     61RTCStatsReport& RTCStatsReport::remote()
    6262{
    63     return this;
     63    return *this;
    6464}
    6565
  • trunk/Source/WebCore/Modules/mediastream/RTCStatsReport.h

    r184940 r200789  
    4646
    4747    // DEPRECATED
    48     const PassRefPtr<RTCStatsReport> local();
     48    RTCStatsReport& local();
    4949    // DEPRECATED
    50     const PassRefPtr<RTCStatsReport> remote();
     50    RTCStatsReport& remote();
    5151
    5252    void addStatistic(const String& name, const String& value);
  • trunk/Source/WebCore/Modules/webaudio/AudioBuffer.cpp

    r185316 r200789  
    9696}
    9797
    98 PassRefPtr<Float32Array> AudioBuffer::getChannelData(unsigned channelIndex, ExceptionCode& ec)
     98RefPtr<Float32Array> AudioBuffer::getChannelData(unsigned channelIndex, ExceptionCode& ec)
    9999{
    100100    if (channelIndex >= m_channels.size()) {
  • trunk/Source/WebCore/Modules/webaudio/AudioBuffer.h

    r177733 r200789  
    5656    // Channel data access
    5757    unsigned numberOfChannels() const { return m_channels.size(); }
    58     PassRefPtr<Float32Array> getChannelData(unsigned channelIndex, ExceptionCode&);
     58    RefPtr<Float32Array> getChannelData(unsigned channelIndex, ExceptionCode&);
    5959    Float32Array* getChannelData(unsigned channelIndex);
    6060    void zero();
  • trunk/Source/WebCore/animation/DocumentTimeline.cpp

    r197058 r200789  
    3434namespace WebCore {
    3535
    36 PassRefPtr<DocumentTimeline> DocumentTimeline::create(double originTime)
     36Ref<DocumentTimeline> DocumentTimeline::create(double originTime)
    3737{
    38     return adoptRef(new DocumentTimeline(originTime));
     38    return adoptRef(*new DocumentTimeline(originTime));
    3939}
    4040
  • trunk/Source/WebCore/animation/DocumentTimeline.h

    r197058 r200789  
    3838class DocumentTimeline final : public AnimationTimeline {
    3939public:
    40     static PassRefPtr<DocumentTimeline> create(double);
     40    static Ref<DocumentTimeline> create(double);
    4141    ~DocumentTimeline();
    4242
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.h

    r200775 r200789  
    253253JSC::JSValue toJS(JSC::ExecState*, JSC::JSGlobalObject*, JSC::ArrayBufferView*);
    254254template<typename T> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const RefPtr<T>&);
    255 template<typename T> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const PassRefPtr<T>&);
    256255template<typename T> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const Ref<T>&);
    257256template<typename T> JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, const RefPtr<T>&);
    258 template<typename T> JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, const PassRefPtr<T>&);
    259257template<typename T> JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, const Ref<T>&);
    260258template<typename T> JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, const Vector<T>&);
     
    550548}
    551549
    552 template<typename T> inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const PassRefPtr<T>& ptr)
    553 {
    554     return toJS(exec, globalObject, ptr.get());
    555 }
    556 
    557550template<typename T> inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const Ref<T>& ptr)
    558551{
     
    561554
    562555template<typename T> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const RefPtr<T>& ptr)
    563 {
    564     return toJSNewlyCreated(exec, globalObject, ptr.get());
    565 }
    566 
    567 template<typename T> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const PassRefPtr<T>& ptr)
    568556{
    569557    return toJSNewlyCreated(exec, globalObject, ptr.get());
  • trunk/Source/WebCore/css/CSSPrimitiveValue.cpp

    r199884 r200789  
    941941#endif
    942942
    943 PassRefPtr<RGBColor> CSSPrimitiveValue::getRGBColorValue(ExceptionCode& ec) const
    944 {
    945     ec = 0;
     943RefPtr<RGBColor> CSSPrimitiveValue::getRGBColorValue(ExceptionCode& ec) const
     944{
    946945    if (m_primitiveUnitType != CSS_RGBCOLOR) {
    947946        ec = INVALID_ACCESS_ERR;
    948         return 0;
     947        return nullptr;
    949948    }
    950949
  • trunk/Source/WebCore/css/CSSPrimitiveValue.h

    r197617 r200789  
    348348#endif
    349349
    350     PassRefPtr<RGBColor> getRGBColorValue(ExceptionCode&) const;
     350    RefPtr<RGBColor> getRGBColorValue(ExceptionCode&) const;
    351351    RGBA32 getRGBA32Value() const { return m_primitiveUnitType != CSS_RGBCOLOR ? 0 : m_value.rgbcolor; }
    352352
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r200775 r200789  
    968968}
    969969
    970 PassRefPtr<MediaError> HTMLMediaElement::error() const
    971 {
    972     return m_error;
     970MediaError* HTMLMediaElement::error() const
     971{
     972    return m_error.get();
    973973}
    974974
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r200768 r200789  
    158158// DOM API
    159159// error state
    160     PassRefPtr<MediaError> error() const;
     160    MediaError* error() const;
    161161
    162162    void setSrc(const String&);
  • trunk/Source/WebCore/html/LabelableElement.cpp

    r166377 r200789  
    4141}
    4242
    43 PassRefPtr<NodeList> LabelableElement::labels()
     43RefPtr<NodeList> LabelableElement::labels()
    4444{
    4545    if (!supportLabels())
    46         return 0;
     46        return nullptr;
    4747
    4848    return ensureRareData().ensureNodeLists().addCacheWithAtomicName<LabelsNodeList>(*this, starAtom);
  • trunk/Source/WebCore/html/LabelableElement.h

    r197566 r200789  
    4141    virtual ~LabelableElement();
    4242
    43     PassRefPtr<NodeList> labels();
     43    RefPtr<NodeList> labels();
    4444    virtual bool supportLabels() const { return false; }
    4545
  • trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp

    r186198 r200789  
    299299}
    300300
    301 PassRefPtr<WebGLBuffer> WebGLGetInfo::getWebGLBuffer() const
     301WebGLBuffer* WebGLGetInfo::getWebGLBuffer() const
    302302{
    303303    ASSERT(getType() == kTypeWebGLBuffer);
    304     return m_webglBuffer;
    305 }
    306 
    307 PassRefPtr<Float32Array> WebGLGetInfo::getWebGLFloatArray() const
     304    return m_webglBuffer.get();
     305}
     306
     307Float32Array* WebGLGetInfo::getWebGLFloatArray() const
    308308{
    309309    ASSERT(getType() == kTypeWebGLFloatArray);
    310     return m_webglFloatArray;
    311 }
    312 
    313 PassRefPtr<WebGLFramebuffer> WebGLGetInfo::getWebGLFramebuffer() const
     310    return m_webglFloatArray.get();
     311}
     312
     313WebGLFramebuffer* WebGLGetInfo::getWebGLFramebuffer() const
    314314{
    315315    ASSERT(getType() == kTypeWebGLFramebuffer);
    316     return m_webglFramebuffer;
    317 }
    318 
    319 PassRefPtr<Int32Array> WebGLGetInfo::getWebGLIntArray() const
     316    return m_webglFramebuffer.get();
     317}
     318
     319Int32Array* WebGLGetInfo::getWebGLIntArray() const
    320320{
    321321    ASSERT(getType() == kTypeWebGLIntArray);
    322     return m_webglIntArray;
    323 }
    324 
    325 PassRefPtr<WebGLProgram> WebGLGetInfo::getWebGLProgram() const
     322    return m_webglIntArray.get();
     323}
     324
     325WebGLProgram* WebGLGetInfo::getWebGLProgram() const
    326326{
    327327    ASSERT(getType() == kTypeWebGLProgram);
    328     return m_webglProgram;
    329 }
    330 
    331 PassRefPtr<WebGLRenderbuffer> WebGLGetInfo::getWebGLRenderbuffer() const
     328    return m_webglProgram.get();
     329}
     330
     331WebGLRenderbuffer* WebGLGetInfo::getWebGLRenderbuffer() const
    332332{
    333333    ASSERT(getType() == kTypeWebGLRenderbuffer);
    334     return m_webglRenderbuffer;
    335 }
    336 
    337 PassRefPtr<WebGLTexture> WebGLGetInfo::getWebGLTexture() const
     334    return m_webglRenderbuffer.get();
     335}
     336
     337WebGLTexture* WebGLGetInfo::getWebGLTexture() const
    338338{
    339339    ASSERT(getType() == kTypeWebGLTexture);
    340     return m_webglTexture;
    341 }
    342 
    343 PassRefPtr<Uint8Array> WebGLGetInfo::getWebGLUnsignedByteArray() const
     340    return m_webglTexture.get();
     341}
     342
     343Uint8Array* WebGLGetInfo::getWebGLUnsignedByteArray() const
    344344{
    345345    ASSERT(getType() == kTypeWebGLUnsignedByteArray);
    346     return m_webglUnsignedByteArray;
    347 }
    348 
    349 PassRefPtr<Uint32Array> WebGLGetInfo::getWebGLUnsignedIntArray() const
     346    return m_webglUnsignedByteArray.get();
     347}
     348
     349Uint32Array* WebGLGetInfo::getWebGLUnsignedIntArray() const
    350350{
    351351    ASSERT(getType() == kTypeWebGLUnsignedIntArray);
    352     return m_webglUnsignedIntArray;
    353 }
    354 
    355 PassRefPtr<WebGLVertexArrayObjectOES> WebGLGetInfo::getWebGLVertexArrayObjectOES() const
     352    return m_webglUnsignedIntArray.get();
     353}
     354
     355WebGLVertexArrayObjectOES* WebGLGetInfo::getWebGLVertexArrayObjectOES() const
    356356{
    357357    ASSERT(getType() == kTypeWebGLVertexArrayObjectOES);
    358     return m_webglVertexArrayObjectOES;
     358    return m_webglVertexArrayObjectOES.get();
    359359}
    360360
    361361#if ENABLE(WEBGL2)
    362 PassRefPtr<WebGLVertexArrayObject> WebGLGetInfo::getWebGLVertexArrayObject() const
     362WebGLVertexArrayObject* WebGLGetInfo::getWebGLVertexArrayObject() const
    363363{
    364364    ASSERT(getType() == kTypeWebGLVertexArrayObject);
    365     return m_webglVertexArrayObject;
     365    return m_webglVertexArrayObject.get();
    366366}
    367367#endif
  • trunk/Source/WebCore/html/canvas/WebGLGetInfo.h

    r186198 r200789  
    113113    unsigned int getUnsignedInt() const;
    114114    long long getInt64() const;
    115     PassRefPtr<WebGLBuffer> getWebGLBuffer() const;
    116     PassRefPtr<Float32Array> getWebGLFloatArray() const;
    117     PassRefPtr<WebGLFramebuffer> getWebGLFramebuffer() const;
    118     PassRefPtr<Int32Array> getWebGLIntArray() const;
     115    WebGLBuffer* getWebGLBuffer() const;
     116    Float32Array* getWebGLFloatArray() const;
     117    WebGLFramebuffer* getWebGLFramebuffer() const;
     118    Int32Array* getWebGLIntArray() const;
    119119    // FIXME: implement WebGLObjectArray
    120     // PassRefPtr<WebGLObjectArray> getWebGLObjectArray() const;
    121     PassRefPtr<WebGLProgram> getWebGLProgram() const;
    122     PassRefPtr<WebGLRenderbuffer> getWebGLRenderbuffer() const;
    123     PassRefPtr<WebGLTexture> getWebGLTexture() const;
    124     PassRefPtr<Uint8Array> getWebGLUnsignedByteArray() const;
    125     PassRefPtr<Uint32Array> getWebGLUnsignedIntArray() const;
    126     PassRefPtr<WebGLVertexArrayObjectOES> getWebGLVertexArrayObjectOES() const;
     120    // WebGLObjectArray* getWebGLObjectArray() const;
     121    WebGLProgram* getWebGLProgram() const;
     122    WebGLRenderbuffer* getWebGLRenderbuffer() const;
     123    WebGLTexture* getWebGLTexture() const;
     124    Uint8Array* getWebGLUnsignedByteArray() const;
     125    Uint32Array* getWebGLUnsignedIntArray() const;
     126    WebGLVertexArrayObjectOES* getWebGLVertexArrayObjectOES() const;
    127127#if ENABLE(WEBGL2)
    128     PassRefPtr<WebGLVertexArrayObject> getWebGLVertexArrayObject() const;
     128    WebGLVertexArrayObject* getWebGLVertexArrayObject() const;
    129129#endif
    130130
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

    r200626 r200789  
    753753}
    754754
    755 PassRefPtr<ImageData> WebGLRenderingContextBase::paintRenderingResultsToImageData()
     755RefPtr<ImageData> WebGLRenderingContextBase::paintRenderingResultsToImageData()
    756756{
    757757    if (isContextLostOrPending())
     
    13871387}
    13881388
    1389 PassRefPtr<WebGLBuffer> WebGLRenderingContextBase::createBuffer()
     1389RefPtr<WebGLBuffer> WebGLRenderingContextBase::createBuffer()
    13901390{
    13911391    if (isContextLostOrPending())
    13921392        return nullptr;
    1393     RefPtr<WebGLBuffer> o = WebGLBuffer::create(this);
    1394     addSharedObject(o.get());
    1395     return o;
    1396 }
    1397 
    1398 PassRefPtr<WebGLFramebuffer> WebGLRenderingContextBase::createFramebuffer()
     1393    auto buffer = WebGLBuffer::create(this);
     1394    addSharedObject(buffer.ptr());
     1395    return WTFMove(buffer);
     1396}
     1397
     1398RefPtr<WebGLFramebuffer> WebGLRenderingContextBase::createFramebuffer()
    13991399{
    14001400    if (isContextLostOrPending())
    14011401        return nullptr;
    1402     RefPtr<WebGLFramebuffer> o = WebGLFramebuffer::create(this);
    1403     addContextObject(o.get());
    1404     return o;
    1405 }
    1406 
    1407 PassRefPtr<WebGLTexture> WebGLRenderingContextBase::createTexture()
     1402    auto buffer = WebGLFramebuffer::create(this);
     1403    addContextObject(buffer.ptr());
     1404    return WTFMove(buffer);
     1405}
     1406
     1407RefPtr<WebGLTexture> WebGLRenderingContextBase::createTexture()
    14081408{
    14091409    if (isContextLostOrPending())
    14101410        return nullptr;
    1411     RefPtr<WebGLTexture> o = WebGLTexture::create(this);
    1412     addSharedObject(o.get());
    1413     return o;
    1414 }
    1415 
    1416 PassRefPtr<WebGLProgram> WebGLRenderingContextBase::createProgram()
     1411    auto texture = WebGLTexture::create(this);
     1412    addSharedObject(texture.ptr());
     1413    return WTFMove(texture);
     1414}
     1415
     1416RefPtr<WebGLProgram> WebGLRenderingContextBase::createProgram()
    14171417{
    14181418    if (isContextLostOrPending())
    14191419        return nullptr;
    1420     RefPtr<WebGLProgram> o = WebGLProgram::create(this);
    1421     addSharedObject(o.get());
    1422     return o;
    1423 }
    1424 
    1425 PassRefPtr<WebGLRenderbuffer> WebGLRenderingContextBase::createRenderbuffer()
     1420    auto program = WebGLProgram::create(this);
     1421    addSharedObject(program.ptr());
     1422    return WTFMove(program);
     1423}
     1424
     1425RefPtr<WebGLRenderbuffer> WebGLRenderingContextBase::createRenderbuffer()
    14261426{
    14271427    if (isContextLostOrPending())
    14281428        return nullptr;
    1429     RefPtr<WebGLRenderbuffer> o = WebGLRenderbuffer::create(this);
    1430     addSharedObject(o.get());
    1431     return o;
    1432 }
    1433 
    1434 PassRefPtr<WebGLShader> WebGLRenderingContextBase::createShader(GC3Denum type, ExceptionCode&)
     1429    auto buffer = WebGLRenderbuffer::create(this);
     1430    addSharedObject(buffer.ptr());
     1431    return WTFMove(buffer);
     1432}
     1433
     1434RefPtr<WebGLShader> WebGLRenderingContextBase::createShader(GC3Denum type, ExceptionCode&)
    14351435{
    14361436    if (isContextLostOrPending())
     
    14411441    }
    14421442
    1443     RefPtr<WebGLShader> o = WebGLShader::create(this, type);
    1444     addSharedObject(o.get());
    1445     return o;
     1443    auto shader = WebGLShader::create(this, type);
     1444    addSharedObject(shader.ptr());
     1445    return WTFMove(shader);
    14461446}
    14471447
     
    21172117}
    21182118
    2119 PassRefPtr<WebGLActiveInfo> WebGLRenderingContextBase::getActiveAttrib(WebGLProgram* program, GC3Duint index, ExceptionCode&)
     2119RefPtr<WebGLActiveInfo> WebGLRenderingContextBase::getActiveAttrib(WebGLProgram* program, GC3Duint index, ExceptionCode&)
    21202120{
    21212121    if (isContextLostOrPending() || !validateWebGLObject("getActiveAttrib", program))
     
    21302130}
    21312131
    2132 PassRefPtr<WebGLActiveInfo> WebGLRenderingContextBase::getActiveUniform(WebGLProgram* program, GC3Duint index, ExceptionCode&)
     2132RefPtr<WebGLActiveInfo> WebGLRenderingContextBase::getActiveUniform(WebGLProgram* program, GC3Duint index, ExceptionCode&)
    21332133{
    21342134    if (isContextLostOrPending() || !validateWebGLObject("getActiveUniform", program))
    2135         return 0;
     2135        return nullptr;
    21362136    ActiveInfo info;
    21372137    if (!m_context->getActiveUniform(objectOrZero(program), index, info))
     
    23532353}
    23542354
    2355 PassRefPtr<WebGLShaderPrecisionFormat> WebGLRenderingContextBase::getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, ExceptionCode&)
     2355RefPtr<WebGLShaderPrecisionFormat> WebGLRenderingContextBase::getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, ExceptionCode&)
    23562356{
    23572357    if (isContextLostOrPending())
     
    25462546}
    25472547
    2548 PassRefPtr<WebGLUniformLocation> WebGLRenderingContextBase::getUniformLocation(WebGLProgram* program, const String& name, ExceptionCode&)
     2548RefPtr<WebGLUniformLocation> WebGLRenderingContextBase::getUniformLocation(WebGLProgram* program, const String& name, ExceptionCode&)
    25492549{
    25502550    if (isContextLostOrPending() || !validateWebGLObject("getUniformLocation", program))
     
    31533153}
    31543154
    3155 PassRefPtr<Image> WebGLRenderingContextBase::drawImageIntoBuffer(Image& image, int width, int height, int deviceScaleFactor)
     3155RefPtr<Image> WebGLRenderingContextBase::drawImageIntoBuffer(Image& image, int width, int height, int deviceScaleFactor)
    31563156{
    31573157    IntSize size(width, height);
     
    32213221
    32223222#if ENABLE(VIDEO)
    3223 PassRefPtr<Image> WebGLRenderingContextBase::videoFrameToImage(HTMLVideoElement* video, BackingStoreCopy backingStoreCopy, ExceptionCode&)
     3223RefPtr<Image> WebGLRenderingContextBase::videoFrameToImage(HTMLVideoElement* video, BackingStoreCopy backingStoreCopy, ExceptionCode&)
    32243224{
    32253225    IntSize size(video->videoWidth(), video->videoHeight());
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h

    r200626 r200789  
    159159    void copyTexSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height);
    160160
    161     PassRefPtr<WebGLBuffer> createBuffer();
    162     PassRefPtr<WebGLFramebuffer> createFramebuffer();
    163     PassRefPtr<WebGLProgram> createProgram();
    164     PassRefPtr<WebGLRenderbuffer> createRenderbuffer();
    165     PassRefPtr<WebGLShader> createShader(GC3Denum type, ExceptionCode&);
    166     PassRefPtr<WebGLTexture> createTexture();
     161    RefPtr<WebGLBuffer> createBuffer();
     162    RefPtr<WebGLFramebuffer> createFramebuffer();
     163    RefPtr<WebGLProgram> createProgram();
     164    RefPtr<WebGLRenderbuffer> createRenderbuffer();
     165    RefPtr<WebGLShader> createShader(GC3Denum type, ExceptionCode&);
     166    RefPtr<WebGLTexture> createTexture();
    167167
    168168    void cullFace(GC3Denum mode);
     
    193193    void generateMipmap(GC3Denum target);
    194194
    195     PassRefPtr<WebGLActiveInfo> getActiveAttrib(WebGLProgram*, GC3Duint index, ExceptionCode&);
    196     PassRefPtr<WebGLActiveInfo> getActiveUniform(WebGLProgram*, GC3Duint index, ExceptionCode&);
     195    RefPtr<WebGLActiveInfo> getActiveAttrib(WebGLProgram*, GC3Duint index, ExceptionCode&);
     196    RefPtr<WebGLActiveInfo> getActiveUniform(WebGLProgram*, GC3Duint index, ExceptionCode&);
    197197    bool getAttachedShaders(WebGLProgram*, Vector<RefPtr<WebGLShader>>&, ExceptionCode&);
    198198    GC3Dint getAttribLocation(WebGLProgram*, const String& name);
     
    208208    WebGLGetInfo getShaderParameter(WebGLShader*, GC3Denum pname, ExceptionCode&);
    209209    String getShaderInfoLog(WebGLShader*, ExceptionCode&);
    210     PassRefPtr<WebGLShaderPrecisionFormat> getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, ExceptionCode&);
     210    RefPtr<WebGLShaderPrecisionFormat> getShaderPrecisionFormat(GC3Denum shaderType, GC3Denum precisionType, ExceptionCode&);
    211211    String getShaderSource(WebGLShader*, ExceptionCode&);
    212212    virtual Vector<String> getSupportedExtensions() = 0;
    213213    WebGLGetInfo getTexParameter(GC3Denum target, GC3Denum pname, ExceptionCode&);
    214214    WebGLGetInfo getUniform(WebGLProgram*, const WebGLUniformLocation*, ExceptionCode&);
    215     PassRefPtr<WebGLUniformLocation> getUniformLocation(WebGLProgram*, const String&, ExceptionCode&);
     215    RefPtr<WebGLUniformLocation> getUniformLocation(WebGLProgram*, const String&, ExceptionCode&);
    216216    WebGLGetInfo getVertexAttrib(GC3Duint index, GC3Denum pname, ExceptionCode&);
    217217    long long getVertexAttribOffset(GC3Duint index, GC3Denum pname);
     
    347347    void markLayerComposited();
    348348    void paintRenderingResultsToCanvas() override;
    349     PassRefPtr<ImageData> paintRenderingResultsToImageData();
     349    RefPtr<ImageData> paintRenderingResultsToImageData();
    350350
    351351    void removeSharedObject(WebGLSharedObject*);
     
    427427    void addCompressedTextureFormat(GC3Denum);
    428428
    429     PassRefPtr<Image> drawImageIntoBuffer(Image&, int width, int height, int deviceScaleFactor);
     429    RefPtr<Image> drawImageIntoBuffer(Image&, int width, int height, int deviceScaleFactor);
    430430
    431431#if ENABLE(VIDEO)
    432     PassRefPtr<Image> videoFrameToImage(HTMLVideoElement*, BackingStoreCopy, ExceptionCode&);
     432    RefPtr<Image> videoFrameToImage(HTMLVideoElement*, BackingStoreCopy, ExceptionCode&);
    433433#endif
    434434
  • trunk/Source/WebCore/html/track/TextTrackCue.cpp

    r200361 r200789  
    5656static const int invalidCueIndex = -1;
    5757
    58 PassRefPtr<TextTrackCue> TextTrackCue::create(ScriptExecutionContext& context, double start, double end, const String& content)
     58Ref<TextTrackCue> TextTrackCue::create(ScriptExecutionContext& context, double start, double end, const String& content)
    5959{
    6060    return create(context, MediaTime::createWithDouble(start), MediaTime::createWithDouble(end), content);
    6161}
    6262
    63 PassRefPtr<TextTrackCue> TextTrackCue::create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content)
     63Ref<TextTrackCue> TextTrackCue::create(ScriptExecutionContext& context, const MediaTime& start, const MediaTime& end, const String& content)
    6464{
    6565    return VTTCue::create(context, start, end, content);
  • trunk/Source/WebCore/html/track/TextTrackCue.h

    r197566 r200789  
    4747class TextTrackCue : public RefCounted<TextTrackCue>, public EventTargetWithInlineData {
    4848public:
    49     static PassRefPtr<TextTrackCue> create(ScriptExecutionContext&, double start, double end, const String& content);
    50     static PassRefPtr<TextTrackCue> create(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, const String& content);
     49    static Ref<TextTrackCue> create(ScriptExecutionContext&, double start, double end, const String& content);
     50    static Ref<TextTrackCue> create(ScriptExecutionContext&, const MediaTime& start, const MediaTime& end, const String& content);
    5151
    5252    static const AtomicString& cueShadowPseudoId()
  • trunk/Source/WebCore/html/track/VTTCue.cpp

    r200696 r200789  
    120120// ----------------------------
    121121
    122 PassRefPtr<VTTCueBox> VTTCueBox::create(Document& document, VTTCue& cue)
    123 {
    124     VTTCueBox* cueBox = new VTTCueBox(document, cue);
    125     cueBox->setPseudo(VTTCueBox::vttCueBoxShadowPseudoId());
     122Ref<VTTCueBox> VTTCueBox::create(Document& document, VTTCue& cue)
     123{
     124    VTTCueBox& cueBox = *new VTTCueBox(document, cue);
     125    cueBox.setPseudo(VTTCueBox::vttCueBoxShadowPseudoId());
    126126    return adoptRef(cueBox);
    127127}
  • trunk/Source/WebCore/html/track/VTTCue.h

    r200626 r200789  
    5454class VTTCueBox : public HTMLElement {
    5555public:
    56     static PassRefPtr<VTTCueBox> create(Document&, VTTCue&);
     56    static Ref<VTTCueBox> create(Document&, VTTCue&);
    5757
    5858    VTTCue* getCue() const;
  • trunk/Source/WebCore/page/DOMSelection.cpp

    r199969 r200789  
    345345}
    346346
    347 PassRefPtr<Range> DOMSelection::getRangeAt(int index, ExceptionCode& ec)
    348 {
    349     if (!m_frame)
    350         return 0;
     347RefPtr<Range> DOMSelection::getRangeAt(int index, ExceptionCode& ec)
     348{
     349    if (!m_frame)
     350        return nullptr;
    351351
    352352    if (index < 0 || index >= rangeCount()) {
    353353        ec = INDEX_SIZE_ERR;
    354         return 0;
     354        return nullptr;
    355355    }
    356356
  • trunk/Source/WebCore/page/DOMSelection.h

    r199969 r200789  
    8181        void collapseToStart(ExceptionCode&);
    8282        void extend(Node&, int offset, ExceptionCode&);
    83         PassRefPtr<Range> getRangeAt(int, ExceptionCode&);
     83        RefPtr<Range> getRangeAt(int, ExceptionCode&);
    8484        void removeAllRanges();
    8585        void addRange(Range*);
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r199642 r200789  
    464464}
    465465
    466 PassRefPtr<MediaQueryList> DOMWindow::matchMedia(const String& media)
    467 {
    468     return document() ? document()->mediaQueryMatcher().matchMedia(media) : 0;
     466RefPtr<MediaQueryList> DOMWindow::matchMedia(const String& media)
     467{
     468    return document() ? document()->mediaQueryMatcher().matchMedia(media) : nullptr;
    469469}
    470470
     
    14061406}
    14071407
    1408 PassRefPtr<StyleMedia> DOMWindow::styleMedia() const
     1408RefPtr<StyleMedia> DOMWindow::styleMedia() const
    14091409{
    14101410    if (!isCurrentlyDisplayedInFrame())
     
    14121412    if (!m_media)
    14131413        m_media = StyleMedia::create(m_frame);
    1414     return m_media.get();
    1415 }
    1416 
    1417 PassRefPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Element* element, const String& pseudoElt) const
     1414    return m_media;
     1415}
     1416
     1417RefPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Element* element, const String& pseudoElt) const
    14181418{
    14191419    if (!element)
     
    14231423}
    14241424
    1425 PassRefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* element, const String& pseudoElement, bool authorOnly) const
    1426 {
    1427     if (!isCurrentlyDisplayedInFrame())
    1428         return 0;
     1425RefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* element, const String& pseudoElement, bool authorOnly) const
     1426{
     1427    if (!isCurrentlyDisplayedInFrame())
     1428        return nullptr;
    14291429
    14301430    unsigned colonStart = pseudoElement[0] == ':' ? (pseudoElement[1] == ':' ? 2 : 1) : 0;
    14311431    CSSSelector::PseudoElementType pseudoType = CSSSelector::parsePseudoElementType(pseudoElement.substringSharingImpl(colonStart));
    14321432    if (pseudoType == CSSSelector::PseudoElementUnknown && !pseudoElement.isEmpty())
    1433         return 0;
     1433        return nullptr;
    14341434
    14351435    unsigned rulesToInclude = StyleResolver::AuthorCSSRules;
     
    14431443    auto matchedRules = m_frame->document()->ensureStyleResolver().pseudoStyleRulesForElement(element, pseudoId, rulesToInclude);
    14441444    if (matchedRules.isEmpty())
    1445         return 0;
     1445        return nullptr;
    14461446
    14471447    RefPtr<StaticCSSRuleList> ruleList = StaticCSSRuleList::create();
     
    14491449        ruleList->rules().append(rule->createCSSOMWrapper());
    14501450
    1451     return ruleList.release();
    1452 }
    1453 
    1454 PassRefPtr<WebKitPoint> DOMWindow::webkitConvertPointFromNodeToPage(Node* node, const WebKitPoint* p) const
     1451    return ruleList;
     1452}
     1453
     1454RefPtr<WebKitPoint> DOMWindow::webkitConvertPointFromNodeToPage(Node* node, const WebKitPoint* p) const
    14551455{
    14561456    if (!node || !p)
    1457         return 0;
     1457        return nullptr;
    14581458
    14591459    if (!document())
    1460         return 0;
     1460        return nullptr;
    14611461
    14621462    document()->updateLayoutIgnorePendingStylesheets();
     
    14671467}
    14681468
    1469 PassRefPtr<WebKitPoint> DOMWindow::webkitConvertPointFromPageToNode(Node* node, const WebKitPoint* p) const
     1469RefPtr<WebKitPoint> DOMWindow::webkitConvertPointFromPageToNode(Node* node, const WebKitPoint* p) const
    14701470{
    14711471    if (!node || !p)
    1472         return 0;
     1472        return nullptr;
    14731473
    14741474    if (!document())
    1475         return 0;
     1475        return nullptr;
    14761476
    14771477    document()->updateLayoutIgnorePendingStylesheets();
     
    21412141}
    21422142
    2143 PassRefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString,
     2143RefPtr<DOMWindow> DOMWindow::open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString,
    21442144    DOMWindow& activeWindow, DOMWindow& firstWindow)
    21452145{
  • trunk/Source/WebCore/page/DOMWindow.h

    r199112 r200789  
    124124        void resumeFromDocumentSuspension();
    125125
    126         PassRefPtr<MediaQueryList> matchMedia(const String&);
     126        RefPtr<MediaQueryList> matchMedia(const String&);
    127127
    128128        WEBCORE_EXPORT unsigned pendingUnloadEventListeners() const;
     
    168168        void stop();
    169169
    170         WEBCORE_EXPORT PassRefPtr<DOMWindow> open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString,
     170        WEBCORE_EXPORT RefPtr<DOMWindow> open(const String& urlString, const AtomicString& frameName, const String& windowFeaturesString,
    171171            DOMWindow& activeWindow, DOMWindow& firstWindow);
    172172
     
    224224        // CSSOM View Module
    225225
    226         PassRefPtr<StyleMedia> styleMedia() const;
     226        RefPtr<StyleMedia> styleMedia() const;
    227227
    228228        // DOM Level 2 Style Interface
    229229
    230         PassRefPtr<CSSStyleDeclaration> getComputedStyle(Element*, const String& pseudoElt) const;
     230        RefPtr<CSSStyleDeclaration> getComputedStyle(Element*, const String& pseudoElt) const;
    231231
    232232        // WebKit extensions
    233233
    234         PassRefPtr<CSSRuleList> getMatchedCSSRules(Element*, const String& pseudoElt, bool authorOnly = true) const;
     234        RefPtr<CSSRuleList> getMatchedCSSRules(Element*, const String& pseudoElt, bool authorOnly = true) const;
    235235        double devicePixelRatio() const;
    236236
    237         PassRefPtr<WebKitPoint> webkitConvertPointFromPageToNode(Node*, const WebKitPoint*) const;
    238         PassRefPtr<WebKitPoint> webkitConvertPointFromNodeToPage(Node*, const WebKitPoint*) const;
     237        RefPtr<WebKitPoint> webkitConvertPointFromPageToNode(Node*, const WebKitPoint*) const;
     238        RefPtr<WebKitPoint> webkitConvertPointFromNodeToPage(Node*, const WebKitPoint*) const;
    239239
    240240        PageConsoleClient* console() const;
  • trunk/Source/WebCore/page/Location.cpp

    r190017 r200789  
    125125}
    126126
    127 PassRefPtr<DOMStringList> Location::ancestorOrigins() const
    128 {
    129     RefPtr<DOMStringList> origins = DOMStringList::create();
    130     if (!m_frame)
    131         return origins.release();
     127Ref<DOMStringList> Location::ancestorOrigins() const
     128{
     129    auto origins = DOMStringList::create();
     130    if (!m_frame)
     131        return origins;
    132132    for (Frame* frame = m_frame->tree().parent(); frame; frame = frame->tree().parent())
    133133        origins->append(frame->document()->securityOrigin()->toString());
    134     return origins.release();
     134    return origins;
    135135}
    136136
  • trunk/Source/WebCore/page/Location.h

    r190017 r200789  
    7474    String toString() const { return href(); }
    7575
    76     PassRefPtr<DOMStringList> ancestorOrigins() const;
     76    Ref<DOMStringList> ancestorOrigins() const;
    7777
    7878private:
Note: See TracChangeset for help on using the changeset viewer.