Closed Bug 463000 Opened 16 years ago Closed 16 years ago

Handle DOM Storage in Private Browsing Mode

Categories

(Firefox :: Private Browsing, defect, P2)

defect

Tracking

()

RESOLVED FIXED
Firefox 3.6a1

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 3 obsolete files)

To throw or not throw a security error on DOM Storage access in private browsing mode; to use or not to use a memory-based DB implementation for DOM Storage inside the private browsing mode. These are the questions. :-)
Flags: blocking-firefox3.1?
Blocking for decisions to be made. Seems like we should do the same thing as we do for cookies, in terms of policy.
Flags: blocking-firefox3.1? → blocking-firefox3.1+
dcamp, is there a way to force everything to session-only? dveditz seemed to think so, otherwise I'm inclined to just fail here for 3.1.
It should work to always return false in nsDOMStorage::UseDB() when in private mode. That's what we do when the cookie pref is session-only..
Mass moving of all Firefox::General private browsing bugs to Firefox::Private Browsing.
Component: General → Private Browsing
QA Contact: general → private.browsing
Priority: -- → P2
(In reply to comment #3) > It should work to always return false in nsDOMStorage::UseDB() when in private > mode. That's what we do when the cookie pref is session-only.. As I understand it, this would that within a PB session, sites could set and retrieve DOMStorage info, but that it wouldn't persist after PB exit. What would it do to DOMStorage set up before entering PB? Am I right to think that this would be a pretty easy patch?
After entering PB mode, you'd get an empty, memory-only storage. It wouldn't overwrite the real on-disk data, but it wouldn't be able to access it either. When you came out of PB mode you'd be back with the original db-backed data. It would mostly be an easy patch - you just need to start returning false from UseDB(), and upon entering and leaving PB mode you'd need to clear mItems/mItemsCached.
Whiteboard: [PB-P1]
Attached patch WIP (obsolete) (deleted) — Splinter Review
In this patch, I think I have implemented all the things mentioned in comment 6, however the test fails because Pair-A exists in the private mode. Can you think of something that I'm doing wrong here?
Whiteboard: [PB-P1] → [PB-P1][wip patch][needs comment dcamp]
This might be bug 426436, have you tried checking against an empty string rather than undefined?
(In reply to comment #8) > This might be bug 426436, have you tried checking against an empty string > rather than undefined? Yes, it looks like it. I'll check to make sure and will update the patch if necessary. With this issue addressed I think the patch is ready for review.
Whiteboard: [PB-P1][wip patch][needs comment dcamp] → [PB-P1]
Attached patch Patch (v1) (obsolete) (deleted) — Splinter Review
Bug 426436 was indeed the problem here. I updated the unit test to account for that (and a few other minor enhancements), but code wise this is the same as the WIP patch. And it's ready for review.
Attachment #362296 - Attachment is obsolete: true
Attachment #362887 - Flags: superreview?(dcamp)
Attachment #362887 - Flags: review?(dcamp)
Whiteboard: [PB-P1]
Whiteboard: [has patch][needs review campd]
Comment on attachment 362887 [details] [diff] [review] Patch (v1) > nsDOMStorageManager* nsDOMStorageManager::gStorageManager; >+PRBool nsDOMStorageManager::mInPrivateBrowsing = PR_FALSE; nsDOMStorageManager is a singleton, this can be an instance member. Looks good other than that. Moved sr over to jst, I'm not a super-reviewer.
Attachment #362887 - Flags: superreview?(jst)
Attachment #362887 - Flags: superreview?(dcamp)
Attachment #362887 - Flags: review?(dcamp)
Attachment #362887 - Flags: review+
Attached patch Patch (v1.1) (obsolete) (deleted) — Splinter Review
Made mInPrivateBrowsing an instance variable.
Attachment #362887 - Attachment is obsolete: true
Attachment #362947 - Flags: superreview?(jst)
Attachment #362887 - Flags: superreview?(jst)
Attached patch Patch (v1.1) (deleted) — Splinter Review
Ah, forgot to qrefresh... :/
Attachment #362947 - Attachment is obsolete: true
Attachment #362949 - Flags: superreview?(jst)
Attachment #362947 - Flags: superreview?(jst)
Whiteboard: [has patch][needs review campd] → [has patch][needs super-review jst]
Attachment #362949 - Flags: superreview?(jst) → superreview+
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [has patch][needs super-review jst]
Target Milestone: Firefox 3.1 → Firefox 3.2a1
I backed this out on suspicion of causing semi-random mochichrome orange (which did indeed clear up). Please reland on its own at some point, or at least not with the other two patches it landed with.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: