Closed Bug 491577 Opened 15 years ago Closed 15 years ago

new API: allow to delete a single closed window

Categories

(Firefox :: Session Restore, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3.6b1

People

(Reporter: morac, Assigned: morac)

Details

Attachments

(1 file, 3 obsolete files)

Since bug 394759 dropped, it would be nice to add an API to delete a closed window similar to how bug 461634 added an API to delete a closed tab.
Adding this to my radar. It should be easy enough & mirror the work done in bug 461634.
I originally assigned this to myself since I wrote the patch for bug 461634.  I kind of forgot about this bug.  

Are you just watching this or did you want to write the patch for it?
(In reply to comment #2)
> Are you just watching this or did you want to write the patch for it?

Just watching. Feel free to write this.
Finally got around to this.  Modeled the patch after the one I wrote to forget closed tabs.  The closed window list is slightly different since it also keeps track of popups, but I don't think that needs to be taken into account in this case since the caller is specifying the specific window to remove from the closed window list.
Attachment #393441 - Flags: superreview?(dietrich)
Attachment #393441 - Flags: review?(zeniko)
Attachment #393441 - Flags: review?(zeniko) → review+
Comment on attachment 393441 [details] [diff] [review]
Patch to add forgetClosedWindow function plus test files

>+    // default to the most-recently closed tab

s/tab/window/

>+ * The Initial Developer of the Original Code is
>+ * Simon Bünzli <zeniko@gmail.com>.

You?

>+ * Portions created by the Initial Developer are Copyright (C) 2008

2009?

>+                { url: "http://example.com", title: REMEMBER }

Have you intentionally set this title to REMEMBER?

>+    let closedWindows = eval("(" + ss.getClosedWindowData() + ")");

JSON.parse, please.

r+=me with these fixed.
Attached patch take 2 (obsolete) — Splinter Review
(In reply to comment #5)
> s/tab/window/
> 
I thought I caught all of those but missed one, sigh.


> >+ * The Initial Developer of the Original Code is
> >+ * Simon Bünzli <zeniko@gmail.com>.
> 
> You?
>

The test in this patch was originated from the test in bug 461634.  That test was originated from the test you wrote for bug 464199.  So technically you are the initial developer since I started with code you wrote. I can change it if you desire.

> 
> >+ * Portions created by the Initial Developer are Copyright (C) 2008
> 
> 2009?
> 

See above.

> >+                { url: "http://example.com", title: REMEMBER }
> 
> Have you intentionally set this title to REMEMBER?
>

No I didn't.  It doesn't really make a difference, but I'll change it to "title" like the rest.

> 
> >+    let closedWindows = eval("(" + ss.getClosedWindowData() + ")");
> 
> JSON.parse, please.
> 

Fixed.
Attachment #393441 - Attachment is obsolete: true
Attachment #393454 - Flags: superreview?(dietrich)
Attachment #393454 - Flags: review+
Attachment #393441 - Flags: superreview?(dietrich)
Comment on attachment 393454 [details] [diff] [review]
take 2

r=me, thanks
Attachment #393454 - Flags: superreview?(dietrich) → superreview+
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/1f828c511a8d
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.6b1
http://hg.mozilla.org/mozilla-central/rev/b45fff56cb71

You should at least run your own test before claiming it's ready for check-in.
(In reply to comment #9)
> http://hg.mozilla.org/mozilla-central/rev/b45fff56cb71
> 
> You should at least run your own test before claiming it's ready for check-in.

Sorry about that.  I actually had run the tests, which all passed, but forgot to run them again after changing "eval" to "JSON.parse", since I did so on a different machine without the source installed.
Comment on attachment 393454 [details] [diff] [review]
take 2

i'm not a superreviewer, you'll need to get SR from mconnor or another SR for the api change.
Attachment #393454 - Flags: superreview+ → review+
Attachment #393454 - Flags: superreview?(mconnor)
(In reply to comment #11)
> (From update of attachment 393454 [details] [diff] [review])
> i'm not a superreviewer, you'll need to get SR from mconnor or another SR for
> the api change.

?  
You SRed the patch to bug 461634 so I assumed you cold SR this one.

I added mconnor as a SR, but it's already been checked-in at this point so everything is kind of backwards.
Attachment #393454 - Flags: superreview?(mconnor) → superreview+
Comment on attachment 393454 [details] [diff] [review]
take 2

>diff -r 05d7e81676bd browser/components/sessionstore/nsISessionStore.idl

>@@ -164,6 +164,11 @@
>   nsIDOMWindow undoCloseWindow(in unsigned long aIndex);
> 
>   /**
>+   * @param aIndex  is the index of the closed window to be removed (FIFO ordered).
>+   */
>+  nsIDOMNode forgetClosedWindow(in unsigned long aIndex);
>+
>+  /**

need to add:

@throws NS_ERROR_INVALID_ARG
  when aIndex does not map to a closed window

sr=me
I added the "@throws" comment, but I'll mention that all the API calls in sessionstore can throw at least one exception and none of the other entries in sessionstore.idl list @throws in the definition.

It should be added to all the other function definitions as well.
Attachment #393454 - Attachment is obsolete: true
Attachment #394162 - Flags: superreview+
Attachment #394162 - Flags: review+
Keywords: checkin-needed
Comment on attachment 394162 [details] [diff] [review]
take 3 - added @throws as directed

This won't apply, since attachment 393454 [details] [diff] [review] is already checked in.
Attachment #394162 - Attachment is obsolete: true
Attachment #394162 - Flags: superreview+
Attachment #394162 - Flags: review+
Keywords: checkin-needed
I had a feeling that might be the case.  Here's a diff patch from the latest trunk.
Attachment #394211 - Flags: superreview+
Attachment #394211 - Flags: review+
Keywords: checkin-needed
Attachment #393454 - Flags: review+
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: