| /* |
| This file is part of the WebKit open source project. |
| This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
| |
| This library is free software; you can redistribute it and/or |
| modify it under the terms of the GNU Library General Public |
| License as published by the Free Software Foundation; either |
| version 2 of the License, or (at your option) any later version. |
| |
| This library is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| Library General Public License for more details. |
| |
| You should have received a copy of the GNU Library General Public License |
| along with this library; see the file COPYING.LIB. If not, write to |
| the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| Boston, MA 02110-1301, USA. |
| */ |
| |
| #include "config.h" |
| |
| #if ENABLE(CONTENT_FILTERING) |
| |
| #include "JSMockContentFilterSettings.h" |
| |
| #include "JSDOMBinding.h" |
| #include "URL.h" |
| #include <runtime/JSString.h> |
| #include <wtf/GetPtr.h> |
| |
| using namespace JSC; |
| |
| namespace WebCore { |
| |
| // Attributes |
| |
| JSC::EncodedJSValue jsMockContentFilterSettingsEnabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSMockContentFilterSettingsEnabled(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsMockContentFilterSettingsBlockedString(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSMockContentFilterSettingsBlockedString(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsMockContentFilterSettingsModifiedRequestURL(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSMockContentFilterSettingsModifiedRequestURL(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsMockContentFilterSettingsDecisionPoint(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSMockContentFilterSettingsDecisionPoint(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsMockContentFilterSettingsDecision(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSMockContentFilterSettingsDecision(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsMockContentFilterSettingsUnblockRequestDecision(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSMockContentFilterSettingsUnblockRequestDecision(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsMockContentFilterSettingsUnblockRequestURL(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSMockContentFilterSettingsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| |
| class JSMockContentFilterSettingsPrototype : public JSC::JSNonFinalObject { |
| public: |
| typedef JSC::JSNonFinalObject Base; |
| static JSMockContentFilterSettingsPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) |
| { |
| JSMockContentFilterSettingsPrototype* ptr = new (NotNull, JSC::allocateCell<JSMockContentFilterSettingsPrototype>(vm.heap)) JSMockContentFilterSettingsPrototype(vm, globalObject, structure); |
| ptr->finishCreation(vm); |
| return ptr; |
| } |
| |
| 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()); |
| } |
| |
| private: |
| JSMockContentFilterSettingsPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| : JSC::JSNonFinalObject(vm, structure) |
| { |
| } |
| |
| void finishCreation(JSC::VM&); |
| }; |
| |
| /* Hash table for prototype */ |
| |
| static const HashTableValue JSMockContentFilterSettingsPrototypeTableValues[] = |
| { |
| { "enabled", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMockContentFilterSettingsEnabled), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSMockContentFilterSettingsEnabled) } }, |
| { "blockedString", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMockContentFilterSettingsBlockedString), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSMockContentFilterSettingsBlockedString) } }, |
| { "modifiedRequestURL", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMockContentFilterSettingsModifiedRequestURL), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSMockContentFilterSettingsModifiedRequestURL) } }, |
| { "decisionPoint", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMockContentFilterSettingsDecisionPoint), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSMockContentFilterSettingsDecisionPoint) } }, |
| { "decision", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMockContentFilterSettingsDecision), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSMockContentFilterSettingsDecision) } }, |
| { "unblockRequestDecision", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMockContentFilterSettingsUnblockRequestDecision), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSMockContentFilterSettingsUnblockRequestDecision) } }, |
| { "unblockRequestURL", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMockContentFilterSettingsUnblockRequestURL), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "DECISION_POINT_AFTER_WILL_SEND_REQUEST", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } }, |
| { "DECISION_POINT_AFTER_REDIRECT", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| { "DECISION_POINT_AFTER_RESPONSE", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| { "DECISION_POINT_AFTER_ADD_DATA", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(3) } }, |
| { "DECISION_POINT_AFTER_FINISHED_ADDING_DATA", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(4) } }, |
| { "DECISION_POINT_NEVER", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(5) } }, |
| { "DECISION_ALLOW", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } }, |
| { "DECISION_BLOCK", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| }; |
| |
| const ClassInfo JSMockContentFilterSettingsPrototype::s_info = { "MockContentFilterSettingsPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSMockContentFilterSettingsPrototype) }; |
| |
| void JSMockContentFilterSettingsPrototype::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| reifyStaticProperties(vm, JSMockContentFilterSettingsPrototypeTableValues, *this); |
| } |
| |
| const ClassInfo JSMockContentFilterSettings::s_info = { "MockContentFilterSettings", &Base::s_info, 0, CREATE_METHOD_TABLE(JSMockContentFilterSettings) }; |
| |
| JSMockContentFilterSettings::JSMockContentFilterSettings(Structure* structure, JSDOMGlobalObject& globalObject, Ref<MockContentFilterSettings>&& impl) |
| : JSDOMWrapper<MockContentFilterSettings>(structure, globalObject, WTFMove(impl)) |
| { |
| } |
| |
| JSObject* JSMockContentFilterSettings::createPrototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return JSMockContentFilterSettingsPrototype::create(vm, globalObject, JSMockContentFilterSettingsPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); |
| } |
| |
| JSObject* JSMockContentFilterSettings::prototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return getDOMPrototype<JSMockContentFilterSettings>(vm, globalObject); |
| } |
| |
| void JSMockContentFilterSettings::destroy(JSC::JSCell* cell) |
| { |
| JSMockContentFilterSettings* thisObject = static_cast<JSMockContentFilterSettings*>(cell); |
| thisObject->JSMockContentFilterSettings::~JSMockContentFilterSettings(); |
| } |
| |
| EncodedJSValue jsMockContentFilterSettingsEnabled(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "MockContentFilterSettings", "enabled"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsBoolean(impl.enabled()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsMockContentFilterSettingsBlockedString(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "MockContentFilterSettings", "blockedString"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.blockedString()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsMockContentFilterSettingsModifiedRequestURL(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "MockContentFilterSettings", "modifiedRequestURL"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.modifiedRequestURL()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsMockContentFilterSettingsDecisionPoint(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "MockContentFilterSettings", "decisionPoint"); |
| } |
| return JSValue::encode(castedThis->decisionPoint(*state)); |
| } |
| |
| |
| EncodedJSValue jsMockContentFilterSettingsDecision(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "MockContentFilterSettings", "decision"); |
| } |
| return JSValue::encode(castedThis->decision(*state)); |
| } |
| |
| |
| EncodedJSValue jsMockContentFilterSettingsUnblockRequestDecision(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "MockContentFilterSettings", "unblockRequestDecision"); |
| } |
| return JSValue::encode(castedThis->unblockRequestDecision(*state)); |
| } |
| |
| |
| EncodedJSValue jsMockContentFilterSettingsUnblockRequestURL(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "MockContentFilterSettings", "unblockRequestURL"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.unblockRequestURL()); |
| return JSValue::encode(result); |
| } |
| |
| |
| bool setJSMockContentFilterSettingsConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| JSValue value = JSValue::decode(encodedValue); |
| JSMockContentFilterSettingsPrototype* domObject = jsDynamicCast<JSMockContentFilterSettingsPrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!domObject)) { |
| throwVMTypeError(state, throwScope); |
| return false; |
| } |
| // Shadowing a built-in constructor |
| return domObject->putDirect(state->vm(), state->propertyNames().constructor, value); |
| } |
| |
| bool setJSMockContentFilterSettingsEnabled(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSMockContentFilterSettings* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "MockContentFilterSettings", "enabled"); |
| } |
| auto& impl = castedThis->wrapped(); |
| auto nativeValue = value.toBoolean(state); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| impl.setEnabled(WTFMove(nativeValue)); |
| return true; |
| } |
| |
| |
| bool setJSMockContentFilterSettingsBlockedString(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSMockContentFilterSettings* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "MockContentFilterSettings", "blockedString"); |
| } |
| auto& impl = castedThis->wrapped(); |
| auto nativeValue = value.toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| impl.setBlockedString(WTFMove(nativeValue)); |
| return true; |
| } |
| |
| |
| bool setJSMockContentFilterSettingsModifiedRequestURL(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSMockContentFilterSettings* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "MockContentFilterSettings", "modifiedRequestURL"); |
| } |
| auto& impl = castedThis->wrapped(); |
| auto nativeValue = value.toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| impl.setModifiedRequestURL(WTFMove(nativeValue)); |
| return true; |
| } |
| |
| |
| bool setJSMockContentFilterSettingsDecisionPoint(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSMockContentFilterSettings* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "MockContentFilterSettings", "decisionPoint"); |
| } |
| castedThis->setDecisionPoint(*state, value); |
| return true; |
| } |
| |
| |
| bool setJSMockContentFilterSettingsDecision(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSMockContentFilterSettings* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "MockContentFilterSettings", "decision"); |
| } |
| castedThis->setDecision(*state, value); |
| return true; |
| } |
| |
| |
| bool setJSMockContentFilterSettingsUnblockRequestDecision(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSMockContentFilterSettings* castedThis = jsDynamicCast<JSMockContentFilterSettings*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "MockContentFilterSettings", "unblockRequestDecision"); |
| } |
| castedThis->setUnblockRequestDecision(*state, value); |
| return true; |
| } |
| |
| |
| bool JSMockContentFilterSettingsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) |
| { |
| UNUSED_PARAM(handle); |
| UNUSED_PARAM(visitor); |
| return false; |
| } |
| |
| void JSMockContentFilterSettingsOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| { |
| auto* jsMockContentFilterSettings = jsCast<JSMockContentFilterSettings*>(handle.slot()->asCell()); |
| auto& world = *static_cast<DOMWrapperWorld*>(context); |
| uncacheWrapper(world, &jsMockContentFilterSettings->wrapped(), jsMockContentFilterSettings); |
| } |
| |
| JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<MockContentFilterSettings>&& impl) |
| { |
| #if COMPILER(CLANG) |
| // If you hit this failure the interface definition has the ImplementationLacksVTable |
| // attribute. You should remove that attribute. If the class has subclasses |
| // that may be passed through this toJS() function you should use the SkipVTableValidation |
| // attribute to MockContentFilterSettings. |
| static_assert(!__is_polymorphic(MockContentFilterSettings), "MockContentFilterSettings is polymorphic but the IDL claims it is not"); |
| #endif |
| return createWrapper<MockContentFilterSettings>(globalObject, WTFMove(impl)); |
| } |
| |
| JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, MockContentFilterSettings& impl) |
| { |
| return wrap(state, globalObject, impl); |
| } |
| |
| MockContentFilterSettings* JSMockContentFilterSettings::toWrapped(JSC::JSValue value) |
| { |
| if (auto* wrapper = jsDynamicCast<JSMockContentFilterSettings*>(value)) |
| return &wrapper->wrapped(); |
| return nullptr; |
| } |
| |
| } |
| |
| #endif // ENABLE(CONTENT_FILTERING) |