Bug 197215

Summary: Remove Ad Click Attribution data when removing website data
Product: WebKit Reporter: John Wilander <wilander>
Component: WebKit Misc.Assignee: John Wilander <wilander>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description John Wilander 2019-04-23 15:20:56 PDT
Calls to WebsiteDataStore::removeData() should remove Ad Click Attribution data.
Comment 1 John Wilander 2019-04-23 15:21:18 PDT
<rdar://problem/47668988>
Comment 2 John Wilander 2019-04-23 16:02:23 PDT
Created attachment 368076 [details]
Patch
Comment 3 Chris Dumez 2019-04-23 16:08:56 PDT
Comment on attachment 368076 [details]
Patch

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

> Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp:181
> +    m_unconvertedAdClickAttributionMap.removeIf([domain = domain](auto& keyAndValue) {

domain = domain
should be
&domain

> Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp:182
> +        if (keyAndValue.key.first.registrableDomain == domain || keyAndValue.key.second.registrableDomain == domain)

could be written on one line:
return keyAndValue.key.first.registrableDomain == domain || keyAndValue.key.second.registrableDomain == domain;

> Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp:187
> +    m_convertedAdClickAttributionMap.removeIf([domain = WTFMove(domain)](auto& keyAndValue) {

ditto, should be &domain.

> Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp:188
> +        if (keyAndValue.key.first.registrableDomain == domain || keyAndValue.key.second.registrableDomain == domain)

ditto, could be written on 1 line.
Comment 4 John Wilander 2019-04-23 16:37:40 PDT
(In reply to Chris Dumez from comment #3)
> Comment on attachment 368076 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=368076&action=review
> 
> > Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp:181
> > +    m_unconvertedAdClickAttributionMap.removeIf([domain = domain](auto& keyAndValue) {
> 
> domain = domain
> should be
> &domain
> 
> > Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp:182
> > +        if (keyAndValue.key.first.registrableDomain == domain || keyAndValue.key.second.registrableDomain == domain)
> 
> could be written on one line:
> return keyAndValue.key.first.registrableDomain == domain ||
> keyAndValue.key.second.registrableDomain == domain;
> 
> > Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp:187
> > +    m_convertedAdClickAttributionMap.removeIf([domain = WTFMove(domain)](auto& keyAndValue) {
> 
> ditto, should be &domain.
> 
> > Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp:188
> > +        if (keyAndValue.key.first.registrableDomain == domain || keyAndValue.key.second.registrableDomain == domain)
> 
> ditto, could be written on 1 line.

Thank you, I will fix all these things.
Comment 5 John Wilander 2019-04-23 16:55:01 PDT
Created attachment 368086 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2019-04-23 17:13:06 PDT
Comment on attachment 368086 [details]
Patch for landing

Clearing flags on attachment: 368086

Committed r244572: <https://trac.webkit.org/changeset/244572>
Comment 7 WebKit Commit Bot 2019-04-23 17:13:07 PDT
All reviewed patches have been landed.  Closing bug.