Closed Bug 675493 Opened 10 years ago Closed 9 years ago

Port [Bug 655550 - Persisted tab attribute gets lost after restart twice] and one relevant line from [Bug 644998 - Session should not be restorable after "Clear Recent History"]

Categories

(SeaMonkey :: Session Restore, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: misak.bugzilla, Assigned: misak.bugzilla)

References

Details

Attachments

(2 files, 1 obsolete file)

Attached patch patchSplinter Review
From parent bugs:

User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

See the following steps.

Reproducible: Always

Steps to Reproduce:
1. Execute in JS shell:
> gBrowser.selectedTab.setAttribute("visited", true);
> Cc["@mozilla.org/browser/sessionstore;1"]
.getService(Ci.nsISessionStore)
.persistTabAttribute("visited");
2. Restart Firefox and check the "visited" attribute
3. Restart Firefox again and check the "visited" attribute

The "visited" attribute is restored correctly after step 2, but lost after step 3, is it intended?

and:

User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0

Do a cleaning of -all- temp data of all periods (from an empty tab). Then, you'll see that a restore of a prev. session is available.

Reproducible: Sometimes

Steps to Reproduce:
1. Open a new empty tab.
2. Clean -all- temp data.
3. Sometimes, a prev. session restore is available.
Actual Results:  
Disfunction / error.

Expected Results:  
All blank.

none
Attachment #549642 - Flags: review?(neil)
Comment on attachment 549642 [details] [diff] [review]
patch

>+      this._lastSessionState = null;
r=me on the persisted attribute changes. But this isn't enough for the clear private data changes, because the menuitem will still be enabled.
Attachment #549642 - Flags: review?(neil) → review+
I decided to push this.

http://hg.mozilla.org/comm-central/rev/0726a2df959e

Further fix will be introduced shortly.
Comment on attachment 567279 [details] [diff] [review]
hide "restore previous session" menu item after clearing private data

>       this._forEachBrowserWindow(function(aWindow) {
>         Array.forEach(aWindow.getBrowser().tabs, function(aTab) {
>           delete aTab.linkedBrowser.__SS_data;
>           if (aTab.linkedBrowser.__SS_restoreState)
>             this._resetTabRestoringState(aTab);
>         });
>         openWindows[aWindow.__SSi] = true;
Why not append the disabling code to this existing loop?
Attachment #567279 - Flags: review?(neil) → review+
Hmm, You right as always. Carrying forward r+
Attachment #567279 - Attachment is obsolete: true
Attachment #567326 - Flags: review+
Pushed: http://hg.mozilla.org/comm-central/rev/ef00acb3f67a
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.