⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 236110 in webkit


Ignore:
Timestamp:
Sep 18, 2018, 2:16:40 AM (8 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r235438 - MediaDevices should be collectable as soon as its document is stopped
https://bugs.webkit.org/show_bug.cgi?id=189021

Reviewed by Eric Carlson.

Source/WebCore:

Introduce ActiveDOMObject::isContextStopped to check whether the context is stopped.
Use this check in MediaDevices::hasPendingActivity so that it returns false as soon as active dom objects are stopped.

Test: http/tests/media/collect-media-devices.https.html

  • Modules/mediastream/MediaDevices.cpp:

(WebCore::MediaDevices::hasPendingActivity const):

  • dom/ActiveDOMObject.cpp:

(WebCore::ActiveDOMObject::hasPendingActivity const):
(WebCore::ActiveDOMObject::isContextStopped const):

  • dom/ActiveDOMObject.h:

LayoutTests:

  • http/tests/media/media-stream/collect-media-devices.https-expected.txt: Added.
  • http/tests/media/media-stream/collect-media-devices.https.html: Added.
  • http/tests/media/media-stream/resources/mymediadevicesframe.htm: Added.
Location:
releases/WebKitGTK/webkit-2.22
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.22/LayoutTests/ChangeLog

    r236109 r236110  
     12018-08-28  Youenn Fablet  <youenn@apple.com>
     2
     3        MediaDevices should be collectable as soon as its document is stopped
     4        https://bugs.webkit.org/show_bug.cgi?id=189021
     5
     6        Reviewed by Eric Carlson.
     7
     8        * http/tests/media/media-stream/collect-media-devices.https-expected.txt: Added.
     9        * http/tests/media/media-stream/collect-media-devices.https.html: Added.
     10        * http/tests/media/media-stream/resources/mymediadevicesframe.htm: Added.
     11
    1122018-08-27  Myles C. Maxfield  <mmaxfield@apple.com>
    213
  • releases/WebKitGTK/webkit-2.22/Source/WebCore/ChangeLog

    r236109 r236110  
     12018-08-28  Youenn Fablet  <youenn@apple.com>
     2
     3        MediaDevices should be collectable as soon as its document is stopped
     4        https://bugs.webkit.org/show_bug.cgi?id=189021
     5
     6        Reviewed by Eric Carlson.
     7
     8        Introduce ActiveDOMObject::isContextStopped to check whether the context is stopped.
     9        Use this check in MediaDevices::hasPendingActivity so that it returns false as soon as active dom objects are stopped.
     10
     11        Test: http/tests/media/collect-media-devices.https.html
     12
     13        * Modules/mediastream/MediaDevices.cpp:
     14        (WebCore::MediaDevices::hasPendingActivity const):
     15        * dom/ActiveDOMObject.cpp:
     16        (WebCore::ActiveDOMObject::hasPendingActivity const):
     17        (WebCore::ActiveDOMObject::isContextStopped const):
     18        * dom/ActiveDOMObject.h:
     19
    1202018-08-27  Myles C. Maxfield  <mmaxfield@apple.com>
    221
  • releases/WebKitGTK/webkit-2.22/Source/WebCore/Modules/mediastream/MediaDevices.cpp

    r235061 r236110  
    169169bool MediaDevices::hasPendingActivity() const
    170170{
    171     return scriptExecutionContext() && hasEventListeners(m_eventNames.devicechangeEvent);
     171    return !isContextStopped() && hasEventListeners(m_eventNames.devicechangeEvent);
    172172}
    173173
  • releases/WebKitGTK/webkit-2.22/Source/WebCore/dom/ActiveDOMObject.cpp

    r229903 r236110  
    107107}
    108108
     109bool ActiveDOMObject::isContextStopped() const
     110{
     111    return !scriptExecutionContext() || scriptExecutionContext()->activeDOMObjectsAreStopped();
     112}
     113
    109114} // namespace WebCore
  • releases/WebKitGTK/webkit-2.22/Source/WebCore/dom/ActiveDOMObject.h

    r233611 r236110  
    111111    }
    112112
     113    bool isContextStopped() const;
     114
    113115protected:
    114116    explicit ActiveDOMObject(ScriptExecutionContext*);
Note: See TracChangeset for help on using the changeset viewer.