2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-11-17 17:22:23 +03:00
|
|
|
|
|
|
|
#ifndef TABMESSAGE_UTILS_H
|
|
|
|
#define TABMESSAGE_UTILS_H
|
|
|
|
|
2012-08-28 16:41:04 +04:00
|
|
|
#include "ipc/IPCMessageUtils.h"
|
2017-10-10 13:43:09 +03:00
|
|
|
#include "nsExceptionHandler.h"
|
2012-06-11 03:44:50 +04:00
|
|
|
#include "nsIDOMEvent.h"
|
2016-06-09 14:59:31 +03:00
|
|
|
#include "nsPIDOMWindow.h"
|
2009-11-17 17:22:23 +03:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
struct RemoteDOMEvent
|
|
|
|
{
|
2013-03-09 15:34:29 +04:00
|
|
|
// Make sure to set the owner after deserializing.
|
2012-06-11 03:44:50 +04:00
|
|
|
nsCOMPtr<nsIDOMEvent> mEvent;
|
2009-11-17 17:22:23 +03:00
|
|
|
};
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
bool ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter,
|
2009-11-17 17:22:23 +03:00
|
|
|
mozilla::dom::RemoteDOMEvent* aResult);
|
|
|
|
|
2011-06-08 23:56:31 +04:00
|
|
|
typedef CrashReporter::ThreadId NativeThreadId;
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2009-11-17 17:22:23 +03:00
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
|
|
|
|
template<>
|
|
|
|
struct ParamTraits<mozilla::dom::RemoteDOMEvent>
|
|
|
|
{
|
|
|
|
typedef mozilla::dom::RemoteDOMEvent paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2011-10-17 18:59:28 +04:00
|
|
|
aParam.mEvent->Serialize(aMsg, true);
|
2009-11-17 17:22:23 +03:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
|
2009-11-17 17:22:23 +03:00
|
|
|
{
|
|
|
|
return mozilla::dom::ReadRemoteEvent(aMsg, aIter, aResult);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void Log(const paramType& aParam, std::wstring* aLog)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-05-14 15:16:00 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<nsEventStatus>
|
|
|
|
: public ContiguousEnumSerializer<nsEventStatus,
|
|
|
|
nsEventStatus_eIgnore,
|
|
|
|
nsEventStatus_eSentinel>
|
2016-01-05 12:59:30 +03:00
|
|
|
{};
|
2015-05-14 15:16:00 +03:00
|
|
|
|
2015-08-29 04:12:41 +03:00
|
|
|
template<>
|
|
|
|
struct ParamTraits<nsSizeMode>
|
|
|
|
: public ContiguousEnumSerializer<nsSizeMode,
|
|
|
|
nsSizeMode_Normal,
|
|
|
|
nsSizeMode_Invalid>
|
2016-01-05 12:59:30 +03:00
|
|
|
{};
|
2015-08-29 04:12:41 +03:00
|
|
|
|
2016-06-09 14:59:31 +03:00
|
|
|
template<>
|
|
|
|
struct ParamTraits<UIStateChangeType>
|
|
|
|
: public ContiguousEnumSerializer<UIStateChangeType,
|
|
|
|
UIStateChangeType_NoChange,
|
|
|
|
UIStateChangeType_Invalid>
|
|
|
|
{ };
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace IPC
|
2009-11-17 17:22:23 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
#endif // TABMESSAGE_UTILS_H
|