Bug 823201 - Keyboard doesn't work in OOP apps. r=cjones
authorGregor Wagner <anygregor@gmail.com>
Wed, 19 Dec 2012 19:42:29 -0800
changeset 125694 cd7f3548011c7a66a958ee7e3f174532dd33ee11
parent 125693 9b58f6e07b21822830b68c993510761322813e97
child 125695 68e0f5e187e17f6da5fb3b077308e8b8a726dc17
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs823201
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 823201 - Keyboard doesn't work in OOP apps. r=cjones
widget/nsGUIEventIPC.h
--- a/widget/nsGUIEventIPC.h
+++ b/widget/nsGUIEventIPC.h
@@ -15,23 +15,27 @@ namespace IPC
 
 template<>
 struct ParamTraits<mozilla::widget::EventFlags>
 {
   typedef mozilla::widget::EventFlags paramType;
 
   static void Write(Message* aMsg, const paramType& aParam)
   {
-    aMsg->WriteBytes(&aParam, sizeof(paramType));
+    aMsg->WriteBytes(&aParam, sizeof(aParam));
   }
 
   static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
   {
-    return aMsg->ReadBytes(aIter, reinterpret_cast<const char**>(aResult),
-                           sizeof(paramType));
+    const char* outp;
+    if (!aMsg->ReadBytes(aIter, &outp, sizeof(*aResult))) {
+      return false;
+    }
+    *aResult = *reinterpret_cast<const paramType*>(outp);
+    return true;
   }
 };
 
 template<>
 struct ParamTraits<nsEvent>
 {
   typedef nsEvent paramType;