Bug 207903 - NetworkDataTask should not expect its session wrapper to be always live
Summary: NetworkDataTask should not expect its session wrapper to be always live
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL: InRadar
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-18 12:51 PST by youenn fablet
Modified: 2020-02-18 15:09 PST (History)
4 users (show)

See Also:


Attachments
Patch (5.32 KB, patch)
2020-02-18 12:55 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (5.41 KB, patch)
2020-02-18 14:10 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2020-02-18 12:51:12 PST
NetworkDataTask should not expect its session wrapper to be always live
Comment 1 youenn fablet 2020-02-18 12:52:56 PST
<rdar://problem/59291486>
Comment 2 Radar WebKit Bug Importer 2020-02-18 12:53:15 PST
<rdar://problem/59561689>
Comment 3 youenn fablet 2020-02-18 12:53:46 PST
<rdar://problem/59291486>
Comment 4 youenn fablet 2020-02-18 12:55:47 PST
Created attachment 391079 [details]
Patch
Comment 5 youenn fablet 2020-02-18 14:04:44 PST
Comment on attachment 391079 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=391079&action=review

> Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h:93
> +    WeakPtr<SessionWrapper> m_sessionWrapper;

I think the WeakPtr is necessary in case of SessionWrapper being an isolated session, which can be removed or cleared at various points in time.
Comment 6 Alex Christensen 2020-02-18 14:07:45 PST
Comment on attachment 391079 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=391079&action=review

> Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:321
>      if (!m_task || !m_session)

Let's just replace m_session with m_sessionWrapper, which is the only one used in this function.
Comment 7 youenn fablet 2020-02-18 14:10:56 PST
Created attachment 391088 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2020-02-18 15:09:05 PST
Comment on attachment 391088 [details]
Patch for landing

Clearing flags on attachment: 391088

Committed r256857: <https://trac.webkit.org/changeset/256857>
Comment 9 WebKit Commit Bot 2020-02-18 15:09:07 PST
All reviewed patches have been landed.  Closing bug.