If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[e10s] Don't send so many CPOWs in content policy shim

RESOLVED FIXED in Firefox 36

Status

()

Firefox
Extension Compatibility
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: billm, Assigned: billm)

Tracking

34 Branch
Firefox 36
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Created attachment 8514710 [details] [diff] [review]
opt-shouldload

There are a couple of parameters to content policy shim that Adblock uses that we send using CPOWs but we don't have to. In particular:

- contentLocation is a URL
- so is requestOrigin

We can send the spec for these URLs rather than a CPOW for the nsIURL.

I also added requestPrincipal, which is a new parameter added to nsIContentPolicy. It can be sent without a CPOW as well since the message manager can send principals natively.

The fewer CPOWs we send, the faster Adblock gets.
Attachment #8514710 - Flags: review?(mconley)
(Assignee)

Comment 1

3 years ago
In a testcase I've been using, this reduces the number of CPOWs sent from 49492 to 30626.
Comment on attachment 8514710 [details] [diff] [review]
opt-shouldload

Review of attachment 8514710 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good - and those CPOW stats are awesome. Keep it up!

::: toolkit/components/addoncompat/RemoteAddonsChild.jsm
@@ +142,5 @@
>        catMan.deleteCategoryEntry("content-policy", this._contractID, false);
>      }
>    },
>  
> +  shouldLoad: function(contentType, contentLocation, requestOrigin, node, mimeTypeGuess, extra, requestPrincipal) {

Nit - let's break this up over a pair of lines, if we can.
Attachment #8514710 - Flags: review?(mconley) → review+
(Assignee)

Comment 3

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/53a8066df9a9
https://hg.mozilla.org/mozilla-central/rev/53a8066df9a9
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 36
You need to log in before you can comment on or make changes to this bug.