Closed Bug 1091959 Opened 10 years ago Closed 10 years ago

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

Categories

(Firefox :: Extension Compatibility, defect)

34 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 36

People

(Reporter: billm, Assigned: billm)

References

Details

Attachments

(1 file)

Attached patch opt-shouldloadSplinter Review
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)
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+
https://hg.mozilla.org/mozilla-central/rev/53a8066df9a9
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 36
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: