WebKitDOMTestCallback* kit(WebCore::TestCallback* obj) { if (!obj) return 0; if (gpointer ret = DOMObjectCache::get(obj)) return WEBKIT_DOM_TEST_CALLBACK(ret); return wrapTestCallback(obj); }
WebKitDOMTestCallback* wrapTestCallback(WebCore::TestCallback* coreObject) { g_return_val_if_fail(coreObject, 0); // We call ref() rather than using a C++ smart pointer because we can't store a C++ object // in a C-allocated GObject structure. See the finalize() code for the matching deref(). coreObject->ref(); return WEBKIT_DOM_TEST_CALLBACK(g_object_new(WEBKIT_TYPE_DOM_TEST_CALLBACK, "core-object", coreObject, NULL)); }
WebKitDOMTestCallback* wrapTestCallback(WebCore::TestCallback* coreObject) { g_return_val_if_fail(coreObject != 0, 0); WebKitDOMTestCallback* wrapper = WEBKIT_DOM_TEST_CALLBACK(g_object_new(WEBKIT_TYPE_DOM_TEST_CALLBACK, NULL)); g_return_val_if_fail(wrapper != 0, 0); /* We call ref() rather than using a C++ smart pointer because we can't store a C++ object * in a C-allocated GObject structure. See the finalize() code for the * matching deref(). */ coreObject->ref(); WEBKIT_DOM_OBJECT(wrapper)->coreObject = coreObject; return wrapper; }
WebKitDOMTestCallback* wrapTestCallback(WebCore::TestCallback* coreObject) { ASSERT(coreObject); return WEBKIT_DOM_TEST_CALLBACK(g_object_new(WEBKIT_TYPE_DOM_TEST_CALLBACK, "core-object", coreObject, NULL)); }