Make nsDidReflowStatus into an enum

RESOLVED FIXED in mozilla19

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

Trunk
mozilla19
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Comment hidden (empty)
(Assignee)

Comment 1

6 years ago
Right now, the nsDidReflowStatus type is defined as follows:

> 508 /**
> 509  * DidReflow status values.
> 510  */
> 511 typedef bool nsDidReflowStatus;
> 512 
> 513 #define NS_FRAME_REFLOW_NOT_FINISHED false
> 514 #define NS_FRAME_REFLOW_FINISHED     true
http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsIFrame.h#508

We should convert it into an enum instead of a typedef, so compilers can enforce that we're using it correctly and not accidentally passing in a different type. (to prevent bugs like bug 806001)
Depends on: 806001
(Assignee)

Comment 2

6 years ago
Created attachment 675720 [details] [diff] [review]
fix

This patch currently breaks the build due to bug 806001 (yay, we can catch bugs!) but it builds successfully after that bug is fixed.
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #675720 - Flags: review?(dbaron)
Comment on attachment 675720 [details] [diff] [review]
fix

r=dbaron
Attachment #675720 - Flags: review?(dbaron) → review+
(Assignee)

Comment 4

6 years ago
Green try run, aside from a few known-intermittent-oranges:
  https://tbpl.mozilla.org/?tree=Try&rev=f08b1abd0d3d

Landed:
  https://hg.mozilla.org/integration/mozilla-inbound/rev/74d3d6a66e7d
Flags: in-testsuite-

Comment 5

6 years ago
Hmm, I wish you had made it an enum class.  :-)
(Assignee)

Comment 6

6 years ago
I haven't dug into C++11 stuff too much yet, so I don't exactly know the distinction -- but FWIW, just making it an enum did catch some bugs (via compile errors), as noted in comment 2!

But if you think it'd help, feel free to file followup on making it an enum class if you like!

Comment 7

6 years ago
https://hg.mozilla.org/mozilla-central/rev/74d3d6a66e7d
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19

Comment 8

6 years ago
Filed bug 810355.
(Assignee)

Updated

6 years ago
Blocks: 810355
(Assignee)

Updated

6 years ago
OS: Linux → All
Hardware: x86_64 → All
You need to log in before you can comment on or make changes to this bug.