From: sung-su.kim Date: Tue, 2 Jul 2013 11:09:32 +0000 (+0900) Subject: [Release] wrt-plugins-common_0.3.101 X-Git-Tag: submit/tizen_2.2/20130702.112950^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=inline;h=f2ef13f32103d9f8afef174fbe80113d9123ee42;p=platform%2Fframework%2Fweb%2Fwrt-plugins-common.git [Release] wrt-plugins-common_0.3.101 Change-Id: I4ced7e9cc5cc479dca99d983a67d052b6bd0ef2c --- diff --git a/packaging/wrt-plugins-common.spec b/packaging/wrt-plugins-common.spec index 1893366..8722ef0 100644 --- a/packaging/wrt-plugins-common.spec +++ b/packaging/wrt-plugins-common.spec @@ -1,7 +1,7 @@ #git:framework/web/wrt-plugins-common Name: wrt-plugins-common Summary: wrt-plugins common library -Version: 0.3.99 +Version: 0.3.101 Release: 1 Group: Development/Libraries License: Apache License, Version 2.0 diff --git a/src/standards/W3C/Widget/CMakeLists.txt b/src/standards/W3C/Widget/CMakeLists.txt index c586b31..fe0174f 100644 --- a/src/standards/W3C/Widget/CMakeLists.txt +++ b/src/standards/W3C/Widget/CMakeLists.txt @@ -29,7 +29,6 @@ include_directories( ${API_WIDGET_PATH} ${webkit2_INCLUDE_DIRS} ${plugin-types_INCLUDE_DIRS} - ${PLUGINS_IPC_MESSAGE_DIRS} ) add_library(${TARGET_NAME} SHARED ${SRCS}) @@ -42,7 +41,6 @@ target_link_libraries(${TARGET_NAME} wrt-plugins-localstorage wrt-plugins-storageevent wrt-dispatch-event - wrt-plugins-ipc-message ) INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION /usr/lib/wrt-plugins/w3c-widget-interface) diff --git a/src/standards/W3C/Widget/JSWidget.cpp b/src/standards/W3C/Widget/JSWidget.cpp index 8a6843c..f4b9684 100644 --- a/src/standards/W3C/Widget/JSWidget.cpp +++ b/src/standards/W3C/Widget/JSWidget.cpp @@ -32,6 +32,9 @@ #include #include +// temporary +extern "C" JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx); + #define CATCH_EXCEPTION_NO_MODIFABLE \ Catch(Commons::LocalStorageValueNoModifableException) { \ LogError("The item is read only"); \ @@ -232,12 +235,17 @@ const JSClassDefinition* JSWidget::getClassInfo() JSClassRef JSWidget::m_jsClassRef = JSClassCreate(JSWidget::getClassInfo()); -JSContextRef JSWidget::m_globalContext = NULL; - void JSWidget::initialize(JSContextRef context, JSObjectRef object) { - LogDebug("entered. Context : " << context << ", Object: " << object); + JSGlobalContextRef g_context = JSContextGetGlobalContext(context); + + LogDebug("entered. Context : " << context << "(global:" << g_context << "), Object: " << object); + + if (context != g_context) + { + context = g_context; + } JSWidgetPrivateObject* priv = static_cast(JSObjectGetPrivate(object)); @@ -295,18 +303,6 @@ void JSWidget::finalize(JSObjectRef object) } } -void JSWidget::acquireGlobalContext(java_script_context_t global_context, - js_object_instance_t /*iframe*/, - js_object_instance_t /*object*/) -{ - if (!m_globalContext) { - m_globalContext = static_cast(global_context); - LogInfo("Global context acquired."); - } else { - LogInfo("Global context already set."); - } -} - JSValueRef JSWidget::getAuthor(JSContextRef context, JSObjectRef object, JSStringRef /*propertyName*/, @@ -550,12 +546,7 @@ JSObjectRef JSWidget::callAsConstructor(JSContextRef context, JSValueRef* /*exception*/) { LogDebug("widget constructor"); - if (!m_globalContext) { - LogError("Global context not set. Creating 'widget' object with " - "local context!"); - return JSObjectMake(context, JSWidget::getClassRef(), NULL); - } - return JSObjectMake(m_globalContext, JSWidget::getClassRef(), NULL); + return JSObjectMake(context, JSWidget::getClassRef(), NULL); } #undef CATCH_EXCEPTION_NO_MODIFABLE diff --git a/src/standards/W3C/Widget/JSWidget.h b/src/standards/W3C/Widget/JSWidget.h index c0bf403..f1f979c 100644 --- a/src/standards/W3C/Widget/JSWidget.h +++ b/src/standards/W3C/Widget/JSWidget.h @@ -49,18 +49,6 @@ class JSWidget const JSValueRef arguments[], JSValueRef* exception); - /** - * This function will acquire global context which is used later to - * keep JSValueProtect/Unprotect functionality working. - * This is workaround for JSCore semantic: when an object is created with - * JSObjectMakeConstructor a context passed to createCallback function - * is different (shorter lifecycle) than global context, so JSValueUnprotect - * called in finalize may fail because of invalid context. - */ - static void acquireGlobalContext(java_script_context_t global_context, - js_object_instance_t iframe, - js_object_instance_t object); - private: /** * The callback invoked when an object is first created. @@ -86,11 +74,6 @@ class JSWidget static JSClassRef m_jsClassRef; - /** - * Global context acquired by acquireGlobalContext() function. - */ - static JSContextRef m_globalContext; - // getters for properties static JSValueRef getAuthor(JSContextRef context, JSObjectRef object, diff --git a/src/standards/W3C/Widget/plugin_initializer.cpp b/src/standards/W3C/Widget/plugin_initializer.cpp index d296869..10cdea6 100644 --- a/src/standards/W3C/Widget/plugin_initializer.cpp +++ b/src/standards/W3C/Widget/plugin_initializer.cpp @@ -44,7 +44,7 @@ class_definition_options_t WidgetOptions = { JS_CLASS, CREATE_INSTANCE, NONE_NOTICE, - USE_OVERLAYED, //ignored + IGNORED, NULL, NULL, NULL @@ -53,9 +53,9 @@ class_definition_options_t WidgetOptions = { class_definition_options_t WidgetInterfaceOptions = { JS_INTERFACE, CREATE_INSTANCE, - ALWAYS_NOTICE, - USE_OVERLAYED, //ignored - JSWidget::acquireGlobalContext, + NONE_NOTICE, + IGNORED, //ignored + NULL, NULL, NULL };