Closed
Bug 1121489
Opened 10 years ago
Closed 10 years ago
Make it possible to construct a RefPtr from an already_AddRefed; r=froydnj
Categories
(Core :: MFBT, defect)
Core
MFBT
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
Attachments
(1 file, 1 obsolete file)
1.91 KB,
patch
|
froydnj
:
review+
|
Details | Diff | Splinter Review |
This will pave the way towards having a MakeAndAddRef function
that returns an already_AddRefed and can be used in graphics code.
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8548910 -
Flags: review?(nfroyd)
Comment 2•10 years ago
|
||
Comment on attachment 8548910 [details] [diff] [review]
Make it possible to construct a RefPtr from an already_AddRefed
Review of attachment 8548910 [details] [diff] [review]:
-----------------------------------------------------------------
Um, this compiles? already_AddRefed::take is non-const.
Attachment #8548910 -
Flags: review?(nfroyd)
Assignee | ||
Comment 3•10 years ago
|
||
(In reply to Nathan Froyd [:froydnj] [:nfroyd] from comment #2)
> Comment on attachment 8548910 [details] [diff] [review]
> Make it possible to construct a RefPtr from an already_AddRefed
>
> Review of attachment 8548910 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Um, this compiles? already_AddRefed::take is non-const.
Sigh, templates. Yes, you're right, but the compiler didn't know this because I had yet to instantiate the constructor!
Assignee | ||
Comment 4•10 years ago
|
||
This will pave the way towards having a MakeAndAddRef function
that returns an already_AddRefed and can be used in graphics code.
Attachment #8550791 -
Flags: review?(nfroyd)
Assignee | ||
Updated•10 years ago
|
Attachment #8548910 -
Attachment is obsolete: true
Comment 5•10 years ago
|
||
Comment on attachment 8550791 [details] [diff] [review]
Make it possible to construct a RefPtr from an already_AddRefed
Review of attachment 8550791 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with fixing the compile error.
::: mfbt/RefPtr.h
@@ +255,5 @@
> return *this;
> }
> + RefPtr& operator=(const already_AddRefed<T>& aOther)
> + {
> + assign(aOther.take());
...and I guess this doesn't compile, either, because |take()| is non-const?
Attachment #8550791 -
Flags: review?(nfroyd) → review+
Comment 6•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b9c534b922c7
https://hg.mozilla.org/mozilla-central/rev/793fb5d20398
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in
before you can comment on or make changes to this bug.
Description
•