Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "mozilla/EventDispatcher.h" |
michael@0 | 7 | #include "mozilla/dom/TabMessageUtils.h" |
michael@0 | 8 | #include "nsCOMPtr.h" |
michael@0 | 9 | #include "nsIDOMEvent.h" |
michael@0 | 10 | |
michael@0 | 11 | namespace mozilla { |
michael@0 | 12 | namespace dom { |
michael@0 | 13 | |
michael@0 | 14 | bool |
michael@0 | 15 | ReadRemoteEvent(const IPC::Message* aMsg, void** aIter, |
michael@0 | 16 | RemoteDOMEvent* aResult) |
michael@0 | 17 | { |
michael@0 | 18 | aResult->mEvent = nullptr; |
michael@0 | 19 | nsString type; |
michael@0 | 20 | NS_ENSURE_TRUE(ReadParam(aMsg, aIter, &type), false); |
michael@0 | 21 | |
michael@0 | 22 | nsCOMPtr<nsIDOMEvent> event; |
michael@0 | 23 | EventDispatcher::CreateEvent(nullptr, nullptr, nullptr, type, |
michael@0 | 24 | getter_AddRefs(event)); |
michael@0 | 25 | aResult->mEvent = do_QueryInterface(event); |
michael@0 | 26 | NS_ENSURE_TRUE(aResult->mEvent, false); |
michael@0 | 27 | |
michael@0 | 28 | return aResult->mEvent->Deserialize(aMsg, aIter); |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | } |
michael@0 | 32 | } |