dom/ipc/TabMessageUtils.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/ipc/TabMessageUtils.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,32 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "mozilla/EventDispatcher.h"
    1.10 +#include "mozilla/dom/TabMessageUtils.h"
    1.11 +#include "nsCOMPtr.h"
    1.12 +#include "nsIDOMEvent.h"
    1.13 +
    1.14 +namespace mozilla {
    1.15 +namespace dom {
    1.16 +
    1.17 +bool
    1.18 +ReadRemoteEvent(const IPC::Message* aMsg, void** aIter,
    1.19 +                RemoteDOMEvent* aResult)
    1.20 +{
    1.21 +  aResult->mEvent = nullptr;
    1.22 +  nsString type;
    1.23 +  NS_ENSURE_TRUE(ReadParam(aMsg, aIter, &type), false);
    1.24 +
    1.25 +  nsCOMPtr<nsIDOMEvent> event;
    1.26 +  EventDispatcher::CreateEvent(nullptr, nullptr, nullptr, type,
    1.27 +                               getter_AddRefs(event));
    1.28 +  aResult->mEvent = do_QueryInterface(event);
    1.29 +  NS_ENSURE_TRUE(aResult->mEvent, false);
    1.30 +
    1.31 +  return aResult->mEvent->Deserialize(aMsg, aIter);
    1.32 +}
    1.33 +
    1.34 +}
    1.35 +}

mercurial