Bug 181875

Summary: [Curl] CurlRequest must protect its client from disposal while it's on duty.
Product: WebKit Reporter: Basuke Suzuki <Basuke.Suzuki>
Component: WebCore Misc.Assignee: Basuke Suzuki <Basuke.Suzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, Basuke.Suzuki, commit-queue, don.olmstead, ews-watchlist, galpeter, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 117300    
Attachments:
Description Flags
patch
achristensen: review-
use ref/deref none

Description Basuke Suzuki 2018-01-19 13:02:58 PST
Adding retain/release method to the client protocol and use them to protect the client from disposal.
Comment 1 Basuke Suzuki 2018-01-19 13:23:29 PST
Created attachment 331779 [details]
patch
Comment 2 Alex Christensen 2018-01-19 14:05:22 PST
Comment on attachment 331779 [details]
patch

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

> Source/WebCore/platform/network/curl/CurlRequestClient.h:39
> +    virtual void retain() = 0;
> +    virtual void release() = 0;

Can these be called ref and deref?  Then we can just make RefPtr's instead of manually calling retain and release.
We do something similar in several places, like IDBConnectionToServerDelegate, IDBConnectionToClientDelegate, CSSFontFace::Client, CSSRuleList, CSSStyleDeclaration, and ServiceWorkerJobClient
Comment 3 Basuke Suzuki 2018-01-19 15:59:53 PST
(In reply to Alex Christensen from comment #2)
> Comment on attachment 331779 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=331779&action=review
> 
> > Source/WebCore/platform/network/curl/CurlRequestClient.h:39
> > +    virtual void retain() = 0;
> > +    virtual void release() = 0;
> 
> Can these be called ref and deref?  Then we can just make RefPtr's instead
> of manually calling retain and release.
> We do something similar in several places, like
> IDBConnectionToServerDelegate, IDBConnectionToClientDelegate,
> CSSFontFace::Client, CSSRuleList, CSSStyleDeclaration, and
> ServiceWorkerJobClient

Okay, thanks. We'll take a look into those.
Comment 4 Basuke Suzuki 2018-01-23 13:08:01 PST
Created attachment 332065 [details]
use ref/deref
Comment 5 WebKit Commit Bot 2018-01-23 14:30:12 PST
The commit-queue encountered the following flaky tests while processing attachment 332065 [details]:

js/arity-mismatch-at-vmentry.html bug 182014 (authors: cdumez@apple.com and msaboff@apple.com)
The commit-queue is continuing to process your patch.
Comment 6 WebKit Commit Bot 2018-01-23 14:30:44 PST
Comment on attachment 332065 [details]
use ref/deref

Clearing flags on attachment: 332065

Committed r227449: <https://trac.webkit.org/changeset/227449>
Comment 7 WebKit Commit Bot 2018-01-23 14:30:46 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-01-23 14:31:54 PST
<rdar://problem/36794134>