Move tabs/sessions to profile

RESOLVED FIXED

Status

()

RESOLVED FIXED
3 years ago
2 years ago

People

(Reporter: wesj, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
I've been needing access to the TabsManager for Clear Private data lately. I think we'll also need it in about:home for "Switch to tab". I wind up passing references to it around a lot. We do the same thing with Profile a lot. I wonder if tabs should just be a part of the Profile?

I'm thinking something like:

Profile
  - Sessions: [Session]
    -- currentSession: Session

where Session looks something like:

Session
  - subscript[int] -> Browser
  - subscript[webview] -> Browser
  - count: Int
  - selectedTab: Browser
  - restore() // For session restore?
  - writeToDisk(file: String)

Not a v1 thing, but looking for feedback.
Not a bad idea.

James will be looking to expand the Session in his current work from just storing it to an iOS provided "bundle" to saving to disk in the profile, mainly for crash restoration.
Flags: needinfo?(jhugman)
We also need access to your tabs for Sync: every open tab, its URL history (back stack), when it was last used, and the current page title.

That sounds like:

  Session[...] ->
    Browser
      Title
      URLs

layered into Comment 0.

I'll need this very very soon -- Monday, ideally -- for tab sync. If it's not ready by then, that's OK: we'll just have one-directional tab syncing.

This needs to be an interface in Storage, not in Client, so that Sync can read from it.
Blocks: 1141847
Blocks: 1154554
No longer blocks: 1141847
(Reporter)

Comment 3

3 years ago
Created attachment 8596264 [details] [review]
PR https://github.com/mozilla/firefox-ios/pull/367

Some refactoring in here that actually doesn't need to be. Just me finding my footing. Happy to take feedback if you have time, but otherwise I'll send it for review tomorrow hopefully.
Flags: needinfo?(jhugman)
Attachment #8596264 - Flags: feedback?(rnewman)
Attachment #8596264 - Flags: feedback?(nalexander)
Comment on attachment 8596264 [details] [review]
PR https://github.com/mozilla/firefox-ios/pull/367

nits, comments, and questions added to ticket.
Attachment #8596264 - Flags: feedback?(nalexander) → feedback+
(Reporter)

Comment 5

3 years ago
Comment on attachment 8596264 [details] [review]
PR https://github.com/mozilla/firefox-ios/pull/367

Back to you nick.
Attachment #8596264 - Flags: feedback+ → review?(nalexander)
Comment on attachment 8596264 [details] [review]
PR https://github.com/mozilla/firefox-ios/pull/367

Comments on GH, but nothing major.  Sorry for the slow turnaround.
Attachment #8596264 - Flags: review?(nalexander) → review+
(Reporter)

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Attachment #8596264 - Flags: feedback?(rnewman)
Component: General → Data Storage
OS: Mac OS X → iOS
Hardware: x86 → All
You need to log in before you can comment on or make changes to this bug.