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

Changeset 235438 in webkit


Ignore:
Timestamp:
Aug 28, 2018, 1:53:17 PM (8 years ago)
Author:
youenn@apple.com
Message:

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:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r235437 r235438  
     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-28  Basuke Suzuki  <Basuke.Suzuki@sony.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r235437 r235438  
     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-28  Basuke Suzuki  <Basuke.Suzuki@sony.com>
    221
  • trunk/Source/WebCore/Modules/mediastream/MediaDevices.cpp

    r235086 r235438  
    163163bool MediaDevices::hasPendingActivity() const
    164164{
    165     return scriptExecutionContext() && hasEventListeners(m_eventNames.devicechangeEvent);
     165    return !isContextStopped() && hasEventListeners(m_eventNames.devicechangeEvent);
    166166}
    167167
  • trunk/Source/WebCore/dom/ActiveDOMObject.cpp

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

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