Bug 1726737 - Part 16: Move JS_DefineDebuggerObject into js/Debug.h. r=arai
authorAndré Bargull <andre.bargull@gmail.com>
Fri, 20 Aug 2021 18:10:38 +0000
changeset 589465 8bc5e61d9aa60e092bc34e11c4b8c6db1ced7bf1
parent 589464 b1c14abc11533e9650d47b19406f4d0639acb9de
child 589466 cf8c331e6527db243872a3d630e20e6a6f64208a
push id148361
push userandre.bargull@gmail.com
push dateFri, 20 Aug 2021 18:16:41 +0000
treeherderautoland@01fc3504c984 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1726737
milestone93.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1726737 - Part 16: Move JS_DefineDebuggerObject into js/Debug.h. r=arai Moves `JS_DefineDebuggerObject` into "js/Debug.h", which allows to remove the "jsapi.h" include in "debugger/Debugger.h". And then add the missing "jsapi.h" include in "debugger/DebuggerMemory.cpp". Differential Revision: https://phabricator.services.mozilla.com/D123207
js/public/Debug.h
js/src/debugger/Debugger.h
js/src/debugger/DebuggerMemory.cpp
js/src/jsapi.h
--- a/js/public/Debug.h
+++ b/js/public/Debug.h
@@ -20,16 +20,20 @@
 #include "js/GCAPI.h"
 #include "js/RootingAPI.h"
 #include "js/TypeDecls.h"
 
 namespace js {
 class Debugger;
 }  // namespace js
 
+/* Defined in vm/Debugger.cpp. */
+extern JS_PUBLIC_API bool JS_DefineDebuggerObject(JSContext* cx,
+                                                  JS::HandleObject obj);
+
 namespace JS {
 namespace dbg {
 
 // [SMDOC] Debugger builder API
 //
 // Helping embedding code build objects for Debugger
 // -------------------------------------------------
 //
--- a/js/src/debugger/Debugger.h
+++ b/js/src/debugger/Debugger.h
@@ -17,29 +17,29 @@
 #include "mozilla/Result.h"            // for Result
 #include "mozilla/TimeStamp.h"         // for TimeStamp
 #include "mozilla/Variant.h"           // for Variant
 
 #include <stddef.h>  // for size_t
 #include <stdint.h>  // for uint32_t, uint64_t, uintptr_t
 #include <utility>   // for std::move
 
-#include "jsapi.h"             // JS_DefineDebuggerObject
 #include "jstypes.h"           // for JS_GC_ZEAL
 #include "NamespaceImports.h"  // for Value, HandleObject
 
 #include "debugger/DebugAPI.h"      // for DebugAPI
 #include "debugger/Object.h"        // for DebuggerObject
 #include "ds/TraceableFifo.h"       // for TraceableFifo
 #include "gc/Barrier.h"             // for WeakHeapPtrGlobalObject, HeapPtr
 #include "gc/Marking.h"             // for IsAboutToBeFinalized, ToMarkable
 #include "gc/Rooting.h"             // for HandleSavedFrame, HandleAtom
 #include "gc/Tracer.h"              // for TraceNullableEdge, TraceEdge
 #include "gc/WeakMap.h"             // for WeakMap
 #include "gc/ZoneAllocator.h"       // for ZoneAllocPolicy
+#include "js/Debug.h"               // JS_DefineDebuggerObject
 #include "js/GCAPI.h"               // for GarbageCollectionEvent
 #include "js/Proxy.h"               // for PropertyDescriptor
 #include "js/RootingAPI.h"          // for Handle
 #include "js/TracingAPI.h"          // for UnsafeTraceRoot
 #include "js/Wrapper.h"             // for UncheckedUnwrap
 #include "proxy/DeadObjectProxy.h"  // for IsDeadProxyObject
 #include "vm/GeneratorObject.h"     // for AbstractGeneratorObject
 #include "vm/GlobalObject.h"        // for GlobalObject
--- a/js/src/debugger/DebuggerMemory.cpp
+++ b/js/src/debugger/DebuggerMemory.cpp
@@ -7,16 +7,18 @@
 #include "debugger/DebuggerMemory.h"
 
 #include "mozilla/Maybe.h"
 #include "mozilla/Vector.h"
 
 #include <stdlib.h>
 #include <utility>
 
+#include "jsapi.h"
+
 #include "builtin/MapObject.h"
 #include "debugger/Debugger.h"
 #include "gc/Marking.h"
 #include "js/AllocPolicy.h"
 #include "js/Debug.h"
 #include "js/friend/ErrorMessages.h"  // js::GetErrorMessage, JSMSG_*
 #include "js/PropertySpec.h"
 #include "js/TracingAPI.h"
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -28,16 +28,17 @@
 
 #include "js/AllocPolicy.h"
 #include "js/CallAndConstruct.h"  // JS::Call, JS_CallFunction, JS_CallFunctionName, JS_CallFunctionValue
 #include "js/CallArgs.h"
 #include "js/CharacterEncoding.h"
 #include "js/Class.h"
 #include "js/CompileOptions.h"
 #include "js/Context.h"
+#include "js/Debug.h"
 #include "js/ErrorInterceptor.h"
 #include "js/ErrorReport.h"
 #include "js/Exception.h"
 #include "js/GCAPI.h"
 #include "js/GCVector.h"
 #include "js/GlobalObject.h"
 #include "js/HashTable.h"
 #include "js/Id.h"
@@ -261,20 +262,16 @@ extern JS_PUBLIC_API bool JS_InitReflect
 
 /**
  * Add various profiling-related functions as properties of the given object.
  * Defined in builtin/Profilers.cpp.
  */
 extern JS_PUBLIC_API bool JS_DefineProfilingFunctions(JSContext* cx,
                                                       JS::HandleObject obj);
 
-/* Defined in vm/Debugger.cpp. */
-extern JS_PUBLIC_API bool JS_DefineDebuggerObject(JSContext* cx,
-                                                  JS::HandleObject obj);
-
 namespace JS {
 
 /**
  * Tell JS engine whether Profile Timeline Recording is enabled or not.
  * If Profile Timeline Recording is enabled, data shown there like stack won't
  * be optimized out.
  * This is global state and not associated with specific runtime or context.
  */