Port Bug 1540965 Make nsIControllerContext builtinclass - remove call to nsIControllerContext.init()
Categories
(MailNews Core :: General, task)
Tracking
(Not tracked)
People
(Reporter: jorgk-bmo, Assigned: jorgk-bmo)
References
Details
Attachments
(2 files)
3.18 KB,
patch
|
frg
:
review+
masayuki
:
feedback+
|
Details | Diff | Splinter Review |
1.35 KB,
patch
|
masayuki
:
feedback+
bzbarsky
:
feedback-
|
Details | Diff | Splinter Review |
https://searchfox.org/comm-central/rev/4fd2bb880f8af2c7979b691eea616f587a9f2d4b/editor/ui/composer/content/ComposerCommands.js#126
https://searchfox.org/comm-central/rev/4fd2bb880f8af2c7979b691eea616f587a9f2d4b/editor/ui/composer/content/ComposerCommands.js#198
https://searchfox.org/comm-central/rev/4fd2bb880f8af2c7979b691eea616f587a9f2d4b/editor/ui/composer/content/editingOverlay.js#74
Assignee | ||
Comment 1•6 years ago
|
||
FRG and Ian, is this only used for SM?
(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
Thanks for looking at the callers, Masakuki-san. Is this all that is required?
Comment 4•6 years ago
|
||
![]() |
||
Updated•6 years ago
|
![]() |
||
Comment 5•6 years ago
|
||
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
Assignee | ||
Comment 7•6 years ago
|
||
Which version are you at? TB 68 is equivalent to SM 2.65, no?
Assignee | ||
Comment 8•6 years ago
|
||
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
Assignee | ||
Comment 9•6 years ago
|
||
OK, this compiles and should be right.
Comment 10•6 years ago
|
||
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
Assignee | ||
Comment 11•6 years ago
|
||
Landed without the trailing space ;-)
Comment 12•6 years ago
|
||
![]() |
||
Comment 13•6 years ago
|
||
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 14•6 years ago
|
||
Assignee | ||
Comment 15•6 years ago
|
||
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
![]() |
||
Comment 16•6 years ago
|
||
Why with no args?
That's what the code was doing before the changes in this bug.
Assignee | ||
Comment 17•6 years ago
|
||
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?
![]() |
||
Comment 18•6 years ago
|
||
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.
Assignee | ||
Comment 19•6 years ago
|
||
Let's be pragmatic and take the line out, then back out the patch here.
Assignee | ||
Comment 20•6 years ago
|
||
We can back this out when bug 1542352 lands.
Comment 21•6 years ago
|
||
Updated•6 years ago
|
Description
•