Changeset 251565 in webkit


Ignore:
Timestamp:
Oct 24, 2019 3:12:49 PM (4 years ago)
Author:
sihui_liu@apple.com
Message:

[ Mac WK1 ] REGRESSION (r251261): Layout Test inspector/console/webcore-logging.html is consistently Failing
https://bugs.webkit.org/show_bug.cgi?id=203173
<rdar://problem/56424721>

Source/JavaScriptCore:

Hold a strong reference to JSGlobalOjbect in ConsoleMessage so that object is not garbage collected before
WebConsoleAgent::frameWindowDiscarded.

Covered by existing test: inspector/console/webcore-logging.html.

Reviewed by Geoffrey Garen.

  • inspector/ConsoleMessage.cpp:

(Inspector::ConsoleMessage::ConsoleMessage):
(Inspector::ConsoleMessage::clear):

  • inspector/ConsoleMessage.h:

LayoutTests:

Reviewed by Geoffrey Garen.

play() returns a promise and the promise can be rejected by a later pause(). We didn't handle
that case so we could receive a type JavaScript message for the unhandled rejected promise.

  • inspector/console/webcore-logging.html:
  • platform/mac-wk1/TestExpectations:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r251561 r251565  
     12019-10-24  Sihui Liu  <sihui_liu@apple.com>
     2
     3        [ Mac WK1 ] REGRESSION (r251261): Layout Test inspector/console/webcore-logging.html is consistently Failing
     4        https://bugs.webkit.org/show_bug.cgi?id=203173
     5        <rdar://problem/56424721>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        play() returns a promise and the promise can be rejected by a later pause(). We didn't handle
     10        that case so we could receive a type JavaScript message for the unhandled rejected promise.
     11
     12        * inspector/console/webcore-logging.html:
     13        * platform/mac-wk1/TestExpectations:
     14
    1152019-10-24  Antoine Quint  <graouts@apple.com>
    216
  • trunk/LayoutTests/inspector/console/webcore-logging.html

    r251513 r251565  
    1818{
    1919    video.currentTime = 0;
    20     video.play();
     20    video.play().catch((err) => { });
    2121    TestPage.dispatchEventToFrontend('PlayEvent', {count: 1});
    2222}
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r251536 r251565  
    802802http/tests/is-logged-in/ [ Skip ]
    803803
    804 webkit.org/b/203173 inspector/console/webcore-logging.html [ Pass Failure ]
    805 
    806804webkit.org/b/203176 [ Debug ] fast/scrolling/latching/scroll-select-bottom-test.html [ Pass Failure ]
    807805
  • trunk/Source/JavaScriptCore/ChangeLog

    r251559 r251565  
     12019-10-24  Sihui Liu  <sihui_liu@apple.com>
     2
     3        [ Mac WK1 ] REGRESSION (r251261): Layout Test inspector/console/webcore-logging.html is consistently Failing
     4        https://bugs.webkit.org/show_bug.cgi?id=203173
     5        <rdar://problem/56424721>
     6
     7        Hold a strong reference to JSGlobalOjbect in ConsoleMessage so that object is not garbage collected before
     8        WebConsoleAgent::frameWindowDiscarded.
     9
     10        Covered by existing test: inspector/console/webcore-logging.html.
     11
     12        Reviewed by Geoffrey Garen.
     13
     14        * inspector/ConsoleMessage.cpp:
     15        (Inspector::ConsoleMessage::ConsoleMessage):
     16        (Inspector::ConsoleMessage::clear):
     17        * inspector/ConsoleMessage.h:
     18
    1192019-10-24  Yusuke Suzuki  <ysuzuki@apple.com>
    220
  • trunk/Source/JavaScriptCore/inspector/ConsoleMessage.cpp

    r251513 r251565  
    118118    , m_level(level)
    119119    , m_url()
    120     , m_globalObject(globalObject)
    121     , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
    122 {
     120    , m_requestId(IdentifiersFactory::requestId(requestIdentifier))
     121{
     122    if (globalObject)
     123        m_globalObject = { globalObject->vm(), globalObject };
     124
    123125    if (!messages.size())
    124126        return;
     
    341343    if (m_arguments)
    342344        m_arguments = nullptr;
     345
     346    if (m_globalObject)
     347        m_globalObject.clear();
    343348}
    344349
     
    349354
    350355    if (m_globalObject)
    351         return m_globalObject;
     356        return m_globalObject.get();
    352357
    353358    return nullptr;
  • trunk/Source/JavaScriptCore/inspector/ConsoleMessage.h

    r251513 r251565  
    3232
    3333#include "ConsoleTypes.h"
     34#include "Strong.h"
    3435#include <wtf/FastMalloc.h>
    3536#include <wtf/Forward.h>
     
    9596    Vector<JSONLogValue> m_jsonLogValues;
    9697    String m_url;
    97     JSC::JSGlobalObject* m_globalObject { nullptr };
     98    JSC::Strong<JSC::JSGlobalObject> m_globalObject;
    9899    unsigned m_line { 0 };
    99100    unsigned m_column { 0 };
Note: See TracChangeset for help on using the changeset viewer.