Closed Bug 829383 Opened 7 years ago Closed 7 years ago

gNumberOfAlwaysOpenPrivateDocShells will be incorrect when hidden private window contains child docshells

Categories

(Firefox :: Private Browsing, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 21
Tracking Status
firefox20 + fixed
firefox21 --- fixed

People

(Reporter: jdm, Assigned: jdm)

References

Details

Attachments

(1 file)

Won't the number of always open private docshells be equal to the 0 or 1 + the number of child docshells of the hidden private window? This looks like it will break once Jetpack starts adding panels to it.
Blocks: PBnGen
Assignee: nobody → josh
As discussed on IRC, let's store a flag on the docshell, something like mDontGiveACrap (with a better name), set it to true on the hidden window docshell, propagate it to children, and bypass this whole business of increasing and decreasing the private docshell count when that flag is set...

We should also get a test for this.  You can stick an iframe or something under the private hidden window...
Every time I change this code I find cause to feel slightly dirtier.
Attachment #702337 - Flags: review?(bzbarsky)
Comment on attachment 702337 [details] [diff] [review]
Ensure hidden private window docshells aren't counted towards private session lifetime.

Let's assume that Josh has rev'ed nsIDocShell's uuid.
Comment on attachment 702337 [details] [diff] [review]
Ensure hidden private window docshells aren't counted towards private session lifetime.

Don't you need to IncreasePrivatDocShellCount() if aAffectLifetime && !mAffectPrivateSessionLifetime && mInPrivateBrowsing?

r=me with that fixed.
Attachment #702337 - Flags: review?(bzbarsky) → review+
This is going to affect 20, so it will need an uplift.
Comment on attachment 702337 [details] [diff] [review]
Ensure hidden private window docshells aren't counted towards private session lifetime.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 815847
User impact if declined: Private browsing data that doesn't get cleared when using certain jetpack addons.
Testing completed (on m-c, etc.): m-c, automated test
Risk to taking this patch (and alternatives if risky): Not risky. Well-scoped functionality change to one component.
String or UUID changes made by this patch: nsIDocShell UUID
Attachment #702337 - Flags: approval-mozilla-aurora?
Blocks: 829360
https://hg.mozilla.org/mozilla-central/rev/ee7cb4422133
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
Comment on attachment 702337 [details] [diff] [review]
Ensure hidden private window docshells aren't counted towards private session lifetime.

Approving for aurora since we need/want this for the pb feature in 20.
Attachment #702337 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
The test landed here only makes sense in per-window PB builds.  This patch marks it as such:

https://hg.mozilla.org/integration/mozilla-inbound/rev/e775b0323811
https://hg.mozilla.org/releases/mozilla-aurora/rev/b1c12aa591e0
You need to log in before you can comment on or make changes to this bug.