Bug 181875 - [Curl] CurlRequest must protect its client from disposal while it's on duty.
Summary: [Curl] CurlRequest must protect its client from disposal while it's on duty.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Basuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks: 117300
  Show dependency treegraph
 
Reported: 2018-01-19 13:02 PST by Basuke Suzuki
Modified: 2018-01-23 14:31 PST (History)
8 users (show)

See Also:


Attachments
patch (7.30 KB, patch)
2018-01-19 13:23 PST, Basuke Suzuki
achristensen: review-
Details | Formatted Diff | Diff
use ref/deref (7.23 KB, patch)
2018-01-23 13:08 PST, Basuke Suzuki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>