Closed Bug 750301 Opened 8 years ago Closed 8 years ago

add static asserts internal and xpcom accessible roles are the same

Categories

(Core :: Disability Access APIs, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: tbsaunde, Assigned: maxli)

Details

(Whiteboard: [good first bug][mentor=trev.saunders@gmail.com][lang=c++])

Attachments

(1 file)

add new file accessible/src/base/RoleAsserts.cpp in it define ROLE() macro as MOZ_STATIC_ASSERT(roles::geckoRole == nsIAccessibleRole::ROLE_ ## geckRole, "internal and xpcom roles differ!");
then include RoleMap.h
Attached patch Patch v1Splinter Review
Assignee: nobody → maxli
Attachment #621233 - Flags: review?(trev.saunders)
Attachment #621233 - Flags: review?(trev.saunders)
Attachment #621233 - Flags: review+
Attachment #621233 - Flags: feedback?(surkov.alexander)
maybe we could introduce general propose Debug.cpp instead? (in case if you don't want to use any existing file). You might want add other assertions there (in case if we do similar things for states for example).
(In reply to alexander :surkov from comment #2)
> maybe we could introduce general propose Debug.cpp instead? (in case if you
> don't want to use any existing file). You might want add other assertions
> there (in case if we do similar things for states for example).

I don't feel very strongly either way, on one hand this way we may end up with lots of files, on the other if this file stops compiling you might have a more imediate idea what's wrong.
I'm just a little bit septic to have couple lines long files. But I'm not sure I like to keep this code under nsAccessibilityService.cpp for example (but why not after all?) so we could introduce generic propose file for stuffs like this. In either case I think I would want to end up with bunch of short files like RoleAssertion.cpp StateAssertion.cpp, RelationAssertion.cpp (etc).
(In reply to alexander :surkov from comment #4)
> I'm just a little bit septic to have couple lines long files. But I'm not
> sure I like to keep this code under nsAccessibilityService.cpp for example
> (but why not after all?) so we could introduce generic propose file for
> stuffs like this. In either case I think I would want to end up with bunch
> of short files like RoleAssertion.cpp StateAssertion.cpp,
> RelationAssertion.cpp (etc).

ok, I'm sort of tempted to see what the next use will be so we can understand what grouping actually makes sense instead of what we think will make sense in the future, but sure I'd probably add file Asserts.cpp or BuildAsserts.cpp but it doesn't matter much to me.
Comment on attachment 621233 [details] [diff] [review]
Patch v1

Review of attachment 621233 [details] [diff] [review]:
-----------------------------------------------------------------

f=me per comment #5
Attachment #621233 - Flags: feedback?(surkov.alexander) → feedback+
https://hg.mozilla.org/mozilla-central/rev/ae9aef30b549
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.