Skip to content

Commit a0483ca

Browse files
committed
[ 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: Canonical link: https://commits.webkit.org/216796@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 977e2c2 commit a0483ca

6 files changed

Lines changed: 42 additions & 6 deletions

File tree

‎LayoutTests/ChangeLog‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2019-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+
115
2019-10-24 Antoine Quint <graouts@apple.com>
216

317
[Web Animations] Fix compositing/backing/transform-transition-from-outside-view.html

‎LayoutTests/inspector/console/webcore-logging.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
function play()
1818
{
1919
video.currentTime = 0;
20-
video.play();
20+
video.play().catch((err) => { });
2121
TestPage.dispatchEventToFrontend('PlayEvent', {count: 1});
2222
}
2323

‎LayoutTests/platform/mac-wk1/TestExpectations‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,6 @@ webkit.org/b/200002 [ Mojave+ Debug ] imported/blink/storage/indexeddb/blob-basi
801801
# Skip IsLoggedIn
802802
http/tests/is-logged-in/ [ Skip ]
803803

804-
webkit.org/b/203173 inspector/console/webcore-logging.html [ Pass Failure ]
805-
806804
webkit.org/b/203176 [ Debug ] fast/scrolling/latching/scroll-select-bottom-test.html [ Pass Failure ]
807805

808806
webkit.org/b/203304 imported/w3c/web-platform-tests/css/css-animations/animation-opacity-pause-and-set-time.html [ ImageOnlyFailure ]

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2019-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+
119
2019-10-24 Yusuke Suzuki <ysuzuki@apple.com>
220

321
[JSC] Properly organize wasm operations

‎Source/JavaScriptCore/inspector/ConsoleMessage.cpp‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,11 @@ ConsoleMessage::ConsoleMessage(MessageSource source, MessageType type, MessageLe
117117
, m_type(type)
118118
, m_level(level)
119119
, m_url()
120-
, m_globalObject(globalObject)
121120
, m_requestId(IdentifiersFactory::requestId(requestIdentifier))
122121
{
122+
if (globalObject)
123+
m_globalObject = { globalObject->vm(), globalObject };
124+
123125
if (!messages.size())
124126
return;
125127

@@ -340,6 +342,9 @@ void ConsoleMessage::clear()
340342

341343
if (m_arguments)
342344
m_arguments = nullptr;
345+
346+
if (m_globalObject)
347+
m_globalObject.clear();
343348
}
344349

345350
JSC::JSGlobalObject* ConsoleMessage::globalObject() const
@@ -348,7 +353,7 @@ JSC::JSGlobalObject* ConsoleMessage::globalObject() const
348353
return m_arguments->globalObject();
349354

350355
if (m_globalObject)
351-
return m_globalObject;
356+
return m_globalObject.get();
352357

353358
return nullptr;
354359
}

‎Source/JavaScriptCore/inspector/ConsoleMessage.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#pragma once
3232

3333
#include "ConsoleTypes.h"
34+
#include "Strong.h"
3435
#include <wtf/FastMalloc.h>
3536
#include <wtf/Forward.h>
3637
#include <wtf/Logger.h>
@@ -94,7 +95,7 @@ class JS_EXPORT_PRIVATE ConsoleMessage {
9495
RefPtr<ScriptCallStack> m_callStack;
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 };
100101
unsigned m_repeatCount { 1 };

0 commit comments

Comments
 (0)