[SM91] Update to Spidermonkey 91.1.3 APIs
[0ad.git] / libraries / source / spidermonkey / include-win32-release / js / experimental / CodeCoverage.h
blob32729c792d95c93012780f09ce4662b3c97ce097
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/. */
7 #ifndef js_experimental_CodeCoverage_h
8 #define js_experimental_CodeCoverage_h
10 #include "jstypes.h" // JS_PUBLIC_API
11 #include "js/Utility.h" // JS::UniqueChars
13 struct JS_PUBLIC_API JSContext;
15 namespace js {
17 /**
18 * Enable the collection of lcov code coverage metrics.
19 * Must be called before a runtime is created and before any calls to
20 * GetCodeCoverageSummary.
22 extern JS_PUBLIC_API void EnableCodeCoverage();
24 /**
25 * Generate lcov trace file content for the current realm, and allocate a new
26 * buffer and return the content in it, the size of the newly allocated content
27 * within the buffer would be set to the length out-param. The 'All' variant
28 * will collect data for all realms in the runtime.
30 * In case of out-of-memory, this function returns nullptr. The length
31 * out-param is undefined on failure.
33 extern JS_PUBLIC_API JS::UniqueChars GetCodeCoverageSummary(JSContext* cx,
34 size_t* length);
35 extern JS_PUBLIC_API JS::UniqueChars GetCodeCoverageSummaryAll(JSContext* cx,
36 size_t* length);
38 } // namespace js
40 #endif // js_experimental_CodeCoverage_h