2009-11-17 06:22:23 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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 06:22:23 -08:00
|
|
|
|
|
|
|
#ifndef TABMESSAGE_UTILS_H
|
|
|
|
#define TABMESSAGE_UTILS_H
|
|
|
|
|
2012-08-28 05:41:04 -07:00
|
|
|
#include "ipc/IPCMessageUtils.h"
|
2012-06-10 16:44:50 -07:00
|
|
|
#include "nsIDOMEvent.h"
|
2009-11-17 06:22:23 -08:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
2011-06-08 12:56:31 -07:00
|
|
|
#ifdef MOZ_CRASHREPORTER
|
|
|
|
#include "nsExceptionHandler.h"
|
|
|
|
#endif
|
|
|
|
|
2009-11-17 06:22:23 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
struct RemoteDOMEvent
|
|
|
|
{
|
2012-06-10 16:44:50 -07:00
|
|
|
nsCOMPtr<nsIDOMEvent> mEvent;
|
2009-11-17 06:22:23 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
bool ReadRemoteEvent(const IPC::Message* aMsg, void** aIter,
|
|
|
|
mozilla::dom::RemoteDOMEvent* aResult);
|
|
|
|
|
2011-06-08 12:56:31 -07:00
|
|
|
#ifdef MOZ_CRASHREPORTER
|
|
|
|
typedef CrashReporter::ThreadId NativeThreadId;
|
|
|
|
#else
|
|
|
|
// unused in this case
|
2012-09-17 01:37:20 -07:00
|
|
|
typedef int32_t NativeThreadId;
|
2011-06-08 12:56:31 -07:00
|
|
|
#endif
|
|
|
|
|
2009-11-17 06:22:23 -08: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 07:59:28 -07:00
|
|
|
aParam.mEvent->Serialize(aMsg, true);
|
2009-11-17 06:22:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
return mozilla::dom::ReadRemoteEvent(aMsg, aIter, aResult);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void Log(const paramType& aParam, std::wstring* aLog)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|