tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

GamepadTestChannelChild.cpp (1191B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "GamepadTestChannelChild.h"
      8 
      9 #include "mozilla/dom/GamepadServiceTest.h"
     10 
     11 namespace mozilla::dom {
     12 
     13 already_AddRefed<GamepadTestChannelChild> GamepadTestChannelChild::Create(
     14    GamepadServiceTest* aGamepadServiceTest) {
     15  return RefPtr<GamepadTestChannelChild>(
     16             new GamepadTestChannelChild(aGamepadServiceTest))
     17      .forget();
     18 }
     19 
     20 GamepadTestChannelChild::GamepadTestChannelChild(
     21    GamepadServiceTest* aGamepadServiceTest)
     22    : mGamepadServiceTest(aGamepadServiceTest) {}
     23 
     24 mozilla::ipc::IPCResult GamepadTestChannelChild::RecvReplyGamepadHandle(
     25    const uint32_t& aID, const GamepadHandle& aHandle) {
     26  MOZ_RELEASE_ASSERT(
     27      mGamepadServiceTest,
     28      "Test channel should never outlive the owning GamepadServiceTest");
     29 
     30  mGamepadServiceTest->ReplyGamepadHandle(aID, aHandle);
     31  return IPC_OK();
     32 }
     33 
     34 }  // namespace mozilla::dom