Closed Bug 1531608 Opened 6 years ago Closed 6 years ago

Remove leftover channel context parameter uses

Categories

(Thunderbird :: General, task)

task
Not set
normal

Tracking

(thunderbird_esr6868+ fixed, thunderbird69 fixed, thunderbird70 fixed)

RESOLVED FIXED
Thunderbird 68.0
Tracking Status
thunderbird_esr68 68+ fixed
thunderbird69 --- fixed
thunderbird70 --- fixed

People

(Reporter: benc, Assigned: jorgk-bmo)

Details

Attachments

(2 files, 3 obsolete files)

Following on from Bug 1531307, there are still a few lingering uses of a context param on nsIChannel-related code.

Ones I've seen so far:

  • nsMsgProtcol::m_channelContext
    Used in nsMsgProtocol::OnStopRequest() one place to suppress multiple warnings, and in various derived protocols as a parameter to progress updates.
  • nsImapMockChannel::m_channelContext
    Used to pass on to nsIInputStreamPump::AsyncRead() - I think it's never used, so it should be safe to replace with nullptr...
  • parameters to OnStatus() and OnProgress in nsIProgressEventSink

In M-C, nsIInputStreamPump::AsyncRead() currently accepts a context param. Probably safe to assume that'll get removed sometime soon too.

Attached patch 1531608-AsyncRead.patch (obsolete) — Splinter Review
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Attachment #9064348 - Flags: review?(benc)
Attached patch 1531608-AsyncRead.patch (v2) (obsolete) — Splinter Review

Removed a few more NNTP bits. Also removed the member variable from IMAP. NNTP seems to use the one from nsMsgProtocol.h.

I'm not sure whether that stuff can go from nsMsgProtocol.cpp completely. I'd say yes, if it weren't for:
https://searchfox.org/comm-central/rev/6674517c6b2de7ad88628b568b0e8e8e46b65019/mailnews/base/util/nsMsgProtocol.cpp#408

Since IMAP has it's own variable, it's safe to remove.

EDIT: Interdiff to previous patch:
https://bugzilla.mozilla.org/attachment.cgi?oldid=9064348&action=interdiff&newid=9064349&headers=1
Those changes should affect the try run.

Attachment #9064348 - Attachment is obsolete: true
Attachment #9064348 - Flags: review?(benc)
Attachment #9064349 - Flags: review?(benc)
Attached patch 1531608-AsyncRead.patch (v3) (obsolete) — Splinter Review

This is more drastic. I still left the trickery re. the the alert, but replaced it with a bool. There were also more calls in POP3 that needed m_channelContext removed. Let's see:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=44a039417a1cd5ae9f8803be168c133aeef9fae1

Attachment #9064445 - Flags: review?(benc)

This is part 1. Just passing nullptr where the context parameter is ignored anyway. A bit of IDL infrastructure can go as well.

Attachment #9064349 - Attachment is obsolete: true
Attachment #9064445 - Attachment is obsolete: true
Attachment #9064349 - Flags: review?(benc)
Attachment #9064445 - Flags: review?(benc)
Attachment #9064508 - Flags: review?(benc)
Attachment #9064508 - Flags: review?(acelists)

OK, this is part 2. I'm not sure whether the whole thing couldn't be removed altogether, but let's at least lose the notion of the context and make it a bool flag.

The green try originated from the merged patch before I decided to pull it apart for clarity reasons.

Attachment #9064510 - Flags: review?(benc)

Filed bug 1551306 to see whether M-C want to remove the unneeded context parameters. That shouldn't stop us passing null for the context since all relevant code ignores the context now.

Comment on attachment 9064508 [details] [diff] [review] 1531608-AsyncRead.patch (v4) Review of attachment 9064508 [details] [diff] [review]: ----------------------------------------------------------------- Thanks.
Attachment #9064508 - Flags: review?(acelists) → review+

I'm going to land the first part now since I'm in clean-up mode. The second can wait for Ben's review.

Keywords: leave-open
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/dcd63367f2e4 Pass null as second parameter to AsyncRead(), OnStatus() and OnProgress(). r=aceman
Target Milestone: --- → Thunderbird 68.0
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/73ea6eacc7f9 Follow-up: reformat. rs=reformat DONTBUILD
Comment on attachment 9064508 [details] [diff] [review] 1531608-AsyncRead.patch (v4) Not that the extra review is needed, but I have had a look and it all seems good to me.
Attachment #9064508 - Flags: review?(benc) → review+
Comment on attachment 9064510 [details] [diff] [review] 1531608-boolflag.patch Review of attachment 9064510 [details] [diff] [review]: ----------------------------------------------------------------- It does feel like `nsMsgProtocol` shouldn't be calling `mailSession->AlertUser()` (the only reason the `m_hasChannel` flag is needed), but I don't understand the bigger picture well enough to really know for sure. Either way, it's always so nice seeing a patch remove more than it adds, so r+ from me! ::: mailnews/base/util/nsMsgProtocol.h @@ +159,5 @@ > nsCOMPtr<nsIURI> m_originalUrl; // the original url > nsCOMPtr<nsIURI> m_url; // the running url > nsCOMPtr<nsISupports> m_consumer; > nsCOMPtr<nsIStreamListener> m_channelListener; > + bool m_hasChannel; Would `m_isChannel` be a more accurate name?
Attachment #9064510 - Flags: review?(benc) → review+
Keywords: leave-open

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/57d0ff007e02
Replace m_channelContext with m_isChannel bool flag in nsMsgProtocol.cpp. r=BenC DONTBUILD

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED

Thanks, Ben. Landed with m_isChannel as suggested. For the record, second part landed at TB 70. Maybe we should backport this for consistency.

Attachment #9064510 - Flags: approval-comm-esr68?
Attachment #9064510 - Flags: approval-comm-beta?
Attachment #9064510 - Flags: approval-comm-esr68?
Attachment #9064510 - Flags: approval-comm-esr68+
Attachment #9064510 - Flags: approval-comm-beta?
Attachment #9064510 - Flags: approval-comm-beta+
Type: enhancement → task
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: