canmove, Confirmed users
1,537
edits
| Line 80: | Line 80: | ||
Create a hashtable (ht) keyed on third party sites (domain stripped to ETLD+1). | Create a hashtable (ht) keyed on third party sites (domain stripped to ETLD+1). | ||
Each entry x of ht is a pair of counts: { | Each entry x of ht is a pair of counts: { blockedAttempts, allowedAttempts } | ||
* ht[x]. | * ht[x].blockedAttempts = number of loads where x's set-cookie was blocked as a third party | ||
* ht[x]. | * ht[x].allowedAttempts = number of loads where x's set-cookie was allowed as a third party | ||
| Line 88: | Line 88: | ||
if domain (ETLD+1) x is thirdparty: | if domain (ETLD+1) x is thirdparty: | ||
if set-cookie is blocked by policy: | if set-cookie is blocked by policy: | ||
ht[x]. | ht[x].blockedAttempts++ | ||
else | else | ||
ht[x]. | ht[x].allowedAttempts++ | ||
On roll-up (prepare to ping): | On roll-up (prepare to ping): | ||
HA, HB = new histograms. | HA, HB = new histograms. | ||
for each key x in ht: | for each key x in ht: | ||
HA.incrementBucketFor(ht[x]. | HA.incrementBucketFor(ht[x].allowedAttempts) | ||
HB.incrementBucketFor(ht[x]. | HB.incrementBucketFor(ht[x].blockedAttempts) | ||
Reset ht and HA, HB per session. | Reset ht and HA, HB per session. | ||