michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "mozilla/EventDispatcher.h" michael@0: #include "mozilla/dom/TabMessageUtils.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIDOMEvent.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: bool michael@0: ReadRemoteEvent(const IPC::Message* aMsg, void** aIter, michael@0: RemoteDOMEvent* aResult) michael@0: { michael@0: aResult->mEvent = nullptr; michael@0: nsString type; michael@0: NS_ENSURE_TRUE(ReadParam(aMsg, aIter, &type), false); michael@0: michael@0: nsCOMPtr event; michael@0: EventDispatcher::CreateEvent(nullptr, nullptr, nullptr, type, michael@0: getter_AddRefs(event)); michael@0: aResult->mEvent = do_QueryInterface(event); michael@0: NS_ENSURE_TRUE(aResult->mEvent, false); michael@0: michael@0: return aResult->mEvent->Deserialize(aMsg, aIter); michael@0: } michael@0: michael@0: } michael@0: }