summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2021-11-14 06:04:48 -0500
committerMatt A. Tobin <email@mattatobin.com>2021-11-14 06:04:48 -0500
commit990d03ef77a314b43570cf3b4694a19b9caa6ed5 (patch)
treebc5fa7b311b308ec7f561f5b350af0698b2d1ce5 /js
parenta5a628da9416e7443b2c13d04dc546ddb2f46da0 (diff)
downloadaura-central-990d03ef77a314b43570cf3b4694a19b9caa6ed5.tar.gz
Issue %3005 - Move js/ductork/* to components/js*
Diffstat (limited to 'js')
-rw-r--r--js/ductwork/debugger/IJSDebugger.idl20
-rw-r--r--js/ductwork/debugger/JSDebugger.cpp86
-rw-r--r--js/ductwork/debugger/JSDebugger.h30
-rw-r--r--js/ductwork/debugger/jsdebugger.jsm85
-rw-r--r--js/ductwork/debugger/moz.build22
-rw-r--r--js/ductwork/debugger/tests/head_dbg.js17
-rw-r--r--js/ductwork/debugger/tests/test_nativewrappers.js30
-rw-r--r--js/ductwork/debugger/tests/xpcshell.ini8
-rw-r--r--js/ductwork/inspector/moz.build16
-rw-r--r--js/ductwork/inspector/nsIJSInspector.idl75
-rw-r--r--js/ductwork/inspector/nsJSInspector.cpp146
-rw-r--r--js/ductwork/inspector/nsJSInspector.h39
12 files changed, 0 insertions, 574 deletions
diff --git a/js/ductwork/debugger/IJSDebugger.idl b/js/ductwork/debugger/IJSDebugger.idl
deleted file mode 100644
index dc3cd0423..000000000
--- a/js/ductwork/debugger/IJSDebugger.idl
+++ /dev/null
@@ -1,20 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-/**
- * Do not use this interface. Instead, write:
- * Components.utils.import("resource://gre/modules/jsdebugger.jsm");
- * addDebuggerToGlobal(global);
- */
-[scriptable, uuid(a36fa816-31da-4b23-bc97-6412771f0867)]
-interface IJSDebugger : nsISupports
-{
- /**
- * Define the global Debugger constructor on a given global.
- */
- [implicit_jscontext]
- void addClass(in jsval global);
-};
diff --git a/js/ductwork/debugger/JSDebugger.cpp b/js/ductwork/debugger/JSDebugger.cpp
deleted file mode 100644
index 074008cdc..000000000
--- a/js/ductwork/debugger/JSDebugger.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "JSDebugger.h"
-#include "nsIXPConnect.h"
-#include "nsThreadUtils.h"
-#include "jsapi.h"
-#include "jsfriendapi.h"
-#include "jswrapper.h"
-#include "mozilla/ModuleUtils.h"
-#include "nsServiceManagerUtils.h"
-#include "nsMemory.h"
-
-#define JSDEBUGGER_CONTRACTID \
- "@mozilla.org/jsdebugger;1"
-
-#define JSDEBUGGER_CID \
-{ 0x0365cbd5, 0xd46e, 0x4e94, { 0xa3, 0x9f, 0x83, 0xb6, 0x3c, 0xd1, 0xa9, 0x63 } }
-
-namespace mozilla {
-namespace jsdebugger {
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(JSDebugger)
-
-NS_IMPL_ISUPPORTS(JSDebugger, IJSDebugger)
-
-JSDebugger::JSDebugger()
-{
-}
-
-JSDebugger::~JSDebugger()
-{
-}
-
-NS_IMETHODIMP
-JSDebugger::AddClass(JS::Handle<JS::Value> global, JSContext* cx)
-{
- nsresult rv;
- nsCOMPtr<nsIXPConnect> xpc = do_GetService(nsIXPConnect::GetCID(), &rv);
-
- if (!global.isObject()) {
- return NS_ERROR_INVALID_ARG;
- }
-
- JS::RootedObject obj(cx, &global.toObject());
- obj = js::UncheckedUnwrap(obj, /* stopAtWindowProxy = */ false);
- if (!obj) {
- return NS_ERROR_FAILURE;
- }
-
- JSAutoCompartment ac(cx, obj);
- if (JS_GetGlobalForObject(cx, obj) != obj) {
- return NS_ERROR_INVALID_ARG;
- }
-
- if (!JS_DefineDebuggerObject(cx, obj)) {
- return NS_ERROR_FAILURE;
- }
-
- return NS_OK;
-}
-
-} // namespace jsdebugger
-} // namespace mozilla
-
-NS_DEFINE_NAMED_CID(JSDEBUGGER_CID);
-
-static const mozilla::Module::CIDEntry kJSDebuggerCIDs[] = {
- { &kJSDEBUGGER_CID, false, nullptr, mozilla::jsdebugger::JSDebuggerConstructor },
- { nullptr }
-};
-
-static const mozilla::Module::ContractIDEntry kJSDebuggerContracts[] = {
- { JSDEBUGGER_CONTRACTID, &kJSDEBUGGER_CID },
- { nullptr }
-};
-
-static const mozilla::Module kJSDebuggerModule = {
- mozilla::Module::kVersion,
- kJSDebuggerCIDs,
- kJSDebuggerContracts
-};
-
-NSMODULE_DEFN(jsdebugger) = &kJSDebuggerModule;
diff --git a/js/ductwork/debugger/JSDebugger.h b/js/ductwork/debugger/JSDebugger.h
deleted file mode 100644
index ce5ab81ad..000000000
--- a/js/ductwork/debugger/JSDebugger.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef JSDebugger_h
-#define JSDebugger_h
-
-#include "IJSDebugger.h"
-#include "mozilla/Attributes.h"
-
-namespace mozilla {
-namespace jsdebugger {
-
-class JSDebugger final : public IJSDebugger
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_IJSDEBUGGER
-
- JSDebugger();
-
-private:
- ~JSDebugger();
-};
-
-} // namespace jsdebugger
-} // namespace mozilla
-
-#endif /* JSDebugger_h */
diff --git a/js/ductwork/debugger/jsdebugger.jsm b/js/ductwork/debugger/jsdebugger.jsm
deleted file mode 100644
index 8b87c0a05..000000000
--- a/js/ductwork/debugger/jsdebugger.jsm
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-this.EXPORTED_SYMBOLS = [ "addDebuggerToGlobal" ];
-
-/*
- * This is the js module for Debugger. Import it like so:
- * Components.utils.import("resource://gre/modules/jsdebugger.jsm");
- * addDebuggerToGlobal(this);
- *
- * This will create a 'Debugger' object, which provides an interface to debug
- * JavaScript code running in other compartments in the same process, on the
- * same thread.
- *
- * For documentation on the API, see:
- * https://developer.mozilla.org/en-US/docs/Tools/Debugger-API
- */
-
-const init = Components.classes["@mozilla.org/jsdebugger;1"].createInstance(Components.interfaces.IJSDebugger);
-this.addDebuggerToGlobal = function addDebuggerToGlobal(global) {
- init.addClass(global);
- initPromiseDebugging(global);
-};
-
-function initPromiseDebugging(global) {
- if (global.Debugger.Object.prototype.PromiseDebugging) {
- return;
- }
-
- // If the PromiseDebugging object doesn't have all legacy functions, we're
- // using the new accessors on Debugger.Object already.
- if (!PromiseDebugging.getDependentPromises) {
- return;
- }
-
- // Otherwise, polyfill them using PromiseDebugging.
- global.Debugger.Object.prototype.PromiseDebugging = PromiseDebugging;
- global.eval(polyfillSource);
-}
-
-let polyfillSource = `
- Object.defineProperty(Debugger.Object.prototype, "promiseState", {
- get() {
- const state = this.PromiseDebugging.getState(this.unsafeDereference());
- return {
- state: state.state,
- value: this.makeDebuggeeValue(state.value),
- reason: this.makeDebuggeeValue(state.reason)
- };
- }
- });
- Object.defineProperty(Debugger.Object.prototype, "promiseLifetime", {
- get() {
- return this.PromiseDebugging.getPromiseLifetime(this.unsafeDereference());
- }
- });
- Object.defineProperty(Debugger.Object.prototype, "promiseTimeToResolution", {
- get() {
- return this.PromiseDebugging.getTimeToSettle(this.unsafeDereference());
- }
- });
- Object.defineProperty(Debugger.Object.prototype, "promiseDependentPromises", {
- get() {
- let promises = this.PromiseDebugging.getDependentPromises(this.unsafeDereference());
- return promises.map(p => this.makeDebuggeeValue(p));
- }
- });
- Object.defineProperty(Debugger.Object.prototype, "promiseAllocationSite", {
- get() {
- return this.PromiseDebugging.getAllocationStack(this.unsafeDereference());
- }
- });
- Object.defineProperty(Debugger.Object.prototype, "promiseResolutionSite", {
- get() {
- let state = this.promiseState.state;
- if (state === "fulfilled") {
- return this.PromiseDebugging.getFullfillmentStack(this.unsafeDereference());
- } else {
- return this.PromiseDebugging.getRejectionStack(this.unsafeDereference());
- }
- }
- });
-`;
diff --git a/js/ductwork/debugger/moz.build b/js/ductwork/debugger/moz.build
deleted file mode 100644
index 71a53df9e..000000000
--- a/js/ductwork/debugger/moz.build
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPIDL_SOURCES += [
- 'IJSDebugger.idl',
-]
-
-XPIDL_MODULE = 'jsdebugger'
-
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini']
-
-SOURCES += [
- 'JSDebugger.cpp',
-]
-
-EXTRA_JS_MODULES += [
- 'jsdebugger.jsm',
-]
-
-FINAL_LIBRARY = 'xul'
diff --git a/js/ductwork/debugger/tests/head_dbg.js b/js/ductwork/debugger/tests/head_dbg.js
deleted file mode 100644
index 0ffeed26b..000000000
--- a/js/ductwork/debugger/tests/head_dbg.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-function testGlobal(aName) {
- let systemPrincipal = Cc["@mozilla.org/systemprincipal;1"]
- .createInstance(Ci.nsIPrincipal);
-
- let sandbox = Cu.Sandbox(systemPrincipal);
- Cu.evalInSandbox("this.__name = '" + aName + "'", sandbox);
- return sandbox;
-}
diff --git a/js/ductwork/debugger/tests/test_nativewrappers.js b/js/ductwork/debugger/tests/test_nativewrappers.js
deleted file mode 100644
index 9ee96701e..000000000
--- a/js/ductwork/debugger/tests/test_nativewrappers.js
+++ /dev/null
@@ -1,30 +0,0 @@
-function run_test()
-{
- Components.utils.import("resource://gre/modules/jsdebugger.jsm");
- addDebuggerToGlobal(this);
- var g = testGlobal("test1");
-
- var dbg = new Debugger();
- dbg.addDebuggee(g);
- dbg.onDebuggerStatement = function(aFrame) {
- let args = aFrame["arguments"];
- try {
- args[0];
- do_check_true(true);
- } catch(ex) {
- do_check_true(false);
- }
- };
-
- g.eval("function stopMe(arg) {debugger;}");
-
- g2 = testGlobal("test2");
- g2.g = g;
- g2.eval("(" + function createBadEvent() {
- let parser = Components.classes["@mozilla.org/xmlextras/domparser;1"].createInstance(Components.interfaces.nsIDOMParser);
- let doc = parser.parseFromString("<foo></foo>", "text/xml");
- g.stopMe(doc.createEvent("MouseEvent"));
- } + ")()");
-
- dbg.enabled = false;
-}
diff --git a/js/ductwork/debugger/tests/xpcshell.ini b/js/ductwork/debugger/tests/xpcshell.ini
deleted file mode 100644
index cc60c2e4d..000000000
--- a/js/ductwork/debugger/tests/xpcshell.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-head = head_dbg.js
-tail =
-skip-if = toolkit == 'android'
-
-[test_nativewrappers.js]
-# Bug 685068
-fail-if = os == "android"
diff --git a/js/ductwork/inspector/moz.build b/js/ductwork/inspector/moz.build
deleted file mode 100644
index c1c1298cb..000000000
--- a/js/ductwork/inspector/moz.build
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPIDL_SOURCES += [
- 'nsIJSInspector.idl',
-]
-
-XPIDL_MODULE = 'jsinspector'
-
-SOURCES += [
- 'nsJSInspector.cpp',
-]
-
-FINAL_LIBRARY = 'xul'
diff --git a/js/ductwork/inspector/nsIJSInspector.idl b/js/ductwork/inspector/nsIJSInspector.idl
deleted file mode 100644
index 40ad49523..000000000
--- a/js/ductwork/inspector/nsIJSInspector.idl
+++ /dev/null
@@ -1,75 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-/**
- * Utilities for running nested event loops, asking them to return, and
- * keeping track of which ones are still running.
- */
-[scriptable, uuid(6758d0d7-e96a-4c5c-bca8-3bcbe5a15943)]
-interface nsIJSInspector : nsISupports
-{
- /**
- * Process the current thread's event queue, calling event handlers until
- * a call to exitNestedEventLoop, below, asks us to return.
- *
- * The name 'enterNestedEventLoop' may be misleading if read too literally.
- * This method loops calling event handlers until one asks it to stop, and
- * then returns. So by that point, the nested event loop has been not only
- * entered, but also run and exited.
- *
- * When enterNestedEventLoop calls an event handler, that handler may itself
- * call enterNestedEventLoop, and so on, so that there may be arbitrarily
- * many such calls on the stack at the same time.
- *
- * We say an enterNestedEventLoop call is "running" if it has not yet been
- * asked to return, or "stopped" if it has been asked to return once it has
- * finished processing the current event.
- *
- * @param requestor A token of the caller's choice to identify this event
- * loop.
- *
- * @return depth The number of running enterNestedEventLoop calls
- * remaining, now that this one has returned.
- *
- * (Note that not all calls still on the stack are
- * necessary running; exitNestedEventLoop can ask any
- * number of enterNestedEventLoop calls to return.)
- */
- unsigned long enterNestedEventLoop(in jsval requestor);
-
- /**
- * Stop the youngest running enterNestedEventLoop call, asking it to return
- * once it has finished processing the current event.
- *
- * The name 'exitNestedEventLoop' may be misleading if read too literally.
- * The affected event loop does not return immediately when this method is
- * called. Rather, this method simply returns to its caller; the affected
- * loop's current event handler is allowed to run to completion; and then
- * that loop returns without processing any more events.
- *
- * This method ignores loops that have already been stopped, and operates on
- * the youngest loop that is still running. Each call to this method stops
- * another running loop.
- *
- * @return depth The number of running enterNestedEventLoop calls
- * remaining, now that one has been stopped.
- *
- * @throws NS_ERROR_FAILURE if there are no running enterNestedEventLoop calls.
- */
- unsigned long exitNestedEventLoop();
-
- /**
- * The number of running enterNestedEventLoop calls on the stack.
- * This count does not include stopped enterNestedEventLoop calls.
- */
- readonly attribute unsigned long eventLoopNestLevel;
-
- /**
- * The |requestor| value that was passed to the youngest running
- * enterNestedEventLoop call.
- */
- readonly attribute jsval lastNestRequestor;
-};
diff --git a/js/ductwork/inspector/nsJSInspector.cpp b/js/ductwork/inspector/nsJSInspector.cpp
deleted file mode 100644
index 457e64c08..000000000
--- a/js/ductwork/inspector/nsJSInspector.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsJSInspector.h"
-#include "nsIXPConnect.h"
-#include "nsThreadUtils.h"
-#include "jsfriendapi.h"
-#include "mozilla/HoldDropJSObjects.h"
-#include "mozilla/ModuleUtils.h"
-#include "mozilla/dom/ScriptSettings.h"
-#include "nsServiceManagerUtils.h"
-#include "nsMemory.h"
-#include "nsArray.h"
-#include "nsTArray.h"
-
-#define JSINSPECTOR_CONTRACTID \
- "@mozilla.org/jsinspector;1"
-
-#define JSINSPECTOR_CID \
-{ 0xec5aa99c, 0x7abb, 0x4142, { 0xac, 0x5f, 0xaa, 0xb2, 0x41, 0x9e, 0x38, 0xe2 } }
-
-namespace mozilla {
-namespace jsinspector {
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsJSInspector)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsJSInspector)
- NS_INTERFACE_MAP_ENTRY(nsISupports)
- NS_INTERFACE_MAP_ENTRY(nsIJSInspector)
-NS_INTERFACE_MAP_END
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(nsJSInspector)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsJSInspector)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsJSInspector)
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsJSInspector)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsJSInspector)
- tmp->mRequestors.Clear();
- tmp->mLastRequestor = JS::NullValue();
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsJSInspector)
- for (uint32_t i = 0; i < tmp->mRequestors.Length(); ++i) {
- NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mRequestors[i])
- }
- NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mLastRequestor)
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
-nsJSInspector::nsJSInspector() : mNestedLoopLevel(0), mRequestors(1), mLastRequestor(JS::NullValue())
-{
-}
-
-nsJSInspector::~nsJSInspector()
-{
- MOZ_ASSERT(mRequestors.Length() == 0);
- MOZ_ASSERT(mLastRequestor.isNull());
- mozilla::DropJSObjects(this);
-}
-
-NS_IMETHODIMP
-nsJSInspector::EnterNestedEventLoop(JS::Handle<JS::Value> requestor, uint32_t *out)
-{
- nsresult rv = NS_OK;
-
- mLastRequestor = requestor;
- mRequestors.AppendElement(requestor);
- mozilla::HoldJSObjects(this);
-
- mozilla::dom::AutoNoJSAPI nojsapi;
-
- uint32_t nestLevel = ++mNestedLoopLevel;
- while (NS_SUCCEEDED(rv) && mNestedLoopLevel >= nestLevel) {
- if (!NS_ProcessNextEvent())
- rv = NS_ERROR_UNEXPECTED;
- }
-
- NS_ASSERTION(mNestedLoopLevel <= nestLevel,
- "nested event didn't unwind properly");
-
- if (mNestedLoopLevel == nestLevel) {
- mLastRequestor = mRequestors.ElementAt(--mNestedLoopLevel);
- }
-
- *out = mNestedLoopLevel;
- return rv;
-}
-
-NS_IMETHODIMP
-nsJSInspector::ExitNestedEventLoop(uint32_t *out)
-{
- if (mNestedLoopLevel > 0) {
- mRequestors.RemoveElementAt(--mNestedLoopLevel);
- if (mNestedLoopLevel > 0)
- mLastRequestor = mRequestors.ElementAt(mNestedLoopLevel - 1);
- else
- mLastRequestor = JS::NullValue();
- } else {
- return NS_ERROR_FAILURE;
- }
-
- *out = mNestedLoopLevel;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsJSInspector::GetEventLoopNestLevel(uint32_t *out)
-{
- *out = mNestedLoopLevel;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsJSInspector::GetLastNestRequestor(JS::MutableHandle<JS::Value> out)
-{
- out.set(mLastRequestor);
- return NS_OK;
-}
-
-} // namespace jsinspector
-} // namespace mozilla
-
-NS_DEFINE_NAMED_CID(JSINSPECTOR_CID);
-
-static const mozilla::Module::CIDEntry kJSInspectorCIDs[] = {
- { &kJSINSPECTOR_CID, false, nullptr, mozilla::jsinspector::nsJSInspectorConstructor },
- { nullptr }
-};
-
-static const mozilla::Module::ContractIDEntry kJSInspectorContracts[] = {
- { JSINSPECTOR_CONTRACTID, &kJSINSPECTOR_CID },
- { nullptr }
-};
-
-static const mozilla::Module kJSInspectorModule = {
- mozilla::Module::kVersion,
- kJSInspectorCIDs,
- kJSInspectorContracts
-};
-
-NSMODULE_DEFN(jsinspector) = &kJSInspectorModule;
diff --git a/js/ductwork/inspector/nsJSInspector.h b/js/ductwork/inspector/nsJSInspector.h
deleted file mode 100644
index 4e60b0428..000000000
--- a/js/ductwork/inspector/nsJSInspector.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef COMPONENTS_JSINSPECTOR_H
-#define COMPONENTS_JSINSPECTOR_H
-
-#include "nsIJSInspector.h"
-#include "mozilla/Attributes.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsTArray.h"
-#include "js/Value.h"
-#include "js/RootingAPI.h"
-
-namespace mozilla {
-namespace jsinspector {
-
-class nsJSInspector final : public nsIJSInspector
-{
-public:
- NS_DECL_CYCLE_COLLECTING_ISUPPORTS
- NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsJSInspector)
- NS_DECL_NSIJSINSPECTOR
-
- nsJSInspector();
-
-private:
- ~nsJSInspector();
-
- uint32_t mNestedLoopLevel;
- nsTArray<JS::Heap<JS::Value> > mRequestors;
- JS::Heap<JS::Value> mLastRequestor;
-};
-
-} // namespace jsinspector
-} // namespace mozilla
-
-#endif