Closed Bug 489869 Opened 15 years ago Closed 15 years ago

Create a new nsISessionStore interface for 1.9.1 branch

Categories

(Firefox :: Session Restore, defect)

3.5 Branch
x86
macOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Firefox 3.5

People

(Reporter: zpao, Assigned: zpao)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 2 obsolete files)

Bug 394759 added to the session store IDL but didn't rev the uuid (on branch only), so binary extensions can't use the methods added.
Flags: blocking-firefox3.5?
Blocks: 394759
No longer depends on: 394759
Attached patch Patch v0.1 (obsolete) — Splinter Review
The patch (doing it how I think Gavin said I was supposed to)
Attachment #375209 - Flags: review?(zeniko)
Comment on attachment 375209 [details] [diff] [review]
Patch v0.1

>+interface nsISessionStore_MOZILLA_1_9_1 : nsISupports

Any reason for not inheriting from nsISessionStore so that 1.9.1 extensions can just QI for this interface and get everything?

>   QueryInterface: XPCOMUtils.generateQI([Ci.nsISessionStore,
>                                          Ci.nsIDOMEventListener,
>                                          Ci.nsIObserver,
>-                                         Ci.nsISupportsWeakReference]),
>+                                         Ci.nsISupportsWeakReference,
>+                                         Ci.nsISessionStore_MOZILLA_1_9_1,
>+                                         Ci.nsIClassInfo]),
>+
>+  getInterfaces: function(countRef) {
>+    let interfaces = [Ci.nsISessionStore, Ci.nsIDOMEventListener,
>+                      Ci.nsIObserver, Ci.nsISupportsWeakReference,
>+                      Ci.nsISessionStore_MOZILLA_1_9_1, Ci.nsIClassInfo];
>+    countRef.value = interfaces.length;
>+    return interfaces;
>+  },

Is this redundancy really necessary?

>+  getHelperForLanguage: function(language) null,

Nit: Function arguments always have an a prefix in this file: aLanguage.
Attachment #375209 - Flags: review?(zeniko)
(In reply to comment #2)
> Any reason for not inheriting from nsISessionStore so that 1.9.1 extensions can
> just QI for this interface and get everything?

nsIClassInfo should remove the need for people to worry about the branch interface entirely, right? I think that makes inheritance here unnecessary.

> Is this redundancy really necessary?

getInterfaces usually omits nsISupports, but including it probably doesn't hurt, so I suppose you could use a member variable to store the array of interfaces.
(In reply to comment #3)
> (In reply to comment #2)
> > Any reason for not inheriting from nsISessionStore so that 1.9.1 extensions can
> > just QI for this interface and get everything?
> 
> nsIClassInfo should remove the need for people to worry about the branch
> interface entirely, right? I think that makes inheritance here unnecessary.

I'm new to this and not so familiar with C++/XPCOM/whatever, but doesn't it need to inherit for binary consumers to be able to use the nsISessionStore methods?
(In reply to comment #4)
> I'm new to this and not so familiar with C++/XPCOM/whatever, but doesn't it
> need to inherit for binary consumers to be able to use the nsISessionStore
> methods?

No, they can just QI to either of the interfaces. However, inheritance would avoid the need for that, and I can't really think of a reason not to do it, so feel free I guess.
Attached patch Patch v0.2 (obsolete) — Splinter Review
Put the interfaces in a constant, added the other things needed for nsIClassInfo. It's on tryserver making sure it doesn't break anything
Attachment #375209 - Attachment is obsolete: true
Attachment #375363 - Flags: review?(zeniko)
Comment on attachment 375363 [details] [diff] [review]
Patch v0.2

Nit: s/countRef/aCountRef/.

BTW: Do we also have to revert nsISessionStore's IID?

r+=me with that fixed.
Attachment #375363 - Flags: review?(zeniko) → review+
(In reply to comment #7)
> Nit: s/countRef/aCountRef/.

I meant to ask about that... since countRef is actually an out param, does it still get the "a" prefix?

> BTW: Do we also have to revert nsISessionStore's IID?

It got reverted before beta 4 freeze: http://hg.mozilla.org/releases/mozilla-1.9.1/rev/b057539eee94
(In reply to comment #8)
> since countRef is actually an out param, does it still get the "a" prefix?

It does: the "a" just stands for Argument (as opposed to "g" for Global and "m" for Module). For reference, see <https://developer.mozilla.org/en/JavaScript_style_guide#Function_and_variable_naming>
Attached patch Patch v1.0Splinter Review
Attachment #375363 - Attachment is obsolete: true
Attachment #375427 - Flags: approval1.9.1?
Flags: blocking-firefox3.5? → blocking-firefox3.5-
Comment on attachment 375427 [details] [diff] [review]
Patch v1.0

a191=beltzner
Attachment #375427 - Flags: approval1.9.1? → approval1.9.1+
Keywords: checkin-needed
Whiteboard: [needs 1.9.1 landing]
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/bca816f58a7f
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: [needs 1.9.1 landing]
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: