Closed Bug 1174666 Opened 9 years ago Closed 9 years ago

Remove unneeded SessionSaver.clearLastSaveTime()

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 41
Tracking Status
firefox41 --- fixed

People

(Reporter: ttaubert, Assigned: ttaubert)

Details

Attachments

(1 file, 1 obsolete file)

If SessionStore.initializeWindow() were a little more intelligent we wouldn't need that function. Let's remove it and simplify the SessionSaver code.
Comment on attachment 8622386 [details] [diff] [review]
0001-Bug-1174666-Remove-unneeded-SessionSaver.clearLastSa.patch

Review of attachment 8622386 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/sessionstore/SessionStore.jsm
@@ +912,5 @@
>  
>        // restore a crashed session resp. resume the last session if requested
>        if (aInitialState) {
> +        // Don't write to disk right after startup.
> +        SessionSaver.updateLastSaveTime();

This is something of a hack. I fully support it, but please mention that you're resetting the clock [to avoid writing immediately].

@@ -938,5 @@
>          // Nothing to restore, notify observers things are complete.
>          Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED, "");
> -
> -        // The next delayed save request should execute immediately.
> -        SessionSaver.clearLastSaveTime();

Mmmh... What did that do, exactly? And why don't we need it anymore?
Attachment #8622386 - Flags: review?(dteller) → feedback+
(In reply to David Rajchenbach-Teller [:Yoric] (away June 22 - July 7th, use "needinfo") from comment #2)
> >        // restore a crashed session resp. resume the last session if requested
> >        if (aInitialState) {
> > +        // Don't write to disk right after startup.
> > +        SessionSaver.updateLastSaveTime();
> 
> This is something of a hack. I fully support it, but please mention that
> you're resetting the clock [to avoid writing immediately].

This isn't something new I'm adding, I'm just moving it. Will update the comment.

> @@ -938,5 @@
> >          // Nothing to restore, notify observers things are complete.
> >          Services.obs.notifyObservers(null, NOTIFY_WINDOWS_RESTORED, "");
> > -
> > -        // The next delayed save request should execute immediately.
> > -        SessionSaver.clearLastSaveTime();
> 
> Mmmh... What did that do, exactly? And why don't we need it anymore?

This was setting lastWriteTime=0, basically reverting the updateLastSaveTime() call from above. If we just move that to the proper branch we don't need it.
Attachment #8625555 - Flags: review?(dteller) → review+
https://hg.mozilla.org/mozilla-central/rev/8d99fb177495
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 41
You need to log in before you can comment on or make changes to this bug.