diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-07 23:06:36 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-07 23:06:36 +0000 |
commit | bd663d44f78452899733d431eef7d25acdd793f5 (patch) | |
tree | cad5b6397d4297104b1535118988682cbe6ec28f /webkit | |
parent | 84d299aee6acf1511930acfd967408ce6d64bad4 (diff) | |
download | chromium_src-bd663d44f78452899733d431eef7d25acdd793f5.zip chromium_src-bd663d44f78452899733d431eef7d25acdd793f5.tar.gz chromium_src-bd663d44f78452899733d431eef7d25acdd793f5.tar.bz2 |
Add some compile asserts for the Pepper event mask flags.
TEST=compiles
BUG=none
Review URL: https://chromiumcodereview.appspot.com/10539052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141108 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/plugins/ppapi/event_conversion.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/webkit/plugins/ppapi/event_conversion.cc b/webkit/plugins/ppapi/event_conversion.cc index 0a19415..68a9f6e 100644 --- a/webkit/plugins/ppapi/event_conversion.cc +++ b/webkit/plugins/ppapi/event_conversion.cc @@ -36,6 +36,43 @@ namespace ppapi { namespace { +// Verify the modifier flags WebKit uses match the Pepper ones. If these start +// not matching, we'll need to write conversion code to preserve the Pepper +// values (since plugins will be depending on them). +COMPILE_ASSERT(static_cast<int>(PP_INPUTEVENT_MODIFIER_SHIFTKEY) == + static_cast<int>(WebInputEvent::ShiftKey), + ShiftKeyMatches); +COMPILE_ASSERT(static_cast<int>(PP_INPUTEVENT_MODIFIER_CONTROLKEY) == + static_cast<int>(WebInputEvent::ControlKey), + ControlKeyMatches); +COMPILE_ASSERT(static_cast<int>(PP_INPUTEVENT_MODIFIER_ALTKEY) == + static_cast<int>(WebInputEvent::AltKey), + AltKeyMatches); +COMPILE_ASSERT(static_cast<int>(PP_INPUTEVENT_MODIFIER_METAKEY) == + static_cast<int>(WebInputEvent::MetaKey), + MetaKeyMatches); +COMPILE_ASSERT(static_cast<int>(PP_INPUTEVENT_MODIFIER_ISKEYPAD) == + static_cast<int>(WebInputEvent::IsKeyPad), + KeyPadMatches); +COMPILE_ASSERT(static_cast<int>(PP_INPUTEVENT_MODIFIER_ISAUTOREPEAT) == + static_cast<int>(WebInputEvent::IsAutoRepeat), + AutoRepeatMatches); +COMPILE_ASSERT(static_cast<int>(PP_INPUTEVENT_MODIFIER_LEFTBUTTONDOWN) == + static_cast<int>(WebInputEvent::LeftButtonDown), + LeftButtonMatches); +COMPILE_ASSERT(static_cast<int>(PP_INPUTEVENT_MODIFIER_MIDDLEBUTTONDOWN) == + static_cast<int>(WebInputEvent::MiddleButtonDown), + MiddleButtonMatches); +COMPILE_ASSERT(static_cast<int>(PP_INPUTEVENT_MODIFIER_RIGHTBUTTONDOWN) == + static_cast<int>(WebInputEvent::RightButtonDown), + RightButtonMatches); +COMPILE_ASSERT(static_cast<int>(PP_INPUTEVENT_MODIFIER_CAPSLOCKKEY) == + static_cast<int>(WebInputEvent::CapsLockOn), + CapsLockMatches); +COMPILE_ASSERT(static_cast<int>(PP_INPUTEVENT_MODIFIER_NUMLOCKKEY) == + static_cast<int>(WebInputEvent::NumLockOn), + NumLockMatches); + PP_InputEvent_Type ConvertEventTypes(WebInputEvent::Type wetype) { switch (wetype) { case WebInputEvent::MouseDown: |