Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
SocketStreamHandle should not be destroyed in a background thread
https://bugs.webkit.org/show_bug.cgi?id=198781

Reviewed by Geoffrey Garen.

Make sure to destroy SocketStreamHandle on the main thread since it owns an URL created on the main thread.
Covered by WPT websocket tests from https://bugs.webkit.org/show_bug.cgi?id=198774.

* platform/network/SocketStreamHandle.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
* platform/network/SocketStreamHandle.h:


Canonical link: https://commits.webkit.org/212807@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
youennf committed Jun 13, 2019
1 parent 562e5e2 commit f175a77
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,17 @@
2019-06-13 Youenn Fablet <youenn@apple.com>

SocketStreamHandle should not be destroyed in a background thread
https://bugs.webkit.org/show_bug.cgi?id=198781

Reviewed by Geoffrey Garen.

Make sure to destroy SocketStreamHandle on the main thread since it owns an URL created on the main thread.
Covered by WPT websocket tests from https://bugs.webkit.org/show_bug.cgi?id=198774.

* platform/network/SocketStreamHandle.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
* platform/network/SocketStreamHandle.h:

2019-06-13 Antoine Quint <graouts@apple.com>

"display: contents" Content click does not trigger
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/platform/network/SocketStreamHandle.cpp
Expand Up @@ -42,6 +42,7 @@ SocketStreamHandle::SocketStreamHandle(const URL& url, SocketStreamHandleClient&
, m_client(client)
, m_state(Connecting)
{
ASSERT(isMainThread());
}

SocketStreamHandle::SocketStreamState SocketStreamHandle::state() const
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/platform/network/SocketStreamHandle.h
Expand Up @@ -47,7 +47,7 @@ typedef struct {
#endif
} SourceApplicationAuditToken;

class SocketStreamHandle : public ThreadSafeRefCounted<SocketStreamHandle> {
class SocketStreamHandle : public ThreadSafeRefCounted<SocketStreamHandle, WTF::DestructionThread::Main> {
public:
enum SocketStreamState { Connecting, Open, Closing, Closed };
virtual ~SocketStreamHandle() = default;
Expand Down

0 comments on commit f175a77

Please sign in to comment.