WebKit Bugzilla
Attachment 362421 Details for
Bug 194819
: Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194819-20190219223620.patch (text/plain), 8.59 KB, created by
Loïc Yhuel
on 2019-02-19 13:36:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Loïc Yhuel
Created:
2019-02-19 13:36:22 PST
Size:
8.59 KB
patch
obsolete
>Subversion Revision: 241757 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5bdc6d3fa0a049d3046409362ea006d8fefb7ab0..47f1e5da18f1e70baad976cd100f2e0cf5310872 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-02-19 Loïc Yhuel <loic.yhuel@softathome.com> >+ >+ Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions >+ https://bugs.webkit.org/show_bug.cgi?id=194819 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: http/tests/inspector/network/contentextensions/blocked-websocket-crash.html >+ >+ * Modules/websockets/WebSocketChannel.h: >+ (WebCore::WebSocketChannel::hasCreatedHandshake): >+ * inspector/agents/page/PageNetworkAgent.cpp: >+ Ignore WebSocketChannel without an WebSocketHandshake, which would crash in InspectorNetworkAgent::enable. >+ > 2019-02-16 Darin Adler <darin@apple.com> > > Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc. >diff --git a/Source/WebCore/Modules/websockets/WebSocketChannel.h b/Source/WebCore/Modules/websockets/WebSocketChannel.h >index 68ce533463790b05696e7d660a6ccfefcba94dd1..aae66b492305b936772f7e27a90431a8c7a4ddcd 100644 >--- a/Source/WebCore/Modules/websockets/WebSocketChannel.h >+++ b/Source/WebCore/Modules/websockets/WebSocketChannel.h >@@ -116,6 +116,7 @@ public: > void didFail(int errorCode) override; > > unsigned identifier() const { return m_identifier; } >+ bool hasCreatedHandshake() { return !!m_handshake; } > ResourceRequest clientHandshakeRequest(); > const ResourceResponse& serverHandshakeResponse() const; > WebSocketHandshake::Mode handshakeMode() const; >diff --git a/Source/WebCore/inspector/agents/page/PageNetworkAgent.cpp b/Source/WebCore/inspector/agents/page/PageNetworkAgent.cpp >index 92980dc264e15a57365ebf11517cf32db9da0d19..c5d926a0b155f06d976f8c2c06eac04a593d20e4 100644 >--- a/Source/WebCore/inspector/agents/page/PageNetworkAgent.cpp >+++ b/Source/WebCore/inspector/agents/page/PageNetworkAgent.cpp >@@ -69,6 +69,9 @@ Vector<WebSocket*> PageNetworkAgent::activeWebSockets(const LockHolder& lock) > if (!channel) > continue; > >+ if (!channel->hasCreatedHandshake()) >+ continue; >+ > if (!is<Document>(webSocket->scriptExecutionContext())) > continue; > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 74027c8ab7d996c9894917ba87381adf6937a060..dc46419bea461a0c0d8248063859fe8affc0b63c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,18 @@ >+2019-02-19 Loïc Yhuel <loic.yhuel@softathome.com> >+ >+ Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions >+ https://bugs.webkit.org/show_bug.cgi?id=194819 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestExpectations: Skip the test by default, like http/tests/contentextensions >+ * http/tests/inspector/network/contentextensions/blocked-websocket-crash-expected.txt: Added. >+ * http/tests/inspector/network/contentextensions/blocked-websocket-crash.html: Added. >+ * http/tests/inspector/network/contentextensions/blocked-websocket-crash.html.json: Added. >+ * platform/gtk/TestExpectations: Unskip the test >+ * platform/mac-wk2/TestExpectations: Ditto >+ * platform/wpe/TestExpectations: Ditto >+ > 2019-02-18 Alex Christensen <achristensen@webkit.org> > > Adjust test expectations after r241754 >diff --git a/LayoutTests/TestExpectations b/LayoutTests/TestExpectations >index c2c19fb1153ea659530df86108bd5fff7d9cb26a..878faaeb4f35c3ae4a945b440200888e92426ad9 100644 >--- a/LayoutTests/TestExpectations >+++ b/LayoutTests/TestExpectations >@@ -1179,6 +1179,7 @@ webkit.org/b/141695 [ Debug ] fast/selectors/nth-last-child-of-register-requirem > > # Content extensions are Mac-WK2-only for now > http/tests/contentextensions [ Skip ] >+http/tests/inspector/network/contentextensions [ Skip ] > http/tests/websocket/tests/hybi/contentextensions [ Skip ] > http/wpt/beacon/contentextensions [ Skip ] > >diff --git a/LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash-expected.txt b/LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..2343bca7cee45bffccbb6e2607c77f742eeeb40f >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash-expected.txt >@@ -0,0 +1,8 @@ >+CONSOLE MESSAGE: line 9: Content blocker prevented frame displaying http://127.0.0.1:8000/inspector/network/contentextensions/blocked-websocket-crash.html from loading a resource from ws://127.0.0.1/ >+Test opening inspector after a blocked WebSocket connection. >+ >+ >+== Running test suite: Network.BlockedRequests >+-- Running test case: Network.BlockedRequests.WebSocket >+PASS: Web Inspector initialized. >+ >diff --git a/LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash.html b/LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash.html >new file mode 100644 >index 0000000000000000000000000000000000000000..3fb253a770207601812df1d65e6870225235318f >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash.html >@@ -0,0 +1,29 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset="utf-8"> >+<script src="../../resources/inspector-test.js"></script> >+<script> >+// Create a WebSocket before opening the inspector >+// url doesn't matter : it will be blocked by the content extension >+let ws = new WebSocket("ws://127.0.0.1"); >+ >+function test() { >+ let suite = InspectorTest.createAsyncSuite("Network.BlockedRequests"); >+ suite.addTestCase({ >+ name: "Network.BlockedRequests.WebSocket", >+ description: "Ensure Web Inspector works even after a blocked WebSocket connection", >+ test(resolve, reject) { >+ InspectorTest.pass("Web Inspector initialized."); >+ resolve(); >+ } >+ }); >+ >+ suite.runTestCasesAndFinish(); >+} >+</script> >+</head> >+<body onload="runTest()"> >+<p>Test opening inspector after a blocked WebSocket connection.</p> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash.html.json b/LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash.html.json >new file mode 100644 >index 0000000000000000000000000000000000000000..902a369104354411b9d21586045fee4d377551d8 >--- /dev/null >+++ b/LayoutTests/http/tests/inspector/network/contentextensions/blocked-websocket-crash.html.json >@@ -0,0 +1,10 @@ >+[ >+ { >+ "trigger": { >+ "url-filter": "^ws://" >+ }, >+ "action": { >+ "type": "block" >+ } >+ } >+] >diff --git a/LayoutTests/platform/gtk/TestExpectations b/LayoutTests/platform/gtk/TestExpectations >index 5212d68b049868c18c1feacf092ef0aa2aafa72d..30b1d679899d08ac2b27c8bcef2b39b81ec8b4e1 100644 >--- a/LayoutTests/platform/gtk/TestExpectations >+++ b/LayoutTests/platform/gtk/TestExpectations >@@ -3858,6 +3858,7 @@ fast/text/emoji-gender-fe0f-8.html [ Pass ] > fast/text/emoji-gender-fe0f-9.html [ Pass ] > > http/tests/contentextensions [ Pass ] >+http/tests/inspector/network/contentextensions [ Pass ] > > imported/w3c/web-platform-tests/css/css-scoping/stylesheet-title-001.html [ Pass ] > imported/w3c/web-platform-tests/css/css-text/text-transform/text-transform-capitalize-026.html [ Pass ] >diff --git a/LayoutTests/platform/mac-wk2/TestExpectations b/LayoutTests/platform/mac-wk2/TestExpectations >index 9c4a438079fc5817fcd2a89af529e5d217837a0a..0d125ea0c88cbeb171d1e0fd72bbd08e6f9223ef 100644 >--- a/LayoutTests/platform/mac-wk2/TestExpectations >+++ b/LayoutTests/platform/mac-wk2/TestExpectations >@@ -518,6 +518,7 @@ webkit.org/b/141085 http/tests/media/video-query-url.html [ Pass Timeout ] > > # Content Extensions tests must be enabled explicitly on mac-wk2. > http/tests/contentextensions [ Pass ] >+http/tests/inspector/network/contentextensions [ Pass ] > http/tests/websocket/tests/hybi/contentextensions [ Pass ] > [ Sierra+ ] http/wpt/beacon/contentextensions [ Pass ] > >diff --git a/LayoutTests/platform/wpe/TestExpectations b/LayoutTests/platform/wpe/TestExpectations >index 79f15350264f8c7907bdaa3b03fee3b9dd6259da..1cc9d674669bf7916e5c1ead126c52bc3ca31545 100644 >--- a/LayoutTests/platform/wpe/TestExpectations >+++ b/LayoutTests/platform/wpe/TestExpectations >@@ -613,6 +613,7 @@ fast/text/variations [ Pass ] > > # Content Extensions > http/tests/contentextensions [ Pass ] >+http/tests/inspector/network/contentextensions [ Pass ] > > #//////////////////////////////////////////////////////////////////////////////////////// > # 5. TESTS CRASHING
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194819
:
362392
|
362403
|
362411
|
362415
|
362421
|
362496