Closed Bug 386533 Opened 18 years ago Closed 17 years ago

Mechanism for registering alternative nsILoginManagerStorage implementations

Categories

(Toolkit :: Password Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta4

People

(Reporter: sylvain.pasche, Assigned: sylvain.pasche)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file, 3 obsolete files)

This patch uses a category for finding an alternative cid for the nsILoginManagerStorage component.
Attachment #270526 - Flags: review?(dolske)
Please use "contractID" and not "cid", cid is the commonly used acronym for "class/component ID".
Attached patch v2 (obsolete) — Splinter Review
Thanks for your comment, I've renamed it.
Attachment #270526 - Attachment is obsolete: true
Attachment #270609 - Flags: review?(dolske)
Attachment #270526 - Flags: review?(dolske)
While this works for having *one* alternative replace the default, what if there are multiple alternative storage modules? Another flavor of this is that it would probably be a good idea to have all storage modules be detected through the same code path (including storage-Legacy.js). That makes it less likely that we'll accidently break something.
(In reply to comment #3) > While this works for having *one* alternative replace the default, what if > there are multiple alternative storage modules? Actually, the alternative storage module that will be used is the last one to perform the addCategoryEntry() call before nsLoginManager initializes the storage module. This more or less assumes that user won't have several storage module providers. > Another flavor of this is that it would probably be a good idea to have all > storage modules be detected through the same code path (including > storage-Legacy.js). That makes it less likely that we'll accidently break > something. That would be a good idea. For this to work using the current usage of the category manager, it means we need to add the default storage-Legacy category before any other components do. However, there may be timing issues for components doing it when they are registered (like I did for gnome-keyring), as I think we can't control that a given component is registered before all others.
Comment on attachment 270609 [details] [diff] [review] v2 >Index: nsLoginManager.js >=================================================================== >+ this.__storage = Cc[contractID] >+ .createInstance(Ci.nsILoginManagerStorage); Nit, make it: + this.__storage = Cc[contractID]. + createInstance(Ci.nsILoginManagerStorage); I'm ok with with this, although I would sort of prefer to not have this checked in until there's a finished Gnome / OS X nsILoginManagerStorage component ready to make use of it.
Attachment #270609 - Flags: review?(gavin.sharp)
Attachment #270609 - Flags: review?(dolske)
Attachment #270609 - Flags: review+
Attached patch v3 (obsolete) — Splinter Review
I've unassigned me from bug 309807, so this is going to stay in stand-by mode until someone takes one of the dependent bug.
Attachment #270609 - Attachment is obsolete: true
Attachment #282009 - Flags: review?(gavin.sharp)
Attachment #270609 - Flags: review?(gavin.sharp)
Taking to help push this in for Beta 4. We really ought to have a way to replace the storage module (even if imperfect), so that extensions for native Gnome/OSX storage are possible in FF3.
Assignee: nobody → dolske
Target Milestone: --- → Firefox 3 beta4
Attached patch unbitrotSplinter Review
Attachment #282009 - Attachment is obsolete: true
Attachment #304702 - Flags: review?(gavin.sharp)
Attachment #282009 - Flags: review?(gavin.sharp)
Attachment #304702 - Flags: review?(gavin.sharp) → review+
Attachment #304702 - Flags: approval1.9?
Comment on attachment 304702 [details] [diff] [review] unbitrot a=beltzner for 1.9
Attachment #304702 - Flags: approval1.9? → approval1.9+
Assignee: dolske → sylvain.pasche
Keywords: checkin-needed
Yay! Checking in toolkit/components/passwordmgr/src/nsLoginManager.js; new revision: 1.27; previous revision: 1.26
Status: NEW → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Can anyone summarize how you use this? I've looked at it for a while and am not sure I could describe it adequately in docs.
Hi Eric, I can write some explanations and sample code and let you proofread it if you point me on devmo where it should go.
Let's try putting an article here: http://developer.mozilla.org/en/docs/Creating_a_Login_Manager_storage_module Once you get something put in there, I'll clean it up as needed. Thanks!
I've created that page. I think this should provide enough information for extension authors to get started. (nsILoginStorage page is not created but the .idl is well documented).
Where is nsILoginStorage? I can't find it searching mxr.
Sorry, that was nsILoginManagerStorage. I've fixed the page. Thanks for the cleanups.
(In reply to comment #14) > (nsILoginManagerStorage page is not created but the .idl is well documented). It's functionally equivalent to the interfaces in nsILoginManger (which is mostly just a wrapper), so any page for that should probably just note that and not repeat detail from nsILoginManager.
Oh, and thanks bunches for writing up the "Creating a Login Manager storage module" wiki page!
Depends on: 434676
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: