add static asserts internal and xpcom accessible roles are the same

RESOLVED FIXED in mozilla15

Status

()

Core
Disability Access APIs
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: tbsaunde, Assigned: maxli)

Tracking

unspecified
mozilla15
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
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
(Assignee)

Comment 1

5 years ago
Created attachment 621233 [details] [diff] [review]
Patch v1
Assignee: nobody → maxli
Attachment #621233 - Flags: review?(trev.saunders)
(Reporter)

Updated

5 years ago
Attachment #621233 - Flags: review?(trev.saunders)
Attachment #621233 - Flags: review+
Attachment #621233 - Flags: feedback?(surkov.alexander)

Comment 2

5 years ago
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).
(Reporter)

Comment 3

5 years ago
(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.

Comment 4

5 years ago
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).
(Reporter)

Comment 5

5 years ago
(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 6

5 years ago
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+

Comment 7

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/ae9aef30b549
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/ae9aef30b549
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.