Changeset 220440 in webkit


Ignore:
Timestamp:
Aug 8, 2017 8:24:31 PM (7 years ago)
Author:
weinig@apple.com
Message:

Address review feedback from https://bugs.webkit.org/show_bug.cgi?id=175246.

  • bindings/js/DOMPromiseProxy.h:
  • css/FontFaceSet.cpp:
  • css/FontFaceSet.h:
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r220436 r220440  
     12017-08-08  Sam Weinig  <sam@webkit.org>
     2
     3        Address review feedback from https://bugs.webkit.org/show_bug.cgi?id=175246.
     4
     5        * bindings/js/DOMPromiseProxy.h:
     6        * css/FontFaceSet.cpp:
     7        * css/FontFaceSet.h:
     8
    192017-08-08  Devin Rousso  <drousso@apple.com>
    210
  • trunk/Source/WebCore/bindings/js/DOMPromiseProxy.h

    r220433 r220440  
    4747    JSC::JSValue promise(JSC::ExecState&, JSDOMGlobalObject&);
    4848
    49     void reset();
     49    void clear();
    5050
    5151    bool isFulfilled() const;
     
    7171    JSC::JSValue promise(JSC::ExecState&, JSDOMGlobalObject&);
    7272
    73     void reset();
     73    void clear();
    7474
    7575    bool isFulfilled() const;
     
    8383};
    8484
     85// Instead of storing the value of the resolution directly, DOMPromiseProxyWithResolveCallback
     86// allows the owner to specify callback to be called when the resolved value is needed. This is
     87// needed to avoid reference cycles when the resolved value is the owner, such as is the case with
     88// FontFace and FontFaceSet.
    8589template<typename IDLType>
    8690class DOMPromiseProxyWithResolveCallback {
     
    100104    JSC::JSValue promise(JSC::ExecState&, JSDOMGlobalObject&);
    101105
    102     void reset();
     106    void clear();
    103107
    104108    bool isFulfilled() const;
     
    144148
    145149template<typename IDLType>
    146 inline void DOMPromiseProxy<IDLType>::reset()
     150inline void DOMPromiseProxy<IDLType>::clear()
    147151{
    148152    m_valueOrException = std::nullopt;
     
    213217}
    214218
    215 inline void DOMPromiseProxy<IDLVoid>::reset()
     219inline void DOMPromiseProxy<IDLVoid>::clear()
    216220{
    217221    m_valueOrException = std::nullopt;
     
    281285
    282286template<typename IDLType>
    283 inline void DOMPromiseProxyWithResolveCallback<IDLType>::reset()
     287inline void DOMPromiseProxyWithResolveCallback<IDLType>::clear()
    284288{
    285289    m_valueOrException = std::nullopt;
  • trunk/Source/WebCore/css/FontFaceSet.cpp

    r220433 r220440  
    190190{
    191191    // FIXME: Fire a "loading" event asynchronously.
    192     m_isReady = false;
    193     m_readyPromise.reset();
     192    m_readyPromise.clear();
    194193}
    195194
     
    197196{
    198197    m_readyPromise.resolve(*this);
    199     m_isReady = true;
    200198}
    201199
  • trunk/Source/WebCore/css/FontFaceSet.h

    r220433 r220440  
    114114    HashMap<RefPtr<FontFace>, Vector<Ref<PendingPromise>>> m_pendingPromises;
    115115    ReadyPromise m_readyPromise;
    116     bool m_isReady { true };
    117116};
    118117
Note: See TracChangeset for help on using the changeset viewer.