Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/base/FuzzingFunctions.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
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#include "FuzzingFunctions.h"
8
9
#include "nsJSEnvironment.h"
10
#include "js/GCAPI.h"
11
#include "mozilla/ErrorResult.h"
12
#include "nsIAccessibilityService.h"
13
#include "xpcAccessibilityService.h"
14
15
namespace mozilla {
16
namespace dom {
17
18
/* static */ void
19
FuzzingFunctions::GarbageCollect(const GlobalObject&)
20
0
{
21
0
  nsJSContext::GarbageCollectNow(JS::gcreason::COMPONENT_UTILS,
22
0
                                 nsJSContext::NonIncrementalGC,
23
0
                                 nsJSContext::NonShrinkingGC);
24
0
}
25
26
/* static */ void
27
FuzzingFunctions::CycleCollect(const GlobalObject&)
28
0
{
29
0
  nsJSContext::CycleCollectNow();
30
0
}
31
32
/* static */ void
33
FuzzingFunctions::EnableAccessibility(const GlobalObject&,
34
                                      ErrorResult& aRv)
35
0
{
36
0
  RefPtr<nsIAccessibilityService> a11y;
37
0
  nsresult rv;
38
0
39
0
  rv = NS_GetAccessibilityService(getter_AddRefs(a11y));
40
0
  if (NS_FAILED(rv)) {
41
0
    aRv.Throw(rv);
42
0
  }
43
0
}
44
45
} // namespace dom
46
} // namespace mozilla