JSInjectedScriptHost.h [plain text]
#pragma once
#include "JSObject.h"
namespace Inspector {
class InjectedScriptHost;
class JSInjectedScriptHost final : public JSC::JSNonFinalObject {
public:
using Base = JSC::JSNonFinalObject;
static constexpr unsigned StructureFlags = Base::StructureFlags;
static constexpr bool needsDestruction = true;
template<typename CellType, JSC::SubspaceAccess mode>
static JSC::IsoSubspace* subspaceFor(JSC::VM& vm)
{
return vm.injectedScriptHostSpace<mode>();
}
DECLARE_INFO;
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
}
static JSInjectedScriptHost* create(JSC::VM& vm, JSC::Structure* structure, Ref<InjectedScriptHost>&& impl)
{
JSInjectedScriptHost* instance = new (NotNull, JSC::allocateCell<JSInjectedScriptHost>(vm.heap)) JSInjectedScriptHost(vm, structure, WTFMove(impl));
instance->finishCreation(vm);
return instance;
}
static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
static void destroy(JSC::JSCell*);
InjectedScriptHost& impl() const { return m_wrapped; }
JSC::JSValue evaluate(JSC::JSGlobalObject*) const;
JSC::JSValue savedResultAlias(JSC::JSGlobalObject*) const;
JSC::JSValue evaluateWithScopeExtension(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue internalConstructorName(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue isHTMLAllCollection(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue isPromiseRejectedWithNativeGetterTypeError(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue subtype(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue functionDetails(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue getInternalProperties(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue proxyTargetValue(JSC::VM&, JSC::CallFrame*);
JSC::JSValue weakMapSize(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue weakMapEntries(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue weakSetSize(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue weakSetEntries(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue iteratorEntries(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue queryInstances(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC::JSValue queryHolders(JSC::JSGlobalObject*, JSC::CallFrame*);
private:
JSInjectedScriptHost(JSC::VM&, JSC::Structure*, Ref<InjectedScriptHost>&&);
void finishCreation(JSC::VM&);
Ref<InjectedScriptHost> m_wrapped;
};
}