Bug 248458
| Summary: | [Curl] Register/Unregister NetworkDataTaskCurl to NetworkSession | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kenji Shukuwa <kenji.shukuwa> |
| Component: | Platform | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | fujii.hironori, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Kenji Shukuwa
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
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
Pull request: https://github.com/WebKit/WebKit/pull/6910
EWS
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
<rdar://problem/102789640>