WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
248458
[Curl] Register/Unregister NetworkDataTaskCurl to NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=248458
Summary
[Curl] Register/Unregister NetworkDataTaskCurl to NetworkSession
Kenji Shukuwa
Reported
2022-11-28 23:42:39 PST
In the inherited classes of NetworkDataTask, it looks like we have to do the registration/unregistration to NetworkSession in the constructor/destructor. However, the curl port does not handle this.
https://github.com/WebKit/WebKit/blob/main/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp#L82
https://github.com/WebKit/WebKit/blob/main/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm#L478
https://github.com/WebKit/WebKit/blob/main/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp#L67
--- m_session->registerNetworkDataTask(*this); ---
https://github.com/WebKit/WebKit/blob/main/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp#L92-L93
https://github.com/WebKit/WebKit/blob/main/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm#L488-L489
https://github.com/WebKit/WebKit/blob/main/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp#L94-L95
--- if (m_session) m_session->unregisterNetworkDataTask(*this); ---
Attachments
Add attachment
proposed patch, testcase, etc.
Kenji Shukuwa
Comment 1
2022-11-28 23:50:13 PST
It seems that by registering to the NetworkSession, NetworkDataTask::invalidateAndCancel is called when the WebsiteDataStore is destroyed.
https://github.com/WebKit/WebKit/blob/main/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp#L170-L171
--- WebsiteDataStore::~WebsiteDataStore() { if (m_networkProcess) m_networkProcess->removeSession(*this); ---
https://github.com/WebKit/WebKit/blob/main/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp#L1427-L1428
--- void NetworkProcessProxy::removeSession(WebsiteDataStore& websiteDataStore) { if (canSendMessage()) send(Messages::NetworkProcess::DestroySession { websiteDataStore.sessionID() }, 0); ---
https://github.com/WebKit/WebKit/blob/main/Source/WebKit/NetworkProcess/NetworkProcess.cpp#L560
--- void NetworkProcess::destroySession(PAL::SessionID sessionID) { if (auto session = m_networkSessions.take(sessionID)) { session->invalidateAndCancel(); ---
https://github.com/WebKit/WebKit/blob/main/Source/WebKit/NetworkProcess/NetworkSession.cpp#L215-L216
--- void NetworkSession::invalidateAndCancel() { for (auto& task : m_dataTaskSet) task.invalidateAndCancel(); ---
Kenji Shukuwa
Comment 2
2022-11-28 23:59:11 PST
Pull request:
https://github.com/WebKit/WebKit/pull/6910
EWS
Comment 3
2022-11-29 16:24:22 PST
Committed
257150@main
(8ba585344147): <
https://commits.webkit.org/257150@main
> Reviewed commits have been landed. Closing PR #6910 and removing active labels.
Radar WebKit Bug Importer
Comment 4
2022-11-29 16:25:18 PST
<
rdar://problem/102789640
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug