TabMessageUtils.cpp 901 B

123456789101112131415161718192021222324252627282930
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "mozilla/EventDispatcher.h"
  6. #include "mozilla/dom/Event.h"
  7. #include "mozilla/dom/TabMessageUtils.h"
  8. #include "nsCOMPtr.h"
  9. namespace mozilla {
  10. namespace dom {
  11. bool
  12. ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter,
  13. RemoteDOMEvent* aResult)
  14. {
  15. aResult->mEvent = nullptr;
  16. nsString type;
  17. NS_ENSURE_TRUE(ReadParam(aMsg, aIter, &type), false);
  18. aResult->mEvent = EventDispatcher::CreateEvent(nullptr, nullptr, nullptr,
  19. type);
  20. return aResult->mEvent->Deserialize(aMsg, aIter);
  21. }
  22. } // namespace dom
  23. } // namespace mozilla