Closed Bug 739056 Opened 13 years ago Closed 11 years ago

Port |Bug 715099 - Convert nsProfileMigrator to JS so we can use JS modules on migration| to SeaMonkey

Categories

(SeaMonkey :: Startup & Profiles, defect)

defect
Not set
normal

Tracking

(seamonkey2.9 wontfix, seamonkey2.10 wontfix, seamonkey2.11 wontfix, seamonkey2.12 wontfix)

RESOLVED FIXED
seamonkey2.23
Tracking Status
seamonkey2.9 --- wontfix
seamonkey2.10 --- wontfix
seamonkey2.11 --- wontfix
seamonkey2.12 --- wontfix

People

(Reporter: sgautherie, Assigned: ewong)

References

Details

Attachments

(1 file, 7 obsolete files)

No description provided.
Target Milestone: seamonkey2.11 → ---
No longer blocks: 739041
Attached patch Convert nsProfileMigrator to JS. (v1) (obsolete) (deleted) — Splinter Review
Assignee: nobody → ewong
Status: NEW → ASSIGNED
Attachment #642467 - Flags: review?(neil)
Comment on attachment 642467 [details] [diff] [review] Convert nsProfileMigrator to JS. (v1) patch has been bitrotted. will come up with an updated patch.
Attachment #642467 - Flags: review?(neil)
Attachment #642467 - Attachment is obsolete: true
Attached patch Convert nsProfileMigrator to JS.. (v2) (obsolete) (deleted) — Splinter Review
Attachment #775048 - Flags: review?(neil)
Comment on attachment 775048 [details] [diff] [review] Convert nsProfileMigrator to JS.. (v2) >-#include "nsThunderbirdProfileMigrator.h" You removed the Thunderbird migrator, but you didn't replace it with anything... probably because there isn't anything for you to copy from ;-) >+++ b/suite/profile/migration/src/ProfileMigrator.js Just skimmed this file for now... >+ _toCString: function PM__toCString(aStr) { >+ let cstr = Components.classes["@mozilla.org/supports-cstring;1"] >+ .createInstance(Components.interfaces.nsISupportsCString); >+ cstr.data = aStr; >+ return cstr; >+ }, I guess you just copied this, but in fact there's no reason to use a CString here, a normal String would be fine. >+ let cid = "@mozilla.org/profile/migrator;1?app=browser&type=" + aKey; app=suite (!) >+component {C9DF9BD9-3050-46D4-B55B-20E8CCCAF41A} ProfileMigrator.js I hope this is a new CID. >++contract @mozilla.org/toolkit/profile-migrator;1 {C9DF9BD9-3050-46D4-B55B-20E8CCCAF41A} ++? >\ No newline at end of file Oops. >+EXTRA_PP_COMPONENTS += [ >+ 'ProfileMigrator.js' , >+ 'SuiteProfileMigrator.manifest' , Don't need to preprocess the manifest. Well, not yet, anyway.
Comment on attachment 775048 [details] [diff] [review] Convert nsProfileMigrator to JS.. (v2) >+ .nsIBrowserProfileMigrator); nsISuiteProfileMigrator >+ // We don't yet support checking for the default browser on all platforms, >+ // needless to say we don't have migrators for all browsers. Thus, for each >+ // platform, there's a fallback list of migrators used in these cases. >+ _PLATFORM_FALLBACK_LIST: >+#ifdef XP_WIN >+ ["ie", "chrome", /* safari */], >+#elifdef XP_MACOSX >+ ["safari", "chrome"], >+#else >+ ["chrome"], >+#endif SeaMonkey's platform fallback list is just ["thunderbird"] on all platforms, we don't have any browser migrators (yet!) >+ let defaultBrowser = ""; ... >+ if (defaultBrowser) >+ migratorsOrdered.sort(function(a, b) b == defaultBrowser ? 1 : 0); So for now all this has to be wrapped in an #if 0 block. >+ for (let i = 0; i < migratorsOrdered.length; i++) { >+ let migrator = this._getMigratorIfSourceExists(migratorsOrdered[i]); >+ if (migrator) >+ return [migratorsOrdered[i], migrator]; >+ } [Isn't there a better way of doing this using for let key of?]
Attachment #775048 - Flags: review?(neil) → review-
Attached patch Convert nsProfileMigrator to JS. (obsolete) (deleted) — Splinter Review
This patch isn't compiling. Would like to have feedback as to what I'm doing wrong.
Attachment #775048 - Attachment is obsolete: true
Flags: needinfo?(neil)
Attachment #778241 - Attachment description: bug_739056.diff → Convert nsProfileMigrator to JS.
Attached patch Convert nsProfileMigrator to JS.. (v4) (obsolete) (deleted) — Splinter Review
This patch has a fix for the missing {}, but it's still not the reason why it's not building. Any idea?
Attachment #778241 - Attachment is obsolete: true
Attached patch Convert nsProfileMigrator to JS.. (v5) (obsolete) (deleted) — Splinter Review
Fixed the error. Needed to add EXTRA_COMPONENTS to moz.build.
Attachment #778313 - Attachment is obsolete: true
Attachment #778325 - Flags: review?(neil)
Flags: needinfo?(neil)
(In reply to comment #4) > >-#include "nsThunderbirdProfileMigrator.h" > You removed the Thunderbird migrator, but you didn't replace it with > anything... probably because there isn't anything for you to copy from ;-) Sorry, what I meant was that you shouldn't remove it because you didn't have a replacement. > >+component {C9DF9BD9-3050-46D4-B55B-20E8CCCAF41A} ProfileMigrator.js > I hope this is a new CID. Even better, you used the same CID in all three places! (In reply to comment #5) > >+ let defaultBrowser = ""; > ... > >+ if (defaultBrowser) > >+ migratorsOrdered.sort(function(a, b) b == defaultBrowser ? 1 : 0); > So for now all this has to be wrapped in an #if 0 block. [My idea was to wrap the quoted section, rather than changing the existing block...] > >+ for (let i = 0; i < migratorsOrdered.length; i++) { > >+ let migrator = this._getMigratorIfSourceExists(migratorsOrdered[i]); > >+ if (migrator) > >+ return [migratorsOrdered[i], migrator]; > >+ } > [Isn't there a better way of doing this using for let key of?] ... and you used let key in?
Attached patch Convert nsProfileMigrator to JS.. (v6) (obsolete) (deleted) — Splinter Review
Attachment #778325 - Attachment is obsolete: true
Attachment #778325 - Flags: review?(neil)
Attachment #779662 - Flags: review?(neil)
Comment on attachment 779662 [details] [diff] [review] Convert nsProfileMigrator to JS.. (v6) >- { NS_PROFILEMIGRATOR_CONTRACTID, &kNS_SUITEPROFILEMIGRATOR_CID }, >- { NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "thunderbird", &kNS_THUNDERBIRDPROFILEMIGRATOR_CID }, Need to restore the Thunderbird profile migrator here too. >+ for (let key in migratorsOrdered) { Still not using let key of. > CPP_SOURCES += [ >+ 'nsSuiteProfileMigratorUtils.cpp', > 'nsNetscapeProfileMigratorBase.cpp', >- 'nsProfileMigrator.cpp', >- 'nsSuiteProfileMigratorUtils.cpp', > 'nsThunderbirdProfileMigrator.cpp', Aren't these supposed to be in alphabetical order?
Attached patch Convert nsProfileMigrator to JS.. (v7) (obsolete) (deleted) — Splinter Review
Attachment #779662 - Attachment is obsolete: true
Attachment #779662 - Flags: review?(neil)
Attachment #780156 - Flags: review?(neil)
(In reply to comment #11) > (From update of attachment 779662 [details] [diff] [review]) > >- { NS_PROFILEMIGRATOR_CONTRACTID, &kNS_SUITEPROFILEMIGRATOR_CID }, > >- { NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "thunderbird", &kNS_THUNDERBIRDPROFILEMIGRATOR_CID }, > Need to restore the Thunderbird profile migrator here too. Oops. It turns out that NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX lives in nsProfileMigrator.h which is one of the files you removed...
Comment on attachment 780156 [details] [diff] [review] Convert nsProfileMigrator to JS.. (v7) >-#define NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "@mozilla.org/profile/migrator;1?app=suite&type=" Looks like the best fix is to add this line to nsSuiteModule.cpp just before the row of /s (with blank lines for clarity of course).
Comment on attachment 780156 [details] [diff] [review] Convert nsProfileMigrator to JS.. (v7) >+let NSGetFactory = XPCOMUtils.generateNSGetFactory([SuiteProfileMigrator]); The object is just called ProfileMigrator.
Comment on attachment 780156 [details] [diff] [review] Convert nsProfileMigrator to JS.. (v7) >+ for (key of migratorsOrdered) { Nit: this needs a let. >+ QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsISuiteProfileMigrator]), This needs to be nsIProfileMigrator.
Comment on attachment 780156 [details] [diff] [review] Convert nsProfileMigrator to JS.. (v7) r- as per above comments. (But once those are fixed, then it seems to work.)
Attachment #780156 - Flags: review?(neil) → review-
Attachment #780156 - Attachment is obsolete: true
Attachment #780722 - Flags: review?(neil)
Attachment #780722 - Flags: review?(neil) → review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.22
Target Milestone: seamonkey2.22 → seamonkey2.23
No longer blocks: FF2SM
Depends on: 918853
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: