зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1678374 - Avoid including jsapi.h from header files. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D97620 Depends on D97618
This commit is contained in:
Родитель
e9f54e05c6
Коммит
feb7572bff
|
@ -7,8 +7,8 @@
|
|||
#ifndef nsDOMJSUtils_h__
|
||||
#define nsDOMJSUtils_h__
|
||||
|
||||
#include "nsIScriptContext.h"
|
||||
#include "jsapi.h"
|
||||
#include "js/TypeDecls.h"
|
||||
#include "nscore.h"
|
||||
|
||||
class nsIJSArgArray;
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "js/Conversions.h"
|
||||
#include "js/RootingAPI.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/dom/BindingCallContext.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#ifndef mozilla_dom_BodyExtractor_h
|
||||
#define mozilla_dom_BodyExtractor_h
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "nsString.h"
|
||||
|
||||
class nsIInputStream;
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
#ifndef mozilla_dom_FetchStreamReader_h
|
||||
#define mozilla_dom_FetchStreamReader_h
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "js/RootingAPI.h"
|
||||
#include "js/TypeDecls.h"
|
||||
#include "mozilla/dom/FetchBinding.h"
|
||||
#include "mozilla/dom/PromiseNativeHandler.h"
|
||||
#include "nsIAsyncOutputStream.h"
|
||||
|
|
|
@ -9,9 +9,8 @@
|
|||
|
||||
#include "mozilla/dom/indexedDB/IDBResult.h"
|
||||
|
||||
#include "js/Array.h" // JS::GetArrayLength
|
||||
#include "js/RootingAPI.h"
|
||||
#include "jsapi.h"
|
||||
#include "js/TypeDecls.h"
|
||||
#include "nsString.h"
|
||||
|
||||
class mozIStorageStatement;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#ifndef mozilla_dom_PushSubscription_h
|
||||
#define mozilla_dom_PushSubscription_h
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "js/RootingAPI.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
#ifndef mozilla_dom_ScriptLoadRequest_h
|
||||
#define mozilla_dom_ScriptLoadRequest_h
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "js/OffThreadScriptCompilation.h"
|
||||
#include "js/AllocPolicy.h"
|
||||
#include "js/RootingAPI.h"
|
||||
#include "js/TypeDecls.h"
|
||||
#include "mozilla/Atomics.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/CORSMode.h"
|
||||
|
@ -26,6 +27,10 @@
|
|||
|
||||
class nsICacheInfoChannel;
|
||||
|
||||
namespace JS {
|
||||
class OffThreadToken;
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
|
@ -174,7 +179,7 @@ class ScriptLoadRequest
|
|||
// can be transferred in constant time to the JS engine, not copied in linear
|
||||
// time.
|
||||
template <typename Unit>
|
||||
using ScriptTextBuffer = Vector<Unit, 0, JSMallocAllocPolicy>;
|
||||
using ScriptTextBuffer = Vector<Unit, 0, js::MallocAllocPolicy>;
|
||||
|
||||
// BinAST data isn't transferred to the JS engine, so it doesn't need to use
|
||||
// the JS allocator.
|
||||
|
|
|
@ -36,6 +36,8 @@ class nsIURI;
|
|||
|
||||
namespace JS {
|
||||
|
||||
class CompileOptions;
|
||||
|
||||
template <typename UnitT>
|
||||
class SourceText;
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "js/ContextOptions.h"
|
||||
#include "js/GCAPI.h"
|
||||
#include "js/RealmOptions.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "nsString.h"
|
||||
#include "nsTArray.h"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#ifndef mozilla_dom_workers_WorkerCommon_h
|
||||
#define mozilla_dom_workers_WorkerCommon_h
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "js/TypeDecls.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/ServiceWorkerDescriptor.h"
|
||||
|
||||
|
|
|
@ -187,6 +187,21 @@ class TempAllocPolicy : public AllocPolicyBase {
|
|||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* A replacement for MallocAllocPolicy that allocates in the JS heap and adds no
|
||||
* extra behaviours.
|
||||
*
|
||||
* This is currently used for allocating source buffers for parsing. Since these
|
||||
* are temporary and will not be freed by GC, the memory is not tracked by the
|
||||
* usual accounting.
|
||||
*/
|
||||
class MallocAllocPolicy : public AllocPolicyBase {
|
||||
public:
|
||||
void reportAllocOverflow() const {}
|
||||
|
||||
MOZ_MUST_USE bool checkSimulatedOOM() const { return true; }
|
||||
};
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
#endif /* js_AllocPolicy_h */
|
||||
|
|
|
@ -666,21 +666,6 @@ extern JS_PUBLIC_API bool IsProfileTimelineRecordingEnabled();
|
|||
|
||||
} // namespace JS
|
||||
|
||||
/*
|
||||
* A replacement for MallocAllocPolicy that allocates in the JS heap and adds no
|
||||
* extra behaviours.
|
||||
*
|
||||
* This is currently used for allocating source buffers for parsing. Since these
|
||||
* are temporary and will not be freed by GC, the memory is not tracked by the
|
||||
* usual accounting.
|
||||
*/
|
||||
class JS_PUBLIC_API JSMallocAllocPolicy : public js::AllocPolicyBase {
|
||||
public:
|
||||
void reportAllocOverflow() const {}
|
||||
|
||||
MOZ_MUST_USE bool checkSimulatedOOM() const { return true; }
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the size of the native stack that should not be exceed. To disable
|
||||
* stack size checking pass 0.
|
||||
|
|
|
@ -9,13 +9,18 @@
|
|||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "mozilla/dom/PrecompiledScriptBinding.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "js/RootingAPI.h"
|
||||
#include "js/TypeDecls.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
namespace JS {
|
||||
class ReadOnlyCompileOptions;
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class PrecompiledScript : public nsISupports, public nsWrapperCache {
|
||||
|
|
|
@ -25,9 +25,10 @@
|
|||
#include "nsIThread.h"
|
||||
#include "nsITimer.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "js/CompileOptions.h" // JS::CompileOptions, JS::ReadOnlyCompileOptions
|
||||
#include "js/GCAnnotations.h"
|
||||
#include "js/GCAnnotations.h" // for JS_HAZ_NON_GC_POINTER
|
||||
#include "js/RootingAPI.h" // for Handle, Heap
|
||||
#include "js/Transcoding.h" // for TranscodeBuffer, TranscodeRange, TranscodeSources
|
||||
#include "js/TypeDecls.h" // for HandleObject, HandleScript
|
||||
|
||||
#include <prio.h>
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
#include "mozilla/dom/StreamFilterDataEventBinding.h"
|
||||
#include "mozilla/extensions/StreamFilter.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "js/RootingAPI.h"
|
||||
#include "js/TypeDecls.h"
|
||||
|
||||
#include "mozilla/HoldDropJSObjects.h"
|
||||
#include "mozilla/dom/Event.h"
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
#include "nsIObserver.h"
|
||||
#include "nsISupports.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class Addon;
|
||||
|
|
Загрузка…
Ссылка в новой задаче