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 mozilla_DebuggerOnGCRunnable_h
8 #define mozilla_DebuggerOnGCRunnable_h
13 #include "mozilla/UniquePtr.h"
14 #include "nsThreadUtils.h"
18 // Runnable to fire the SpiderMonkey Debugger API's onGarbageCollection hook.
19 class DebuggerOnGCRunnable
: public CancelableRunnable
{
20 JS::dbg::GarbageCollectionEvent::Ptr mGCData
;
22 explicit DebuggerOnGCRunnable(JS::dbg::GarbageCollectionEvent::Ptr
&& aGCData
)
23 : CancelableRunnable("DebuggerOnGCRunnable"),
24 mGCData(std::move(aGCData
)) {}
27 static nsresult
Enqueue(JSContext
* aCx
, const JS::GCDescription
& aDesc
);
30 nsresult
Cancel() override
;
33 } // namespace mozilla
35 #endif // ifdef mozilla_dom_DebuggerOnGCRunnable_h