Skip to content

Commit

Permalink
[ Mac WK1 ] REGRESSION (r251261): Layout Test inspector/console/webco…
Browse files Browse the repository at this point in the history
…re-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:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@251482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Oct 23, 2019
1 parent b6ab4b8 commit 43e0e14
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
14 changes: 14 additions & 0 deletions LayoutTests/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2019-10-23 Sihui Liu <[email protected]>

[ 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>

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:

2019-10-22 Simon Fraser <[email protected]>

wpt/css/css-images/gradient/color-stops-parsing.html fails
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/inspector/console/webcore-logging.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
function play()
{
video.currentTime = 0;
video.play();
video.play().catch((err) => { });
TestPage.dispatchEventToFrontend('PlayEvent', {count: 1});
}

Expand Down
2 changes: 0 additions & 2 deletions LayoutTests/platform/mac-wk1/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,5 @@ webkit.org/b/200002 [ Mojave+ Debug ] imported/blink/storage/indexeddb/blob-basi
# Skip IsLoggedIn
http/tests/is-logged-in/ [ Skip ]

webkit.org/b/203173 inspector/console/webcore-logging.html [ Pass Failure ]

webkit.org/b/203176 [ Debug ] fast/scrolling/latching/scroll-select-bottom-test.html [ Pass Failure ]

18 changes: 18 additions & 0 deletions Source/JavaScriptCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
2019-10-23 Sihui Liu <[email protected]>

[ 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>

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:

2019-10-22 Yusuke Suzuki <[email protected]>

Make `JSGlobalObject*` threading change more stabilized by adding tests and assertions
Expand Down
9 changes: 7 additions & 2 deletions Source/JavaScriptCore/inspector/ConsoleMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ ConsoleMessage::ConsoleMessage(MessageSource source, MessageType type, MessageLe
, m_type(type)
, m_level(level)
, m_url()
, m_globalObject(globalObject)
, m_requestId(IdentifiersFactory::requestId(requestIdentifier))
{
if (globalObject)
m_globalObject = { globalObject->vm(), globalObject };

if (!messages.size())
return;

Expand Down Expand Up @@ -340,6 +342,9 @@ void ConsoleMessage::clear()

if (m_arguments)
m_arguments = nullptr;

if (m_globalObject)
m_globalObject.clear();
}

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

if (m_globalObject)
return m_globalObject;
return m_globalObject.get();

return nullptr;
}
Expand Down
3 changes: 2 additions & 1 deletion Source/JavaScriptCore/inspector/ConsoleMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#pragma once

#include "ConsoleTypes.h"
#include "Strong.h"
#include <wtf/FastMalloc.h>
#include <wtf/Forward.h>
#include <wtf/Logger.h>
Expand Down Expand Up @@ -94,7 +95,7 @@ class JS_EXPORT_PRIVATE ConsoleMessage {
RefPtr<ScriptCallStack> m_callStack;
Vector<JSONLogValue> m_jsonLogValues;
String m_url;
JSC::JSGlobalObject* m_globalObject { nullptr };
JSC::Strong<JSC::JSGlobalObject> m_globalObject;
unsigned m_line { 0 };
unsigned m_column { 0 };
unsigned m_repeatCount { 1 };
Expand Down

0 comments on commit 43e0e14

Please sign in to comment.