WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-154729-20160226185710.patch (text/plain), 56.27 KB, created by
youenn fablet
on 2016-02-26 09:57:28 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2016-02-26 09:57:28 PST
Size:
56.27 KB
patch
obsolete
>Subversion Revision: 197162 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index dd462a8f7c385b27fe14cc8321b99faa402a9530..a05ae01928d82c480ef19b4a7b83aedd80b3115e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,85 @@ >+2016-02-26 Youenn Fablet <youenn.fablet@crf.canon.fr> >+ >+ [Fetch API] Make FetchRequest and FetchResponse ActiveDOMObject >+ https://bugs.webkit.org/show_bug.cgi?id=154729 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Covered by existing tests. >+ >+ Making FetchRequest and FetchResponse ActiveDOMObject. >+ FetchResponse having a JSBuiltinConstructor, the binding generator is updated to support ConstructorCallWith=ScriptExecutionContext. >+ >+ * Modules/fetch/FetchRequest.cpp: >+ (WebCore::FetchRequest::create): >+ (WebCore::FetchRequest::clone): >+ (WebCore::FetchRequest::activeDOMObjectName): >+ (WebCore::FetchRequest::canSuspendForDocumentSuspension): >+ * Modules/fetch/FetchRequest.h: >+ (WebCore::FetchRequest::FetchRequest): >+ * Modules/fetch/FetchRequest.idl: >+ * Modules/fetch/FetchResponse.cpp: >+ (WebCore::FetchResponse::error): >+ (WebCore::FetchResponse::redirect): >+ (WebCore::FetchResponse::FetchResponse): >+ (WebCore::FetchResponse::clone): >+ (WebCore::FetchResponse::activeDOMObjectName): >+ (WebCore::FetchResponse::canSuspendForDocumentSuspension): >+ * Modules/fetch/FetchResponse.h: >+ (WebCore::FetchResponse::create): >+ * Modules/fetch/FetchResponse.idl: >+ * bindings/js/JSDOMConstructor.h: >+ (WebCore::JSBuiltinConstructor<JSClass>::construct): >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (GenerateConstructorDefinition): >+ * bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith.cpp: Added. >+ (WebKit::kit): >+ (WebKit::core): >+ (WebKit::wrapTestClassWithJSBuiltinConstructorAndCallWith): >+ (webkit_dom_test_class_with_js_builtin_constructor_and_call_with_finalize): >+ (webkit_dom_test_class_with_js_builtin_constructor_and_call_with_constructor): >+ (webkit_dom_test_class_with_js_builtin_constructor_and_call_with_class_init): >+ (webkit_dom_test_class_with_js_builtin_constructor_and_call_with_init): >+ * bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith.h: Added. >+ * bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate.h: Added. >+ * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructorAndCallWith.cpp: Added. >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWithPrototype::create): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWithPrototype::createStructure): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWithPrototype::JSTestClassWithJSBuiltinConstructorAndCallWithPrototype): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWithConstructor::createJSObject): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWithConstructor::prototypeForStructure): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWithConstructor::initializeProperties): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWithConstructor::initializeExecutable): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWithPrototype::finishCreation): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWith::JSTestClassWithJSBuiltinConstructorAndCallWith): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWith::createPrototype): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWith::getPrototype): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWith::destroy): >+ (WebCore::jsTestClassWithJSBuiltinConstructorAndCallWithConstructor): >+ (WebCore::setJSTestClassWithJSBuiltinConstructorAndCallWithConstructor): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWith::getConstructor): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWith::visitChildren): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWithOwner::isReachableFromOpaqueRoots): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWithOwner::finalize): >+ (WebCore::toJSNewlyCreated): >+ (WebCore::toJS): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWith::toWrapped): >+ * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructorAndCallWith.h: Added. >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWith::create): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWith::createStructure): >+ (WebCore::JSTestClassWithJSBuiltinConstructorAndCallWith::finishCreation): >+ (WebCore::wrapperOwner): >+ (WebCore::wrapperKey): >+ (WebCore::toJS): >+ * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWith.h: Added. >+ * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWith.mm: Added. >+ (-[DOMTestClassWithJSBuiltinConstructorAndCallWith dealloc]): >+ (core): >+ (kit): >+ * bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWithInternal.h: Added. >+ * bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl: >+ * bindings/scripts/test/TestClassWithJSBuiltinConstructorAndCallWith.idl: Copied from Source/WebCore/bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl. >+ > 2016-02-25 Myles C. Maxfield <mmaxfield@apple.com> > > Font size computed style is innaccurate >diff --git a/Source/WebCore/Modules/fetch/FetchRequest.cpp b/Source/WebCore/Modules/fetch/FetchRequest.cpp >index 7e0ca8dbbc13d7483c86545bc038d38b5a145b38..15700f229a155baf86933f96a9a5ba38ef3105ca 100644 >--- a/Source/WebCore/Modules/fetch/FetchRequest.cpp >+++ b/Source/WebCore/Modules/fetch/FetchRequest.cpp >@@ -266,7 +266,7 @@ RefPtr<FetchRequest> FetchRequest::create(ScriptExecutionContext& context, const > return nullptr; > } > >- return adoptRef(*new FetchRequest(WTFMove(body), headers.releaseNonNull(), WTFMove(internalRequest))); >+ return adoptRef(*new FetchRequest(WTFMove(body), headers.releaseNonNull(), WTFMove(internalRequest), context)); > } > > RefPtr<FetchRequest> FetchRequest::create(ScriptExecutionContext& context, FetchRequest* input, const Dictionary& init, ExceptionCode& ec) >@@ -297,7 +297,7 @@ RefPtr<FetchRequest> FetchRequest::create(ScriptExecutionContext& context, Fetch > return nullptr; > } > >- return adoptRef(*new FetchRequest(WTFMove(body), headers.releaseNonNull(), WTFMove(internalRequest))); >+ return adoptRef(*new FetchRequest(WTFMove(body), headers.releaseNonNull(), WTFMove(internalRequest), context)); > } > > String FetchRequest::type() const >@@ -443,7 +443,17 @@ RefPtr<FetchRequest> FetchRequest::clone(ExceptionCode& ec) > } > > // FIXME: Validate body teeing. >- return adoptRef(*new FetchRequest(FetchBody(m_body), FetchHeaders::create(m_headers.get()), FetchRequest::InternalRequest(m_internalRequest))); >+ return adoptRef(*new FetchRequest(FetchBody(m_body), FetchHeaders::create(m_headers.get()), FetchRequest::InternalRequest(m_internalRequest), *scriptExecutionContext())); >+} >+ >+const char* FetchRequest::activeDOMObjectName() const >+{ >+ return "Request"; >+} >+ >+bool FetchRequest::canSuspendForDocumentSuspension() const >+{ >+ return true; > } > > } // namespace WebCore >diff --git a/Source/WebCore/Modules/fetch/FetchRequest.h b/Source/WebCore/Modules/fetch/FetchRequest.h >index 7fa08313ce360cee4a01fcce803ad961c12761c7..2200989301fcd541546deefb298300288f201d17 100644 >--- a/Source/WebCore/Modules/fetch/FetchRequest.h >+++ b/Source/WebCore/Modules/fetch/FetchRequest.h >@@ -31,6 +31,7 @@ > > #if ENABLE(FETCH_API) > >+#include "ActiveDOMObject.h" > #include "FetchBody.h" > #include "FetchHeaders.h" > #include "FetchOptions.h" >@@ -43,7 +44,7 @@ class ScriptExecutionContext; > > typedef int ExceptionCode; > >-class FetchRequest : public RefCounted<FetchRequest> { >+class FetchRequest : public RefCounted<FetchRequest>, public ActiveDOMObject { > public: > static RefPtr<FetchRequest> create(ScriptExecutionContext&, FetchRequest*, const Dictionary&, ExceptionCode&); > static RefPtr<FetchRequest> create(ScriptExecutionContext&, const String&, const Dictionary&, ExceptionCode&); >@@ -83,15 +84,20 @@ public: > FetchBody& body() { return m_body; } > > private: >- FetchRequest(FetchBody&&, Ref<FetchHeaders>&&, InternalRequest&&); >+ FetchRequest(FetchBody&&, Ref<FetchHeaders>&&, InternalRequest&&, ScriptExecutionContext&); >+ >+ // ActiveDOMObject API. >+ const char* activeDOMObjectName() const; >+ bool canSuspendForDocumentSuspension() const; > > FetchBody m_body; > Ref<FetchHeaders> m_headers; > InternalRequest m_internalRequest; > }; > >-inline FetchRequest::FetchRequest(FetchBody&& body, Ref<FetchHeaders>&& headers, InternalRequest&& internalRequest) >- : m_body(WTFMove(body)) >+inline FetchRequest::FetchRequest(FetchBody&& body, Ref<FetchHeaders>&& headers, InternalRequest&& internalRequest, ScriptExecutionContext& context) >+ : ActiveDOMObject(&context) >+ , m_body(WTFMove(body)) > , m_headers(WTFMove(headers)) > , m_internalRequest(WTFMove(internalRequest)) > { >diff --git a/Source/WebCore/Modules/fetch/FetchRequest.idl b/Source/WebCore/Modules/fetch/FetchRequest.idl >index f4c766ccdcc07003bb2d55c5ac5f4fe41c8f1bef..d15625fc78b72de110519515463e9e44c190f7a9 100644 >--- a/Source/WebCore/Modules/fetch/FetchRequest.idl >+++ b/Source/WebCore/Modules/fetch/FetchRequest.idl >@@ -35,6 +35,7 @@ enum RequestRedirect { "follow", "error", "manual" }; > enum ReferrerPolicy { "", "no-referrer", "no-referrer-when-downgrade", "origin-only", "origin-when-cross-origin", "unsafe-url" }; > > [ >+ ActiveDOMObject, > Conditional=FETCH_API, > ConstructorCallWith=ScriptExecutionContext, > ConstructorRaisesException, >diff --git a/Source/WebCore/Modules/fetch/FetchResponse.cpp b/Source/WebCore/Modules/fetch/FetchResponse.cpp >index 4e3262f57ac55b19245a59542749f7ace5a8c689..c2af5c6f737c8d3efd40b7e7c383c2785f0fd59f 100644 >--- a/Source/WebCore/Modules/fetch/FetchResponse.cpp >+++ b/Source/WebCore/Modules/fetch/FetchResponse.cpp >@@ -48,9 +48,9 @@ static inline bool isNullBodyStatus(int status) > return status == 101 || status == 204 || status == 205 || status == 304; > } > >-Ref<FetchResponse> FetchResponse::error() >+Ref<FetchResponse> FetchResponse::error(ScriptExecutionContext* context) > { >- return adoptRef(*new FetchResponse(Type::Error, FetchBody::empty(), FetchHeaders::create(FetchHeaders::Guard::Immutable), ResourceResponse())); >+ return adoptRef(*new FetchResponse(Type::Error, FetchBody::empty(), FetchHeaders::create(FetchHeaders::Guard::Immutable), ResourceResponse(), *context)); > } > > RefPtr<FetchResponse> FetchResponse::redirect(ScriptExecutionContext* context, const String& url, int status, ExceptionCode& ec) >@@ -65,7 +65,7 @@ RefPtr<FetchResponse> FetchResponse::redirect(ScriptExecutionContext* context, c > ec = TypeError; > return nullptr; > } >- RefPtr<FetchResponse> redirectResponse = adoptRef(*new FetchResponse(Type::Default, FetchBody::empty(), FetchHeaders::create(FetchHeaders::Guard::Immutable), ResourceResponse())); >+ RefPtr<FetchResponse> redirectResponse = adoptRef(*new FetchResponse(Type::Default, FetchBody::empty(), FetchHeaders::create(FetchHeaders::Guard::Immutable), ResourceResponse(), *context)); > redirectResponse->m_response.setHTTPStatusCode(status); > redirectResponse->m_headers->fastSet(HTTPHeaderName::Location, requestURL.string()); > return redirectResponse; >@@ -108,8 +108,9 @@ void FetchResponse::initializeWith(const Dictionary& init, ExceptionCode& ec) > } > } > >-FetchResponse::FetchResponse(Type type, FetchBody&& body, Ref<FetchHeaders>&& headers, ResourceResponse&& response) >- : m_type(type) >+FetchResponse::FetchResponse(Type type, FetchBody&& body, Ref<FetchHeaders>&& headers, ResourceResponse&& response, ScriptExecutionContext& context) >+ : ActiveDOMObject(&context) >+ , m_type(type) > , m_response(WTFMove(response)) > , m_body(WTFMove(body)) > , m_headers(WTFMove(headers)) >@@ -122,7 +123,7 @@ RefPtr<FetchResponse> FetchResponse::clone(ExceptionCode& ec) > ec = TypeError; > return nullptr; > } >- RefPtr<FetchResponse> cloned = adoptRef(*new FetchResponse(m_type, FetchBody(m_body), FetchHeaders::create(headers()), ResourceResponse(m_response))); >+ RefPtr<FetchResponse> cloned = adoptRef(*new FetchResponse(m_type, FetchBody(m_body), FetchHeaders::create(headers()), ResourceResponse(m_response), *scriptExecutionContext())); > cloned->m_isRedirected = m_isRedirected; > return cloned; > } >@@ -153,6 +154,16 @@ JSC::JSValue JSFetchResponse::body(JSC::ExecState&) const > return JSC::jsNull(); > } > >+const char* FetchResponse::activeDOMObjectName() const >+{ >+ return "Response"; >+} >+ >+bool FetchResponse::canSuspendForDocumentSuspension() const >+{ >+ return true; >+} >+ > } // namespace WebCore > > #endif // ENABLE(FETCH_API) >diff --git a/Source/WebCore/Modules/fetch/FetchResponse.h b/Source/WebCore/Modules/fetch/FetchResponse.h >index 01692ef3b17238040ad08dd782013b24cd64e56c..502b1f0fdd9a3ee3857eed342fcf2c31b2ffedf2 100644 >--- a/Source/WebCore/Modules/fetch/FetchResponse.h >+++ b/Source/WebCore/Modules/fetch/FetchResponse.h >@@ -31,6 +31,7 @@ > > #if ENABLE(FETCH_API) > >+#include "ActiveDOMObject.h" > #include "FetchBody.h" > #include "FetchHeaders.h" > #include "ResourceResponse.h" >@@ -45,10 +46,10 @@ class Dictionary; > > typedef int ExceptionCode; > >-class FetchResponse : public RefCounted<FetchResponse> { >+class FetchResponse : public RefCounted<FetchResponse>, public ActiveDOMObject { > public: >- static Ref<FetchResponse> create() { return adoptRef(*new FetchResponse(Type::Default, FetchBody::empty(), FetchHeaders::create(FetchHeaders::Guard::Response), ResourceResponse())); } >- static Ref<FetchResponse> error(); >+ static Ref<FetchResponse> create(ScriptExecutionContext& context) { return adoptRef(*new FetchResponse(Type::Default, FetchBody::empty(), FetchHeaders::create(FetchHeaders::Guard::Response), ResourceResponse(), context)); } >+ static Ref<FetchResponse> error(ScriptExecutionContext*); > static RefPtr<FetchResponse> redirect(ScriptExecutionContext*, const String&, int, ExceptionCode&); > // FIXME: Binding generator should not require below method to handle optional status parameter. > static RefPtr<FetchResponse> redirect(ScriptExecutionContext* context, const String& url, ExceptionCode& ec) { return redirect(context, url, 302, ec); } >@@ -76,7 +77,11 @@ public: > private: > enum class Type { Basic, Cors, Default, Error, Opaque, OpaqueRedirect }; > >- FetchResponse(Type, FetchBody&&, Ref<FetchHeaders>&&, ResourceResponse&&); >+ FetchResponse(Type, FetchBody&&, Ref<FetchHeaders>&&, ResourceResponse&&, ScriptExecutionContext&); >+ >+ // ActiveDOMObject API. >+ const char* activeDOMObjectName() const; >+ bool canSuspendForDocumentSuspension() const; > > Type m_type; > ResourceResponse m_response; >diff --git a/Source/WebCore/Modules/fetch/FetchResponse.idl b/Source/WebCore/Modules/fetch/FetchResponse.idl >index e70f4b91d05a5c83d2fd0fcc06d39048cec9706f..011df8f6d44910a9c9e4807c3447bf47cf8e9f3f 100644 >--- a/Source/WebCore/Modules/fetch/FetchResponse.idl >+++ b/Source/WebCore/Modules/fetch/FetchResponse.idl >@@ -28,7 +28,9 @@ > enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredirect" }; > > [ >+ ActiveDOMObject, > Conditional=FETCH_API, >+ ConstructorCallWith=ScriptExecutionContext, > GlobalContext=DOMWindow&WorkerGlobalScope, > ImplementationLacksVTable, > InterfaceName=Response, >@@ -36,7 +38,7 @@ enum ResponseType { "basic", "cors", "default", "error", "opaque", "opaqueredire > ] > interface FetchResponse { > // FIXME: NewObject does not seem to be supported for static methods. >- static FetchResponse error(); >+ [CallWith=ScriptExecutionContext] static FetchResponse error(); > [RaisesException, CallWith=ScriptExecutionContext] static FetchResponse redirect(DOMString url, optional unsigned short status = 302); > > readonly attribute ResponseType type; >diff --git a/Source/WebCore/bindings/js/JSDOMConstructor.h b/Source/WebCore/bindings/js/JSDOMConstructor.h >index eb5dfff681535dd8d73f4b16b6bc1a73c7675f70..6fdd7e486f37dd73130248fa0c59d76f5a40b129 100644 >--- a/Source/WebCore/bindings/js/JSDOMConstructor.h >+++ b/Source/WebCore/bindings/js/JSDOMConstructor.h >@@ -220,6 +220,8 @@ template<typename JSClass> inline JSC::EncodedJSValue JSC_HOST_CALL JSBuiltinCon > { > auto* castedThis = JSC::jsCast<JSBuiltinConstructor*>(state->callee()); > auto* object = castedThis->createJSObject(); >+ if (!object) >+ return throwConstructorDocumentUnavailableError(*state, info()->className); > callFunctionWithCurrentArguments(*state, *object, *castedThis->initializeFunction()); > return JSC::JSValue::encode(object); > } >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index 2bf818758e0495486d46027e8e4ef5bb15807818..f1aa252e0a153a47f4a3da6df59ffd0c4d17fe45 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -4783,11 +4783,24 @@ sub GenerateConstructorDefinition > > if (IsJSBuiltinConstructor($interface)) { > if ($interface->extendedAttributes->{"JSBuiltinConstructor"}) { >- # FIXME: Add support for ConstructorCallWith >+ # FIXME: Add support for other ConstructorCallWith. > push(@$outputArray, <<END); > template<> JSC::JSObject* ${className}Constructor::createJSObject() > { >+END >+ if ($codeGenerator->ExtendedAttributeContains($interface->extendedAttributes->{"ConstructorCallWith"}, "ScriptExecutionContext")) { >+ push(@$outputArray, <<END); >+ ScriptExecutionContext* context = scriptExecutionContext(); >+ if (!context) >+ return nullptr; >+ return ${className}::create(getDOMStructure<${className}>(globalObject()->vm(), *globalObject()), globalObject(), ${interfaceName}::create(*context)); >+END >+ } else { >+ push(@$outputArray, <<END); > return ${className}::create(getDOMStructure<${className}>(globalObject()->vm(), *globalObject()), globalObject(), ${interfaceName}::create()); >+END >+ } >+ push(@$outputArray, <<END); > } > > END >diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..ec08e3169437bf1906a19051b6083d2c9c88acc9 >--- /dev/null >+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith.cpp >@@ -0,0 +1,104 @@ >+/* >+ * 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" >+#include "WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith.h" >+ >+#include "CSSImportRule.h" >+#include "DOMObjectCache.h" >+#include "Document.h" >+#include "ExceptionCode.h" >+#include "ExceptionCodeDescription.h" >+#include "JSMainThreadExecState.h" >+#include "WebKitDOMPrivate.h" >+#include "WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate.h" >+#include "gobject/ConvertToUTF8String.h" >+#include <wtf/GetPtr.h> >+#include <wtf/RefPtr.h> >+ >+#define WEBKIT_DOM_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH_GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE(obj, WEBKIT_DOM_TYPE_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH, WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate) >+ >+typedef struct _WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate { >+ RefPtr<WebCore::TestClassWithJSBuiltinConstructorAndCallWith> coreObject; >+} WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate; >+ >+namespace WebKit { >+ >+WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith* kit(WebCore::TestClassWithJSBuiltinConstructorAndCallWith* obj) >+{ >+ if (!obj) >+ return 0; >+ >+ if (gpointer ret = DOMObjectCache::get(obj)) >+ return WEBKIT_DOM_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH(ret); >+ >+ return wrapTestClassWithJSBuiltinConstructorAndCallWith(obj); >+} >+ >+WebCore::TestClassWithJSBuiltinConstructorAndCallWith* core(WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith* request) >+{ >+ return request ? static_cast<WebCore::TestClassWithJSBuiltinConstructorAndCallWith*>(WEBKIT_DOM_OBJECT(request)->coreObject) : 0; >+} >+ >+WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith* wrapTestClassWithJSBuiltinConstructorAndCallWith(WebCore::TestClassWithJSBuiltinConstructorAndCallWith* coreObject) >+{ >+ ASSERT(coreObject); >+ return WEBKIT_DOM_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH(g_object_new(WEBKIT_DOM_TYPE_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH, "core-object", coreObject, nullptr)); >+} >+ >+} // namespace WebKit >+ >+G_DEFINE_TYPE(WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith, webkit_dom_test_class_with_js_builtin_constructor_and_call_with, WEBKIT_DOM_TYPE_OBJECT) >+ >+static void webkit_dom_test_class_with_js_builtin_constructor_and_call_with_finalize(GObject* object) >+{ >+ WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate* priv = WEBKIT_DOM_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH_GET_PRIVATE(object); >+ >+ WebKit::DOMObjectCache::forget(priv->coreObject.get()); >+ >+ priv->~WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate(); >+ G_OBJECT_CLASS(webkit_dom_test_class_with_js_builtin_constructor_and_call_with_parent_class)->finalize(object); >+} >+ >+static GObject* webkit_dom_test_class_with_js_builtin_constructor_and_call_with_constructor(GType type, guint constructPropertiesCount, GObjectConstructParam* constructProperties) >+{ >+ GObject* object = G_OBJECT_CLASS(webkit_dom_test_class_with_js_builtin_constructor_and_call_with_parent_class)->constructor(type, constructPropertiesCount, constructProperties); >+ >+ WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate* priv = WEBKIT_DOM_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH_GET_PRIVATE(object); >+ priv->coreObject = static_cast<WebCore::TestClassWithJSBuiltinConstructorAndCallWith*>(WEBKIT_DOM_OBJECT(object)->coreObject); >+ WebKit::DOMObjectCache::put(priv->coreObject.get(), object); >+ >+ return object; >+} >+ >+static void webkit_dom_test_class_with_js_builtin_constructor_and_call_with_class_init(WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithClass* requestClass) >+{ >+ GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass); >+ g_type_class_add_private(gobjectClass, sizeof(WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate)); >+ gobjectClass->constructor = webkit_dom_test_class_with_js_builtin_constructor_and_call_with_constructor; >+ gobjectClass->finalize = webkit_dom_test_class_with_js_builtin_constructor_and_call_with_finalize; >+} >+ >+static void webkit_dom_test_class_with_js_builtin_constructor_and_call_with_init(WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith* request) >+{ >+ WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate* priv = WEBKIT_DOM_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH_GET_PRIVATE(request); >+ new (priv) WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate(); >+} >+ >diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith.h >new file mode 100644 >index 0000000000000000000000000000000000000000..cf52a8711c42088a6b2457f991e0d3d5d1f60a14 >--- /dev/null >+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith.h >@@ -0,0 +1,53 @@ >+/* >+ * 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. >+ */ >+ >+#ifndef WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith_h >+#define WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith_h >+ >+#ifdef WEBKIT_DOM_USE_UNSTABLE_API >+ >+#include <glib-object.h> >+#include <webkitdom/WebKitDOMObject.h> >+#include <webkitdom/webkitdomdefines-unstable.h> >+ >+G_BEGIN_DECLS >+ >+#define WEBKIT_DOM_TYPE_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH (webkit_dom_test_class_with_js_builtin_constructor_and_call_with_get_type()) >+#define WEBKIT_DOM_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_DOM_TYPE_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH, WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith)) >+#define WEBKIT_DOM_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_DOM_TYPE_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH, WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithClass) >+#define WEBKIT_DOM_IS_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_DOM_TYPE_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH)) >+#define WEBKIT_DOM_IS_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_DOM_TYPE_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH)) >+#define WEBKIT_DOM_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_DOM_TYPE_TEST_CLASS_WITH_JS_BUILTIN_CONSTRUCTOR_AND_CALL_WITH, WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithClass)) >+ >+struct _WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith { >+ WebKitDOMObject parent_instance; >+}; >+ >+struct _WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithClass { >+ WebKitDOMObjectClass parent_class; >+}; >+ >+WEBKIT_API GType >+webkit_dom_test_class_with_js_builtin_constructor_and_call_with_get_type(void); >+ >+G_END_DECLS >+ >+#endif /* WEBKIT_DOM_USE_UNSTABLE_API */ >+#endif /* WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith_h */ >diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate.h >new file mode 100644 >index 0000000000000000000000000000000000000000..44c74cb0d2802a9bae7c50481292bf4bcf06bc04 >--- /dev/null >+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate.h >@@ -0,0 +1,33 @@ >+/* >+ * 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. >+ */ >+ >+#ifndef WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate_h >+#define WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate_h >+ >+#include "TestClassWithJSBuiltinConstructorAndCallWith.h" >+#include <webkitdom/WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith.h> >+ >+namespace WebKit { >+WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith* wrapTestClassWithJSBuiltinConstructorAndCallWith(WebCore::TestClassWithJSBuiltinConstructorAndCallWith*); >+WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith* kit(WebCore::TestClassWithJSBuiltinConstructorAndCallWith*); >+WebCore::TestClassWithJSBuiltinConstructorAndCallWith* core(WebKitDOMTestClassWithJSBuiltinConstructorAndCallWith*); >+} // namespace WebKit >+ >+#endif /* WebKitDOMTestClassWithJSBuiltinConstructorAndCallWithPrivate_h */ >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructorAndCallWith.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructorAndCallWith.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..e9a44edf992f670af256ead90fc54dafbe7efd66 >--- /dev/null >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructorAndCallWith.cpp >@@ -0,0 +1,229 @@ >+/* >+ 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" >+#include "JSTestClassWithJSBuiltinConstructorAndCallWith.h" >+ >+#include "JSDOMBinding.h" >+#include "JSDOMConstructor.h" >+#include "TestClassWithJSBuiltinConstructorAndCallWithBuiltins.h" >+#include <runtime/FunctionPrototype.h> >+#include <wtf/GetPtr.h> >+ >+using namespace JSC; >+ >+namespace WebCore { >+ >+// Attributes >+ >+JSC::EncodedJSValue jsTestClassWithJSBuiltinConstructorAndCallWithConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); >+void setJSTestClassWithJSBuiltinConstructorAndCallWithConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); >+ >+class JSTestClassWithJSBuiltinConstructorAndCallWithPrototype : public JSC::JSNonFinalObject { >+public: >+ typedef JSC::JSNonFinalObject Base; >+ static JSTestClassWithJSBuiltinConstructorAndCallWithPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) >+ { >+ JSTestClassWithJSBuiltinConstructorAndCallWithPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestClassWithJSBuiltinConstructorAndCallWithPrototype>(vm.heap)) JSTestClassWithJSBuiltinConstructorAndCallWithPrototype(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: >+ JSTestClassWithJSBuiltinConstructorAndCallWithPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) >+ : JSC::JSNonFinalObject(vm, structure) >+ { >+ } >+ >+ void finishCreation(JSC::VM&); >+}; >+ >+typedef JSBuiltinConstructor<JSTestClassWithJSBuiltinConstructorAndCallWith> JSTestClassWithJSBuiltinConstructorAndCallWithConstructor; >+ >+template<> JSC::JSObject* JSTestClassWithJSBuiltinConstructorAndCallWithConstructor::createJSObject() >+{ >+ ScriptExecutionContext* context = scriptExecutionContext(); >+ if (!context) >+ return nullptr; >+ return JSTestClassWithJSBuiltinConstructorAndCallWith::create(getDOMStructure<JSTestClassWithJSBuiltinConstructorAndCallWith>(globalObject()->vm(), *globalObject()), globalObject(), TestClassWithJSBuiltinConstructorAndCallWith::create(*context)); >+} >+ >+template<> JSValue JSTestClassWithJSBuiltinConstructorAndCallWithConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) >+{ >+ UNUSED_PARAM(vm); >+ return globalObject.functionPrototype(); >+} >+ >+template<> void JSTestClassWithJSBuiltinConstructorAndCallWithConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) >+{ >+ putDirect(vm, vm.propertyNames->prototype, JSTestClassWithJSBuiltinConstructorAndCallWith::getPrototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum); >+ putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestClassWithJSBuiltinConstructorAndCallWith"))), ReadOnly | DontEnum); >+ putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum); >+} >+ >+template<> FunctionExecutable* JSTestClassWithJSBuiltinConstructorAndCallWithConstructor::initializeExecutable(VM& vm) >+{ >+ return testClassWithJSBuiltinConstructorAndCallWithInitializeTestClassWithJSBuiltinConstructorAndCallWithCodeGenerator(vm); >+} >+ >+template<> const ClassInfo JSTestClassWithJSBuiltinConstructorAndCallWithConstructor::s_info = { "TestClassWithJSBuiltinConstructorAndCallWith", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestClassWithJSBuiltinConstructorAndCallWithConstructor) }; >+ >+/* Hash table for prototype */ >+ >+static const HashTableValue JSTestClassWithJSBuiltinConstructorAndCallWithPrototypeTableValues[] = >+{ >+ { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestClassWithJSBuiltinConstructorAndCallWithConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestClassWithJSBuiltinConstructorAndCallWithConstructor) } }, >+}; >+ >+const ClassInfo JSTestClassWithJSBuiltinConstructorAndCallWithPrototype::s_info = { "TestClassWithJSBuiltinConstructorAndCallWithPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestClassWithJSBuiltinConstructorAndCallWithPrototype) }; >+ >+void JSTestClassWithJSBuiltinConstructorAndCallWithPrototype::finishCreation(VM& vm) >+{ >+ Base::finishCreation(vm); >+ reifyStaticProperties(vm, JSTestClassWithJSBuiltinConstructorAndCallWithPrototypeTableValues, *this); >+} >+ >+const ClassInfo JSTestClassWithJSBuiltinConstructorAndCallWith::s_info = { "TestClassWithJSBuiltinConstructorAndCallWith", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestClassWithJSBuiltinConstructorAndCallWith) }; >+ >+JSTestClassWithJSBuiltinConstructorAndCallWith::JSTestClassWithJSBuiltinConstructorAndCallWith(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestClassWithJSBuiltinConstructorAndCallWith>&& impl) >+ : JSDOMWrapper<TestClassWithJSBuiltinConstructorAndCallWith>(structure, globalObject, WTFMove(impl)) >+{ >+} >+ >+JSObject* JSTestClassWithJSBuiltinConstructorAndCallWith::createPrototype(VM& vm, JSGlobalObject* globalObject) >+{ >+ return JSTestClassWithJSBuiltinConstructorAndCallWithPrototype::create(vm, globalObject, JSTestClassWithJSBuiltinConstructorAndCallWithPrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); >+} >+ >+JSObject* JSTestClassWithJSBuiltinConstructorAndCallWith::getPrototype(VM& vm, JSGlobalObject* globalObject) >+{ >+ return getDOMPrototype<JSTestClassWithJSBuiltinConstructorAndCallWith>(vm, globalObject); >+} >+ >+void JSTestClassWithJSBuiltinConstructorAndCallWith::destroy(JSC::JSCell* cell) >+{ >+ JSTestClassWithJSBuiltinConstructorAndCallWith* thisObject = static_cast<JSTestClassWithJSBuiltinConstructorAndCallWith*>(cell); >+ thisObject->JSTestClassWithJSBuiltinConstructorAndCallWith::~JSTestClassWithJSBuiltinConstructorAndCallWith(); >+} >+ >+EncodedJSValue jsTestClassWithJSBuiltinConstructorAndCallWithConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) >+{ >+ JSTestClassWithJSBuiltinConstructorAndCallWithPrototype* domObject = jsDynamicCast<JSTestClassWithJSBuiltinConstructorAndCallWithPrototype*>(JSValue::decode(thisValue)); >+ if (!domObject) >+ return throwVMTypeError(state); >+ return JSValue::encode(JSTestClassWithJSBuiltinConstructorAndCallWith::getConstructor(state->vm(), domObject->globalObject())); >+} >+ >+void setJSTestClassWithJSBuiltinConstructorAndCallWithConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) >+{ >+ JSValue value = JSValue::decode(encodedValue); >+ JSTestClassWithJSBuiltinConstructorAndCallWithPrototype* domObject = jsDynamicCast<JSTestClassWithJSBuiltinConstructorAndCallWithPrototype*>(JSValue::decode(thisValue)); >+ if (UNLIKELY(!domObject)) { >+ throwVMTypeError(state); >+ return; >+ } >+ // Shadowing a built-in constructor >+ domObject->putDirect(state->vm(), state->propertyNames().constructor, value); >+} >+ >+JSValue JSTestClassWithJSBuiltinConstructorAndCallWith::getConstructor(VM& vm, const JSGlobalObject* globalObject) >+{ >+ return getDOMConstructor<JSTestClassWithJSBuiltinConstructorAndCallWithConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); >+} >+ >+void JSTestClassWithJSBuiltinConstructorAndCallWith::visitChildren(JSCell* cell, SlotVisitor& visitor) >+{ >+ auto* thisObject = jsCast<JSTestClassWithJSBuiltinConstructorAndCallWith*>(cell); >+ ASSERT_GC_OBJECT_INHERITS(thisObject, info()); >+ Base::visitChildren(thisObject, visitor); >+} >+ >+bool JSTestClassWithJSBuiltinConstructorAndCallWithOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) >+{ >+ UNUSED_PARAM(handle); >+ UNUSED_PARAM(visitor); >+ return false; >+} >+ >+void JSTestClassWithJSBuiltinConstructorAndCallWithOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) >+{ >+ auto* jsTestClassWithJSBuiltinConstructorAndCallWith = jsCast<JSTestClassWithJSBuiltinConstructorAndCallWith*>(handle.slot()->asCell()); >+ auto& world = *static_cast<DOMWrapperWorld*>(context); >+ uncacheWrapper(world, &jsTestClassWithJSBuiltinConstructorAndCallWith->wrapped(), jsTestClassWithJSBuiltinConstructorAndCallWith); >+} >+ >+#if ENABLE(BINDING_INTEGRITY) >+#if PLATFORM(WIN) >+#pragma warning(disable: 4483) >+extern "C" { extern void (*const __identifier("??_7TestClassWithJSBuiltinConstructorAndCallWith@WebCore@@6B@")[])(); } >+#else >+extern "C" { extern void* _ZTVN7WebCore44TestClassWithJSBuiltinConstructorAndCallWithE[]; } >+#endif >+#endif >+ >+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestClassWithJSBuiltinConstructorAndCallWith* impl) >+{ >+ if (!impl) >+ return jsNull(); >+ return createNewWrapper<JSTestClassWithJSBuiltinConstructorAndCallWith>(globalObject, impl); >+} >+ >+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestClassWithJSBuiltinConstructorAndCallWith* impl) >+{ >+ if (!impl) >+ return jsNull(); >+ if (JSValue result = getExistingWrapper<JSTestClassWithJSBuiltinConstructorAndCallWith>(globalObject, impl)) >+ return result; >+ >+#if ENABLE(BINDING_INTEGRITY) >+ void* actualVTablePointer = *(reinterpret_cast<void**>(impl)); >+#if PLATFORM(WIN) >+ void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestClassWithJSBuiltinConstructorAndCallWith@WebCore@@6B@")); >+#else >+ void* expectedVTablePointer = &_ZTVN7WebCore44TestClassWithJSBuiltinConstructorAndCallWithE[2]; >+#if COMPILER(CLANG) >+ // If this fails TestClassWithJSBuiltinConstructorAndCallWith does not have a vtable, so you need to add the >+ // ImplementationLacksVTable attribute to the interface definition >+ COMPILE_ASSERT(__is_polymorphic(TestClassWithJSBuiltinConstructorAndCallWith), TestClassWithJSBuiltinConstructorAndCallWith_is_not_polymorphic); >+#endif >+#endif >+ // If you hit this assertion you either have a use after free bug, or >+ // TestClassWithJSBuiltinConstructorAndCallWith has subclasses. If TestClassWithJSBuiltinConstructorAndCallWith has subclasses that get passed >+ // to toJS() we currently require TestClassWithJSBuiltinConstructorAndCallWith you to opt out of binding hardening >+ // by adding the SkipVTableValidation attribute to the interface IDL definition >+ RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); >+#endif >+ return createNewWrapper<JSTestClassWithJSBuiltinConstructorAndCallWith>(globalObject, impl); >+} >+ >+TestClassWithJSBuiltinConstructorAndCallWith* JSTestClassWithJSBuiltinConstructorAndCallWith::toWrapped(JSC::JSValue value) >+{ >+ if (auto* wrapper = jsDynamicCast<JSTestClassWithJSBuiltinConstructorAndCallWith*>(value)) >+ return &wrapper->wrapped(); >+ return nullptr; >+} >+ >+} >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructorAndCallWith.h b/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructorAndCallWith.h >new file mode 100644 >index 0000000000000000000000000000000000000000..4f2fd8786e74ab7a97a66fe1cb753d28ec8df851 >--- /dev/null >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructorAndCallWith.h >@@ -0,0 +1,92 @@ >+/* >+ 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. >+*/ >+ >+#ifndef JSTestClassWithJSBuiltinConstructorAndCallWith_h >+#define JSTestClassWithJSBuiltinConstructorAndCallWith_h >+ >+#include "JSDOMWrapper.h" >+#include "TestClassWithJSBuiltinConstructorAndCallWith.h" >+#include <wtf/NeverDestroyed.h> >+ >+namespace WebCore { >+ >+class JSTestClassWithJSBuiltinConstructorAndCallWith : public JSDOMWrapper<TestClassWithJSBuiltinConstructorAndCallWith> { >+public: >+ typedef JSDOMWrapper<TestClassWithJSBuiltinConstructorAndCallWith> Base; >+ static JSTestClassWithJSBuiltinConstructorAndCallWith* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestClassWithJSBuiltinConstructorAndCallWith>&& impl) >+ { >+ JSTestClassWithJSBuiltinConstructorAndCallWith* ptr = new (NotNull, JSC::allocateCell<JSTestClassWithJSBuiltinConstructorAndCallWith>(globalObject->vm().heap)) JSTestClassWithJSBuiltinConstructorAndCallWith(structure, *globalObject, WTFMove(impl)); >+ ptr->finishCreation(globalObject->vm()); >+ return ptr; >+ } >+ >+ static const bool hasStaticPropertyTable = false; >+ >+ static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*); >+ static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*); >+ static TestClassWithJSBuiltinConstructorAndCallWith* toWrapped(JSC::JSValue); >+ static void destroy(JSC::JSCell*); >+ >+ 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 JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); >+ static void visitChildren(JSCell*, JSC::SlotVisitor&); >+ >+protected: >+ JSTestClassWithJSBuiltinConstructorAndCallWith(JSC::Structure*, JSDOMGlobalObject&, Ref<TestClassWithJSBuiltinConstructorAndCallWith>&&); >+ >+ void finishCreation(JSC::VM& vm) >+ { >+ Base::finishCreation(vm); >+ ASSERT(inherits(info())); >+ } >+ >+}; >+ >+class JSTestClassWithJSBuiltinConstructorAndCallWithOwner : public JSC::WeakHandleOwner { >+public: >+ virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&); >+ virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); >+}; >+ >+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestClassWithJSBuiltinConstructorAndCallWith*) >+{ >+ static NeverDestroyed<JSTestClassWithJSBuiltinConstructorAndCallWithOwner> owner; >+ return &owner.get(); >+} >+ >+inline void* wrapperKey(TestClassWithJSBuiltinConstructorAndCallWith* wrappableObject) >+{ >+ return wrappableObject; >+} >+ >+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestClassWithJSBuiltinConstructorAndCallWith*); >+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestClassWithJSBuiltinConstructorAndCallWith& impl) { return toJS(state, globalObject, &impl); } >+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestClassWithJSBuiltinConstructorAndCallWith*); >+ >+ >+} // namespace WebCore >+ >+#endif >diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWith.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWith.h >new file mode 100644 >index 0000000000000000000000000000000000000000..3dd31e55495aec33ba81c2107915b08b50bf8eb4 >--- /dev/null >+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWith.h >@@ -0,0 +1,31 @@ >+/* >+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. >+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import <WebCore/DOMObject.h> >+ >+WEBKIT_CLASS_AVAILABLE_MAC(9876_5) >+WEBCORE_EXPORT @interface DOMTestClassWithJSBuiltinConstructorAndCallWith : DOMObject >+@end >diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWith.mm b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWith.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..7ddacb7b9e90c5113508f1650ebf28d3bbd12afb >--- /dev/null >+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWith.mm >@@ -0,0 +1,75 @@ >+/* >+ * This file is part of the WebKit open source project. >+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY! >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "DOMInternal.h" >+ >+#import "DOMTestClassWithJSBuiltinConstructorAndCallWith.h" >+ >+#import "DOMNodeInternal.h" >+#import "DOMTestClassWithJSBuiltinConstructorAndCallWithInternal.h" >+#import "ExceptionHandlers.h" >+#import "JSMainThreadExecState.h" >+#import "TestClassWithJSBuiltinConstructorAndCallWith.h" >+#import "ThreadCheck.h" >+#import "WebCoreObjCExtras.h" >+#import "WebScriptObjectPrivate.h" >+#import <wtf/GetPtr.h> >+ >+#define IMPL reinterpret_cast<WebCore::TestClassWithJSBuiltinConstructorAndCallWith*>(_internal) >+ >+@implementation DOMTestClassWithJSBuiltinConstructorAndCallWith >+ >+- (void)dealloc >+{ >+ if (WebCoreObjCScheduleDeallocateOnMainThread([DOMTestClassWithJSBuiltinConstructorAndCallWith class], self)) >+ return; >+ >+ if (_internal) >+ IMPL->deref(); >+ [super dealloc]; >+} >+ >+@end >+ >+WebCore::TestClassWithJSBuiltinConstructorAndCallWith* core(DOMTestClassWithJSBuiltinConstructorAndCallWith *wrapper) >+{ >+ return wrapper ? reinterpret_cast<WebCore::TestClassWithJSBuiltinConstructorAndCallWith*>(wrapper->_internal) : 0; >+} >+ >+DOMTestClassWithJSBuiltinConstructorAndCallWith *kit(WebCore::TestClassWithJSBuiltinConstructorAndCallWith* value) >+{ >+ WebCoreThreadViolationCheckRoundOne(); >+ if (!value) >+ return nil; >+ if (DOMTestClassWithJSBuiltinConstructorAndCallWith *wrapper = getDOMWrapper(value)) >+ return [[wrapper retain] autorelease]; >+ DOMTestClassWithJSBuiltinConstructorAndCallWith *wrapper = [[DOMTestClassWithJSBuiltinConstructorAndCallWith alloc] _init]; >+ wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(value); >+ value->ref(); >+ addDOMWrapper(wrapper, value); >+ return [wrapper autorelease]; >+} >diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWithInternal.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWithInternal.h >new file mode 100644 >index 0000000000000000000000000000000000000000..c7ca709006ab5400b4f089d384a290a44254e7a3 >--- /dev/null >+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestClassWithJSBuiltinConstructorAndCallWithInternal.h >@@ -0,0 +1,34 @@ >+/* >+ * This file is part of the WebKit open source project. >+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY! >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import <WebCore/DOMTestClassWithJSBuiltinConstructorAndCallWith.h> >+ >+namespace WebCore { >+class TestClassWithJSBuiltinConstructorAndCallWith; >+} >+ >+WEBCORE_EXPORT WebCore::TestClassWithJSBuiltinConstructorAndCallWith* core(DOMTestClassWithJSBuiltinConstructorAndCallWith *); >+WEBCORE_EXPORT DOMTestClassWithJSBuiltinConstructorAndCallWith *kit(WebCore::TestClassWithJSBuiltinConstructorAndCallWith*); >diff --git a/Source/WebCore/bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl b/Source/WebCore/bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl >index f7703e692ea1dd1834535c2690bff68e054805d8..ad8696c11c0ff279b9b5911e84b633e7fdda0c7d 100644 >--- a/Source/WebCore/bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl >+++ b/Source/WebCore/bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl >@@ -27,6 +27,7 @@ > */ > > [ >+ ConstructorCallWith=ScriptExecutionContext, > JSBuiltinConstructor >-] interface TestClassWithJSBuiltinConstructor { >+] interface TestClassWithJSBuiltinConstructorAndCallWith { > }; >diff --git a/Source/WebCore/bindings/scripts/test/TestClassWithJSBuiltinConstructorAndCallWith.idl b/Source/WebCore/bindings/scripts/test/TestClassWithJSBuiltinConstructorAndCallWith.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..f7703e692ea1dd1834535c2690bff68e054805d8 >--- /dev/null >+++ b/Source/WebCore/bindings/scripts/test/TestClassWithJSBuiltinConstructorAndCallWith.idl >@@ -0,0 +1,32 @@ >+/* >+ * Copyright (C) 2015 Canon Inc. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted, provided that the following conditions >+ * are required to be met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Canon Inc. nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR >+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+[ >+ JSBuiltinConstructor >+] interface TestClassWithJSBuiltinConstructor { >+};
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 154729
:
272331
|
272498
|
272740
|
273007
|
273162
|
273279