Add FunctionRef - a non-owning reference to a Callable
Categories
(Core :: MFBT, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox76 | --- | fixed |
People
(Reporter: jrmuizel, Assigned: fronkc1, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [gfx-noted] [lang=c++])
Attachments
(2 files, 7 obsolete files)
5.10 KB,
patch
|
Details | Diff | Splinter Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Reporter | ||
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
Comment 5•6 years ago
|
||
Comment 6•6 years ago
|
||
Comment 8•6 years ago
|
||
Reporter | ||
Comment 9•6 years ago
|
||
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
Updated•6 years ago
|
Comment 15•6 years ago
|
||
Comment 16•6 years ago
|
||
Comment 17•6 years ago
|
||
Comment 18•6 years ago
|
||
Updated•6 years ago
|
Comment 19•6 years ago
|
||
Comment 20•6 years ago
|
||
Comment 21•6 years ago
|
||
Comment 22•6 years ago
|
||
Comment 23•6 years ago
|
||
Comment 24•6 years ago
|
||
Comment 25•6 years ago
|
||
Comment 26•6 years ago
|
||
Comment 27•6 years ago
|
||
Comment 28•6 years ago
|
||
Comment 29•6 years ago
|
||
Comment 30•6 years ago
|
||
Comment 31•6 years ago
|
||
Comment 32•6 years ago
|
||
Comment 33•6 years ago
|
||
Comment 34•6 years ago
|
||
Comment 35•6 years ago
|
||
Comment 36•6 years ago
|
||
Updated•6 years ago
|
Comment 37•6 years ago
|
||
Comment 38•6 years ago
|
||
Hi Shivam, are you still working on this?
Comment 39•6 years ago
•
|
||
(In reply to Shubham Rawat from comment #38)
Hi Shivam, are you still working on this?
As we haven't heard from Shivam for a while, you're welcome to take over this bug if you're interested.
Before taking on this bug, please note what I've said in comment 2:
Should make a good mentored bug, maybe even a good first bug for someone who
has experience with C++ (i.e. if the code in comment 1 doesn't scare you,
this should be totally doable even if this is your first Mozilla bug).
That is, this is a "good first bug" for someone new to the Mozilla project, but not for someone new to C++ (it's fairly C++-intensive; understanding the code in comment 1 is a good litmus test).
Comment 40•6 years ago
|
||
(Shivam confirmed to me on IRC that he does not intend to continue working on this bug.)
Comment 41•6 years ago
|
||
(In reply to Botond Ballo [:botond] from comment #39)
I think this works well as my first bug in the Mozilla project. The LLVM implementation looks straight forward, and from a brief look I guess most of the work has been completed by previous assignee(s).
I think the latest patch was stuck on a test failure, I'll investigate it once I have the basic setup working. Does that sound good?
Comment 42•6 years ago
|
||
Ok, sounds good! Thanks Shubham.
Here are some instructions for checking out and building the Firefox source code: https://developer.mozilla.org/en-US/Simple_Firefox_build
Let me know once you've done that and we can discuss further steps.
Comment 43•6 years ago
|
||
Hey, is this up for grabs?
Comment 44•6 years ago
|
||
We haven't heard from Shubham in two weeks, so yes, I'd say it's up for grabs.
If you're interested in taking it on, please start by taking a look at comment 1. If you're comfortable with the sort of C++ code in comment 1, this could be a good bug for you; in that case, please see comment 42 for how to get started. (If you're not comfortable with the code in comment 1, please choose a different mentored bug.)
Comment 45•6 years ago
|
||
Actually I was planning to work on it, couldn't get the time these past couple of weeks. However if this is urgent, I think vskaulagi can take this up.
@vskaulagi Could you please let me know if you're working on this (in a week or so)? That's around when I was going to work on this bug.
Comment 46•6 years ago
|
||
Shubham I'll try to complete this one by the end of this week. If it's not done by then you can take it up, since you're anyway planning to work on it next week only.
Thanks.
Comment 47•6 years ago
|
||
Hi Vaishnavi, wanted to confirm if you're taking this up?
Comment 48•6 years ago
|
||
Hi Shubham, sure you can go ahead with it, I'm working on another bug.
Comment 49•5 years ago
|
||
Hey @botond, I've finally gotten around to getting everything setup. Need to get familiar with the phabricator/mercurial workflow before I can get started on this, taking a look at https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html. Does that sound fine?
Comment 50•5 years ago
|
||
Yup, sounds good!
Comment 52•5 years ago
|
||
Hi, thanks for your interest!
Please see what I wrote previously for how to get started:
(In reply to Botond Ballo [:botond] from comment #44)
If you're interested in taking it on, please start by taking a look at comment 1. If you're comfortable with the sort of C++ code in comment 1, this could be a good bug for you; in that case, please see comment 42 for how to get started. (If you're not comfortable with the code in comment 1, please choose a different mentored bug.)
Comment 54•5 years ago
|
||
Hi Sanchit -- yes, this is still something we'd like to have, and the bug is available to be worked on if you're interested!
Please see comment 44 for how to get started.
Assignee | ||
Comment 55•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 56•5 years ago
|
||
This had been quiet for a month, so I took a stab at it based on latest patch. The tests are passing for me and I believe I addressed all of the review comments from the original patch but please let me know if I missed anything.
Comment 57•5 years ago
|
||
My review comments started sprawling a little, so I've imported the patch here locally and just directly made the changes. I'm done making those changes and am currently reviewing the diff to ensure I understand all the changes and that they make sense.
The possible last holdup is that the using Type = decltype(test(0, mozilla::DeclVal<Func&>()));
in the current patch somehow in my iteration of the patch is causing compile errors for FunctionRef(nullptr)
, such that instead of specializing EnableMatchingFunction
for std::nullptr_t
I need to specialize GetCallableTag
instead. I'm not sure just what's up with that yet. Should be something I can figure out today (Wednesday), tho, I hope, then I can (I guess) commandeer the original rev and have everyone previously involved review it themselves.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 58•5 years ago
•
|
||
(In reply to Jeff Walden [:Waldo] from comment #57)
The possible last holdup is that the
using Type = decltype(test(0, mozilla::DeclVal<Func&>()));
in the current patch somehow in my iteration of the patch is causing compile errors forFunctionRef(nullptr)
, such that instead of specializingEnableMatchingFunction
forstd::nullptr_t
I need to specializeGetCallableTag
instead. I'm not sure just what's up with that yet.
The reason for this was that in the previous patch we had
FunctionRef() = default;
MOZ_IMPLICIT FunctionRef(std::nullptr_t) ... { ... }
but my changes had instead made it
MOZ_IMPLICIT FunctionRef(std::nullptr_t) ... { ... }
FunctionRef() : FunctionRef(nullptr) {}
and apparently, our tests in the latter case will try to do overload matching against nullptr
, but in the former case -- I'm not sure why -- they do not. So I think it's relatively likely the prior patch, had you ever actually passed nullptr
to the constructor, would have failed to compile. (Don't ask me why mozilla::FunctionRef<int(int)> f2 = nullptr;
doesn't trigger the same overload matching in both cases. Maybe implicit conversions have different overload behavior? Too lazy to check.)
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 59•5 years ago
|
||
It looks like I was added as reviewer on latest patch but I don't have permissions to accept the revision I'm getting access denied.
Comment 60•5 years ago
|
||
(In reply to Chris Fronk from comment #59)
It looks like I was added as reviewer on latest patch but I don't have permissions to accept the revision I'm getting access denied.
I do not understand the inner workings of phab, but as far as I do understand them (and accept what other people tell me), you should be able to review this. Just to make sure...are you logged in, etc.? If the basics are in place, we should file a bug about this.
Updated•5 years ago
|
Assignee | ||
Comment 61•5 years ago
|
||
A double checked I was logged in and logged in account matched with where I was listed under reviewer. A lot of google searching and I believe issue is that because I created the revision is why phabricator won't allow me to approve it, but the info I could find is sparse. Searching in bugzilla for similar bugs I couldn't find anything similar. If you think I should file a bug should it be under infrastructure & operations?
This is what I get
You do not have permission to edit this object.
Users with the "Can Edit" capability:
Members of the project "Restricted Project" can take this action.
The owner of a revision can always view and edit it
Comment 62•5 years ago
|
||
Weird. I've asked about this in #conduit, we'll see what they say.
Comment 63•5 years ago
|
||
(In reply to Chris Fronk from comment #61)
If you think I should file a bug should it be under infrastructure & operations?
Here is the component for filing a bug related to Phabricator.
In the meantime, if you think the patch is in a good shape to land, you can indicate that in a comment in lieu of officially accepting it.
Assignee | ||
Comment 64•5 years ago
|
||
Thanks for link searching there I was able to find a similar issue and looks like I just need to be added to the editbugs group. I filed a bug to request that https://bugzilla.mozilla.org/show_bug.cgi?id=1624499.
I'm good with the patch Jeff added, and appreciate the updates/feedback he gave.
I've filed https://bugzilla.mozilla.org/show_bug.cgi?id=1624495 for the move-only arguments enhancement.
Comment 65•5 years ago
|
||
Thanks for taking a look! LEEROY JEEENNNKIIIINNNSSSS!
Comment 66•5 years ago
|
||
Comment 67•5 years ago
|
||
bugherder |
Description
•