Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/gamepad/GamepadMonitoring.cpp
Line
Count
Source (jump to first uncovered line)
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 "mozilla/dom/GamepadMonitoring.h"
8
#include "mozilla/dom/GamepadPlatformService.h"
9
#include "mozilla/ipc/BackgroundParent.h"
10
11
using namespace mozilla::ipc;
12
13
namespace mozilla {
14
namespace dom {
15
16
void
17
MaybeStopGamepadMonitoring()
18
0
{
19
0
  AssertIsOnBackgroundThread();
20
0
  RefPtr<GamepadPlatformService> service =
21
0
    GamepadPlatformService::GetParentService();
22
0
  MOZ_ASSERT(service);
23
0
  if(service->HasGamepadListeners()) {
24
0
    return;
25
0
  }
26
0
  StopGamepadMonitoring();
27
0
  service->ResetGamepadIndexes();
28
0
  service->MaybeShutdown();
29
0
}
30
31
} // namespace dom
32
} // namespace mozilla