Port Bug 1501404 - Part 7: Remove the XPCOM registration for nsSyncStreamListener (4 Xpcshell test failures, 11 MozMill failures)

RESOLVED FIXED in Thunderbird 65.0

Status

enhancement
RESOLVED FIXED
10 months ago
10 months ago

People

(Reporter: jorgk, Assigned: jorgk)

Tracking

Trunk
Thunderbird 65.0

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 4 obsolete attachments)

Causes test failures:
TEST-UNEXPECTED-FAIL | comm/mailnews/base/test/unit/test_detachToFile.js | xpcshell return code: 0
TEST-UNEXPECTED-FAIL | comm/mailnews/base/test/unit/test_mimemaltdetach.js | xpcshell return code: 0
TEST-UNEXPECTED-FAIL | comm/mailnews/base/test/unit/test_quarantineFilterMove.js | xpcshell return code: 0
TEST-UNEXPECTED-FAIL | comm/mailnews/imap/test/unit/test_imapAttachmentSaves.js | xpcshell return code: 0

Running the first test locally I see:
[JavaScript Error: "Cc['@mozilla.org/network/sync-stream-listener;1'] is undefined; can't access its "createInstance" property" {file: "c:/mozilla-source/comm-central/obj-x86_64-pc-mingw32/_tests/xpcshell/comm/mailnews/base/test/unit/test_detachToFile.js" line: 112}]

https://hg.mozilla.org/mozilla-central/rev/89474459aeb8

We use it in JS:
https://searchfox.org/comm-central/search?q=sync-stream-listener&case=false&regexp=false&path=

Geoff, could you restore this for us. I've see too much bustage in a single day already and there is more to file :-(
Flags: needinfo?(geoff)
Actually, it causes 11 MozMill failures as well:
TEST-UNEXPECTED-FAIL | /builds/worker/workspace/build/tests/mozmill/composition/test-reply-format-flowed.js | test-reply-format-flowed.js::test_reply_format_flowed
TEST-UNEXPECTED-FAIL | /builds/worker/workspace/build/tests/mozmill/composition/test-charset-upgrade.js | test-charset-upgrade.js::test_encoding_upgrade_html_compose
TEST-UNEXPECTED-FAIL | /builds/worker/workspace/build/tests/mozmill/composition/test-charset-upgrade.js | test-charset-upgrade.js::test_encoding_upgrade_plaintext_compose
TEST-UNEXPECTED-FAIL | /builds/worker/workspace/build/tests/mozmill/composition/test-drafts.js | test-drafts.js::test_content_language_header
TEST-UNEXPECTED-FAIL | /builds/worker/workspace/build/tests/mozmill/composition/test-drafts.js | test-drafts.js::test_remove_space_stuffing_format_flowed
TEST-UNEXPECTED-FAIL | /builds/worker/workspace/build/tests/mozmill/composition/test-image-display.js | test-image-display.js::test_cid_image_compose
TEST-UNEXPECTED-FAIL | /builds/worker/workspace/build/tests/mozmill/composition/test-forward-rfc822-attach.js | test-forward-rfc822-attach.js::test_forwarding_long_html_line_as_attachment
TEST-UNEXPECTED-FAIL | /builds/worker/workspace/build/tests/mozmill/composition/test-forward-rfc822-attach.js | test-forward-rfc822-attach.js::test_forwarding_feed_message_as_attachment
TEST-UNEXPECTED-FAIL | /builds/worker/workspace/build/tests/mozmill/composition/test-send-format.js | test-send-format.js::test_msg_convertibility
TEST-UNEXPECTED-FAIL | /builds/worker/workspace/build/tests/mozmill/composition/test-multipart-related.js | test-multipart-related.js::test_basic_multipart_related
TEST-UNEXPECTED-FAIL | /builds/worker/workspace/build/tests/mozmill/composition/test-blocked-content.js | test-blocked-content.js::test_paste_file_urls

  EXCEPTION: Cc['@mozilla.org/network/sync-stream-listener;1'] is undefined; can't access its "createInstance" property
    at: test-compose-helpers.js line 522
Summary: Port Bug 1501404 - Part 7: Remove the XPCOM registration for nsSyncStreamListener → Port Bug 1501404 - Part 7: Remove the XPCOM registration for nsSyncStreamListener (4 Xpcshell test failures, 11 MozMill failures)
Flags: needinfo?(geoff)
Attachment #9019781 - Flags: review?(geoff)
Posted patch 1501718-M-C-part.patch (obsolete) — Splinter Review
Hi Valentin,
M-C is busily removing XPCOM registration of things we use in JS. Mostly we can just restore the registration, but in this case, some functions need to be public.
Assignee: nobody → jorgk
Attachment #9019783 - Flags: review?(valentin.gosu)
Attachment #9019755 - Attachment is obsolete: true
Posted patch 1501718-M-C-part.patch (obsolete) — Splinter Review
Sorry about the noise, one word ("Make") missing from the commit message.
Attachment #9019783 - Attachment is obsolete: true
Attachment #9019783 - Flags: review?(valentin.gosu)
Attachment #9019784 - Flags: review?(valentin.gosu)
Comment on attachment 9019784 [details] [diff] [review]
1501718-M-C-part.patch

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

You can use ::Create() instead. I'll comment in the other patch.
Attachment #9019784 - Flags: review?(valentin.gosu) → review-
Comment on attachment 9019781 [details] [diff] [review]
C-C part - 1501718-nsSyncStreamListener.patch (v2)

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

::: common/src/nsCommonModule.cpp
@@ +19,5 @@
>  
>  NS_GENERIC_FACTORY_CONSTRUCTOR(TransactionManager)
>  NS_DEFINE_NAMED_CID(NS_TRANSACTIONMANAGER_CID);
>  
> +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSyncStreamListener, Init)

Instead of this, you can define a factory method similar to [1] that calls nsSyncStreamListener::Create()

[1] https://searchfox.org/mozilla-central/rev/72b1e834f384a2ffec6eb4ce405fbd4b5e881109/netwerk/build/nsNetModule.cpp#536
Attachment #9019781 - Flags: feedback+
Thanks Valentin, interesting variation. I learn something new every day :-)

I modernised CreateNewUnknownDecoderFactory() a by using NS_ENSURE_ARG_POINTER(). Apparently 'new' is infallible (well, control doesn't return if it fails internally), so no need to check for a non-null result either.
Attachment #9019781 - Attachment is obsolete: true
Attachment #9019784 - Attachment is obsolete: true
Attachment #9019781 - Flags: review?(geoff)
Attachment #9019806 - Flags: review?(geoff)
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/97c5ad955dd4
Port bug 1501404, part 7: Move XPCOM registration of nsSyncStreamListener to C-C common/. rs=bustage-fix
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 65.0
Attachment #9019806 - Flags: review?(geoff) → review+
You need to log in before you can comment on or make changes to this bug.