dom/plugins/ipc/NPEventAndroid.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
michael@0 2 /* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 // This is a NPEventX11.h derived stub for Android
michael@0 8 // Plugins aren't actually supported yet
michael@0 9
michael@0 10 #ifndef mozilla_dom_plugins_NPEventAndroid_h
michael@0 11 #define mozilla_dom_plugins_NPEventAndroid_h
michael@0 12
michael@0 13 #include "npapi.h"
michael@0 14
michael@0 15 namespace mozilla {
michael@0 16
michael@0 17 namespace plugins {
michael@0 18
michael@0 19 struct NPRemoteEvent {
michael@0 20 NPEvent event;
michael@0 21 };
michael@0 22
michael@0 23 }
michael@0 24
michael@0 25 }
michael@0 26
michael@0 27
michael@0 28 namespace IPC {
michael@0 29
michael@0 30 template <>
michael@0 31 struct ParamTraits<mozilla::plugins::NPRemoteEvent>
michael@0 32 {
michael@0 33 typedef mozilla::plugins::NPRemoteEvent paramType;
michael@0 34
michael@0 35 static void Write(Message* aMsg, const paramType& aParam)
michael@0 36 {
michael@0 37 aMsg->WriteBytes(&aParam, sizeof(paramType));
michael@0 38 }
michael@0 39
michael@0 40 static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
michael@0 41 {
michael@0 42 const char* bytes = 0;
michael@0 43
michael@0 44 if (!aMsg->ReadBytes(aIter, &bytes, sizeof(paramType))) {
michael@0 45 return false;
michael@0 46 }
michael@0 47
michael@0 48 memcpy(aResult, bytes, sizeof(paramType));
michael@0 49 return true;
michael@0 50 }
michael@0 51
michael@0 52 static void Log(const paramType& aParam, std::wstring* aLog)
michael@0 53 {
michael@0 54 // TODO
michael@0 55 aLog->append(L"(AndroidEvent)");
michael@0 56 }
michael@0 57 };
michael@0 58
michael@0 59 } // namespace IPC
michael@0 60
michael@0 61
michael@0 62 #endif // mozilla_dom_plugins_NPEventAndroid_h

mercurial