Closed
Bug 1329670
Opened 9 years ago
Closed 9 years ago
Change gfxFont's method CopyWithAntialiasOption to return UniquePtr
Categories
(Core :: Graphics: Text, defect)
Core
Graphics: Text
Tracking
()
RESOLVED
FIXED
mozilla53
| Tracking | Status | |
|---|---|---|
| firefox53 | --- | fixed |
People
(Reporter: dholbert, Assigned: dholbert)
Details
Attachments
(2 files)
|
2.24 KB,
patch
|
jfkthame
:
review+
|
Details | Diff | Splinter Review |
|
3.58 KB,
patch
|
jfkthame
:
review+
|
Details | Diff | Splinter Review |
The function CopyWithAntialiasOption (on the gfxFont interface) returns a raw pointer to a freshly allocated object (or nullptr). And the one caller stores this returned value in a UniquePtr, here:
https://dxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxFont.cpp#2308
We should change CopyWithAntialiasOption to simply return UniquePtr.
| Assignee | ||
Comment 1•9 years ago
|
||
I'm splitting this into two parts for easier review (though I'll land it as a single merged changeset so as not to introduce an intermediate point where we don't compile).
Here's the first part -- changing the function signature and the callsite.
| Assignee | ||
Updated•9 years ago
|
Attachment #8825061 -
Attachment description: fix (first half): change signature on interface & change callsite to use Move() → fix (first half): change signature on gfxFont & change callsite to use Move()
Attachment #8825061 -
Flags: review?(jfkthame)
| Assignee | ||
Comment 2•9 years ago
|
||
...and here's the second part, which updates the implementations.
| Assignee | ||
Comment 3•9 years ago
|
||
Comment on attachment 8825063 [details] [diff] [review]
fix (second half): update implementations in gfxFont's subclasses
(Note that I'm introducing a local 'auto' variable here, for one of the constructor-args, simply to reduce the length of the MakeUnique<...>(...) line.)
Attachment #8825063 -
Attachment description: fix (second half): update implementations → fix (second half): update implementations in gfxFont's subclasses
Attachment #8825063 -
Flags: review?(jfkthame)
| Assignee | ||
Comment 4•9 years ago
|
||
Oh -- side note, in the second half I'm also dropping 'virtual' from the function signature (since I'm touching that line anyway) -- because, per our coding style, that keyword is not supposed to accompany the 'override' keyword (which these subclass function impls have at the end).
Updated•9 years ago
|
Attachment #8825061 -
Flags: review?(jfkthame) → review+
Comment 5•9 years ago
|
||
Comment on attachment 8825063 [details] [diff] [review]
fix (second half): update implementations in gfxFont's subclasses
Review of attachment 8825063 [details] [diff] [review]:
-----------------------------------------------------------------
Looks fine to me.
Attachment #8825063 -
Flags: review?(jfkthame) → review+
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7177f9bb9d93
Change gfxFont::CopyWithAntialiasOption to return UniquePtr instead of raw pointer. r=jfkthame
Comment 7•9 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in
before you can comment on or make changes to this bug.
Description
•