Open Bug 462218 Opened 11 years ago Updated Last month

Read the sessionstore data from the disk instead of keeping it in memory when saving the session for private browsing mode

Categories

(Firefox :: Private Browsing, defect, P3)

defect

Tracking

()

People

(Reporter: ehsan, Unassigned)

References

Details

(Keywords: privacy, Whiteboard: [PB-P3])

Spinoff from bug 248970 comment 468.  We need to read the sessionstore data from the disk instead of keeping it in memory when saving the session for private browsing mode.

Will do it once the initial pressure of landing the private browsing patch is settled down.  :-)
The very same data will be kept around inside nsSessionStore as well.

Note BTW that we no longer guarantee sessionstore.js to contain directly usable data, as extensions could e.g. encrypt it through the sessionstore-state-(read|write) notifications. If the data written to sessionstore.js were to be used, you'd thus have to recreate sss_readStateFile from nsSessionStartup and make the notification's data actually mean something so that extensions can distinguish between the one read at startup and other read operationss such as yours.
(In reply to comment #1)
> The very same data will be kept around inside nsSessionStore as well.

Oh, is there a way to make nsSessionStore pass them back to us?

> Note BTW that we no longer guarantee sessionstore.js to contain directly usable
> data, as extensions could e.g. encrypt it through the
> sessionstore-state-(read|write) notifications. If the data written to
> sessionstore.js were to be used, you'd thus have to recreate sss_readStateFile
> from nsSessionStartup and make the notification's data actually mean something
> so that extensions can distinguish between the one read at startup and other
> read operationss such as yours.

Hmmm, I found sessionstore-state-write, but not sessionstore-state-read, and not sss_readStateFile as well...
(In reply to comment #2)
> Oh, is there a way to make nsSessionStore pass them back to us?

Indirectly. AFAICT the only reason you want it back is so that you can pass it to setBrowserState. I guess we could do that from inside nsSessionStore as well on private-browsing/exit.

> Hmmm, I found sessionstore-state-write, but not sessionstore-state-read, and
> not sss_readStateFile as well...

You're probably looking in the wrong file. Try nsSessionStartup.js.
(In reply to comment #3)
> Indirectly. AFAICT the only reason you want it back is so that you can pass it
> to setBrowserState. I guess we could do that from inside nsSessionStore as well
> on private-browsing/exit.

You mean like calling getBrowserState/setBrowserState from within nsSessionStore?  That'd not be easy, because we do this after sending out the notifications, but I may be able to fix that somehow.  The problem is that this would be essentially the same code which this bug is trying to simplify.

Or is there something I've been missing?

> You're probably looking in the wrong file. Try nsSessionStartup.js.

Oh, right!

So, this is a good point to keep in mind, but I prefer to use any in-memory data that nsSessionStore keeps around if possible.  However, I'm thinking that might not be possible, because of the fact that nsSessionStore continues to collect data in memory inside the private browsing mode as well.
Mass moving of all Firefox::General private browsing bugs to Firefox::Private Browsing.
Component: General → Private Browsing
QA Contact: general → private.browsing
Whiteboard: [PB-P3]
Wanted on trunk.
Priority: -- → P3
Target Milestone: --- → Firefox 3.2a1
Target Milestone: Firefox 3.6a1 → ---
Assignee: ehsan → nobody
Status: ASSIGNED → NEW
You need to log in before you can comment on or make changes to this bug.