Closed Bug 1541144 Opened 6 years ago Closed 6 years ago

Port Bug 1540965 Make nsIControllerContext builtinclass - remove call to nsIControllerContext.init()

Categories

(MailNews Core :: General, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 68.0

People

(Reporter: jorgk-bmo, Assigned: jorgk-bmo)

References

Details

Attachments

(2 files)

FRG and Ian, is this only used for SM?

Flags: needinfo?(iann_bugzilla)
Flags: needinfo?(frgrahl)

(In reply to Jorg K (GMT+2) from comment #1)

FRG and Ian, is this only used for SM?
Yes, looks like it is used by Composer / DebugQA

Component: General → Composer
Flags: needinfo?(iann_bugzilla)
Flags: needinfo?(frgrahl)
Product: Thunderbird → SeaMonkey

Thanks for looking at the callers, Masakuki-san. Is this all that is required?

Assignee: nobody → iann_bugzilla
Status: NEW → ASSIGNED
Attachment #9055252 - Flags: feedback?(masayuki)
Comment on attachment 9055252 [details] [diff] [review] Remove init() lines Thanks! And sorry for doing such change.
Attachment #9055252 - Flags: feedback?(masayuki) → feedback+
Attachment #9055252 - Flags: review?(frgrahl)
Comment on attachment 9055252 [details] [diff] [review] Remove init() lines Looks good. Thanks.
Attachment #9055252 - Flags: review?(frgrahl) → review+

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/d5c0b943ee9b
Port bug 1540965: Make nsIControllerContext builtinclass - remove calls to nsIControllerContext.init(). r=frg

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

Which version are you at? TB 68 is equivalent to SM 2.65, no?

Target Milestone: --- → seamonkey2.65

There's more to do here:

C++ bustage here:
https://searchfox.org/comm-central/rev/10bc0c1569fab6ccdce1c31413067d1ec0de8c61/common/src/nsCommonModule.cpp#18

nsCommonModule.cpp(18,32): error: call to constructor of 'nsBaseCommandController' is ambiguous
0:18.05 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBaseCommandController)

I'll have to see how to fix that. The constructor now takes a command table:
https://hg.mozilla.org/mozilla-central/rev/42b4d2faa543#l2.14

Status: RESOLVED → REOPENED
Component: Composer → General
Product: SeaMonkey → MailNews Core
Resolution: FIXED → ---
Target Milestone: seamonkey2.65 → Thunderbird 68.0

OK, this compiles and should be right.

Assignee: iann_bugzilla → jorgk
Status: REOPENED → ASSIGNED
Attachment #9055732 - Flags: feedback?(masayuki)
Attachment #9055732 - Flags: feedback?(bzbarsky)

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/270dd6e22821
Port bug 1540965: Hand-roll NS_GENERIC_FACTORY_CONSTRUCTOR(nsBaseCommandController). rs=bustage-fix

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

Landed without the trailing space ;-)

Comment on attachment 9055732 [details] [diff] [review] 1541144-nsBaseCommandController.patch That's really odd to me because [the default constructor is removed by `= delete`](https://searchfox.org/mozilla-central/rev/9ee63566281365f26e7a4b06c9d4e2219e64c3e8/dom/commandhandler/nsBaseCommandController.h#28). But fine to me for now.
Attachment #9055732 - Flags: feedback?(masayuki) → feedback+

That's really odd to me because [the default constructor is removed by = delete]

It looks like C++ considers that to be a constructor declaration (albeit a deleted one) and then is not sure whether you're calling the deleted constructor (an error) or the one-arg one with no args.

We should just remove that "nsBaseCommandController() = delete;" line.

Comment on attachment 9055732 [details] [diff] [review] 1541144-nsBaseCommandController.patch See comment 13 for what is probably the right fix.
Attachment #9055732 - Flags: feedback?(bzbarsky) → feedback-

Thanks, Boris.

(In reply to Boris Zbarsky [:bzbarsky, bz on IRC] from comment #13)

It looks like C++ considers that to be a constructor declaration (albeit a deleted one)
and then is not sure whether you're calling the deleted constructor (an error) or the
one-arg one with no args.

Why with no args?
https://hg.mozilla.org/comm-central/rev/270dd6e22821#l1.20
inst = new nsBaseCommandController(new nsControllerCommandTable());

We should just remove that "nsBaseCommandController() = delete;" line.
OK, who can take this on? As far as I can see, I'm calling this one:
https://searchfox.org/mozilla-central/rev/9ee63566281365f26e7a4b06c9d4e2219e64c3e8/dom/commandhandler/nsBaseCommandController.h#29

Why with no args?

That's what the code was doing before the changes in this bug.

Sure, but now it calls the one-arg version with one argument, no? Am I missing something? It's ugly that the macro was hand-rolled, not not a drama. If you prefer, I can open a bug to remove the one line nsBaseCommandController() = delete;. But you (author and reviewer) put it there for a reason, right?

The patch I reviewed did not have that line. It had:

  nsBaseCommandController();
  explicit nsBaseCommandController(nsControllerCommandTable* aControllerCommandTable);

and my review comments said to just have the second one with a default value for the arg. The fact that the = delete; line is still there is a mistake.

I mean, you can have the unrolled macro in comm-central if you want, it's your code. But the m-c code is wrong anyway: it was intended to allow calling the constructor with no args and it's not doing that.

Let's be pragmatic and take the line out, then back out the patch here.

We can back this out when bug 1542352 lands.

Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/ae01508231f6 Backed out changeset 270dd6e22821. Not necessary any more since bug 1542352 restored 0-arg CTOR of nsBaseCommandController. a=backout
Type: defect → task
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: