Revert "Performance improvement of PluginManager with clean up some plugin code."
authorJihoon Chung <jihoon.chung@samsung.com>
Sat, 29 Jun 2013 12:55:59 +0000 (12:55 +0000)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Sat, 29 Jun 2013 12:59:54 +0000 (12:59 +0000)
This reverts commit 4b577050713f45788fb717107f4553357e9fee94

Change-Id: I004b8eee61ad5c05f69dd248749b87b88ae1e95e

src/Commons/JSObjectDeclaration.cpp
src/Commons/JSObjectDeclaration.h
src/js-overlay/CMakeLists.txt
src/js-overlay/js_overlay_support.cpp [moved from src/js-overlay/deprecated/js_overlay_support.cpp with 100% similarity]
src/js-overlay/js_overlay_support.h [moved from src/js-overlay/deprecated/js_overlay_support.h with 100% similarity]
src/modules/tizen/PluginManager/PluginManager.cpp
src/plugin-loading/explorer.cpp
src/plugin-loading/javascript_interface.cpp
src/plugin-loading/js_page_session.cpp
src/plugin-loading/plugin.cpp
src/standards/W3C/Widget/JSWidget.cpp

index 81578cc..09f5ff8 100755 (executable)
@@ -44,18 +44,23 @@ JSObjectDeclaration::~JSObjectDeclaration()
 
 bool JSObjectDeclaration::checkIframesSupported() const
 {
+    LogDebug("Check iframe supported");
     if (!m_options ||
         m_options->getIframeObject() == Options::IFrameObject::None)
     {
+        LogDebug("Iframe NOT supported for object: " << getName());
         return false;
     }
 
+    LogDebug("Iframe supported for object: " << getName());
+
     return true;
 }
 
 JSObjectDeclaration::Options::ClassType
 JSObjectDeclaration::Options::getType() const
 {
+    LogDebug("Get type field from declaration's option");
     Assert(m_options && "Pointer to options is NULL");
 
     switch (m_options->type) {
@@ -69,11 +74,12 @@ JSObjectDeclaration::Options::getType() const
 JSObjectDeclaration::Options::IFrameObject
 JSObjectDeclaration::Options::getIframeObject() const
 {
+    LogDebug("Get Frame Option");
     Assert(m_options && "Options object is NULL");
 
     switch (m_options->iframe_option) {
     case NONE: return IFrameObject::None;
-    case REFERENCE: return IFrameObject::Reference; // deprecated
+    case REFERENCE: return IFrameObject::Reference;
     case CREATE_INSTANCE: return IFrameObject::CreateInstance;
     default:
         Assert(0 && "Wrong value of behaviour type");
@@ -83,6 +89,7 @@ JSObjectDeclaration::Options::getIframeObject() const
 JSObjectDeclaration::Options::IFrameNotice
 JSObjectDeclaration::Options::getIframeNotice() const
 {
+    LogDebug("Get Frame Option");
     Assert(m_options && "Pointer to options is null");
 
     switch (m_options->iframe_notice) {
@@ -93,6 +100,22 @@ JSObjectDeclaration::Options::getIframeNotice() const
     }
 }
 
+JSObjectDeclaration::Options::IFrameOverlay
+JSObjectDeclaration::Options::getIframeOverlay() const
+{
+    LogDebug("Get Frame Option");
+    Assert(m_options && "Pointer to options is null");
+
+    switch (m_options->iframe_overlay) {
+    case IGNORED: return IFrameOverlay::Ignored;
+    case USE_OVERLAYED: return IFrameOverlay::UseOverlayed;
+    case OVERLAYED_BEFORE_ORIGINAL:
+        return IFrameOverlay::OverlayedBeforeOriginal;
+    default:
+        Assert(0 && "Wrong value of overlay option");
+    }
+}
+
 js_function_impl JSObjectDeclaration::Options::getFunctionImpl() const
 {
     Assert(m_options && "Pointer to options is null");
index a726029..699936e 100644 (file)
@@ -66,8 +66,8 @@ class JSObjectDeclaration : private DPL::Noncopyable
         enum class IFrameOverlay
         {
             Ignored,
-            UseOverlayed,           //deprecated
-            OverlayedBeforeOriginal //deprecated
+            UseOverlayed,
+            OverlayedBeforeOriginal
         };
 
         typedef js_object_instance_t ObjectInstance;
@@ -79,6 +79,7 @@ class JSObjectDeclaration : private DPL::Noncopyable
 
         IFrameObject getIframeObject() const;
         IFrameNotice getIframeNotice() const;
+        IFrameOverlay getIframeOverlay() const;
         js_function_impl getFunctionImpl() const;
 
         void invokeCallback(JsContext ctx,
index f42c3f0..5cbb0d8 100644 (file)
@@ -28,6 +28,7 @@ pkg_search_module(plugin-types REQUIRED wrt-plugins-types)
 SET(TARGET_NAME ${TARGET_JS_OVERLAY})
 
 SET(SRCS
+    ${CMAKE_CURRENT_SOURCE_DIR}/js_overlay_support.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/js_function_manager.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/js_overlay_functions.cpp
 )
index b4a56a5..2d868d8 100644 (file)
@@ -176,58 +176,59 @@ bool PluginManager::deleteProperty(const string &name)
 
 Api::IPluginManager::PropertyList PluginManager::getProperties() const
 {
-    using namespace WrtDB;
-
     if (!m_propertyCache.IsNull()) {
         return *m_propertyCache;
     }
 
     m_propertyCache = PropertyList();
 
-    WidgetDAOReadOnly dao(m_widgetHandle);
+    WrtDB::WidgetDAOReadOnly dao(m_widgetHandle);
     string localUri = m_objectUri + SEPARATOR;
 
-    if (dao.getWidgetType() == APP_TYPE_TIZENWEBAPP)
-    {
-        static ImplementedObjectsList implObjectList =
-            PluginDAOReadOnly::getImplementedObjects();
+    if (dao.getWidgetType() == WrtDB::APP_TYPE_TIZENWEBAPP) {
+        WrtDB::PluginHandleList pluginHandleList =
+            WrtDB::PluginDAOReadOnly::getPluginHandleList();
 
-        FOREACH(it_implObject, implObjectList)
+        FOREACH(it_pluginHandle, pluginHandleList)
         {
-            //check if implemented object stats with localUri
-            if (it_implObject->find(localUri) == 0) {
-                string property = *it_implObject;
-                //remove local uri that predicts property name.
-                property.erase(0, localUri.size());
-                //check if property has its own properties.
-                size_t pos = property.find(SEPARATOR);
-                if (pos != string::npos) {
-                    //if so then remove them.
-                    property.erase(pos);
-                }
+            WrtDB::ImplementedObjectsList implObjectList =
+                WrtDB::PluginDAOReadOnly::getImplementedObjectsForPluginHandle(
+                    *it_pluginHandle);
 
-                m_propertyCache->push_back(property);
+            FOREACH(it_implObject, implObjectList)
+            {
+                //check if implemented object stats with localUri
+                if (it_implObject->find(localUri) == 0) {
+                    string property = *it_implObject;
+                    //remove local uri that predicts property name.
+                    property.erase(0, localUri.size());
+                    //check if property has its own properties.
+                    size_t pos = property.find(SEPARATOR);
+                    if (pos != string::npos) {
+                        //if so then remove them.
+                        property.erase(pos);
+                    }
+                    m_propertyCache->push_back(property);
+                }
             }
         }
-    }
-    else
-    {
-        DbWidgetFeatureSet features;
+    } else {
+        WrtDB::DbWidgetFeatureSet features;
 
         Try
         {
             features = dao.getFeaturesList();
         }
-        Catch(WidgetDAOReadOnly::Exception::Base)
+        Catch(WrtDB::WidgetDAOReadOnly::Exception::Base)
         {
             LogError("Cannot get feature list");
             ReThrow(Commons::PlatformException);
         }
 
-        DbWidgetFeatureSet::const_iterator feature = features.begin();
+        WrtDB::DbWidgetFeatureSet::const_iterator feature = features.begin();
         for (; feature != features.end(); ++feature) {
-            ImplementedObjectsList implObjs =
-                PluginDAOReadOnly::getImplementedObjectsForPluginHandle(
+            WrtDB::ImplementedObjectsList implObjs =
+                WrtDB::PluginDAOReadOnly::getImplementedObjectsForPluginHandle(
                     feature->pluginId);
             FOREACH(it, implObjs) {
                 //check if implemented object stats with localUri
index 3b385f6..1ecad15 100644 (file)
@@ -28,6 +28,7 @@
 #include "plugin_property_support.h"
 
 // JS overlay
+#include <js_overlay_support.h>
 #include <js_overlay_types.h>
 
 namespace {
@@ -50,6 +51,7 @@ Explorer::Explorer(JSGlobalContextRef context) :
     m_globalObject =
         JavaScriptInterfaceSingleton::Instance().getGlobalObject(context);
 
+    LogDebug("Register main frame");
     //register main frame;
     m_iframeSupport.registerIframe(m_globalObject);
 
@@ -63,6 +65,7 @@ Explorer::~Explorer()
 JSObjectPtr Explorer::getJSObjectProperty(const std::string& propertyName,
                                           JSObjectPtr object)
 {
+    LogDebug("Get object property " << propertyName);
     return JavaScriptInterfaceSingleton::Instance().getJSObjectProperty(
                m_context, object, propertyName);
 }
@@ -108,11 +111,15 @@ JSObjectPtr Explorer::getProperty(
 bool Explorer::registerObject(const JSObjectDeclarationPtr& declaration,
                               JSGlobalContextRef context)
 {
+    LogDebug("Register to global object");
+
     bool retValue;
 
     if (declaration->getParentName() == GLOBAL_OBJECT_NAME) {
+        LogDebug("Connect to Global object");
         retValue = register_(declaration, m_globalObject, context);
     } else { //PIM support
+        LogDebug("Connect to NOT global object");
         //it should be master object name
         string masterName = declaration->getParentName();
         auto pos = masterName.find(".");
@@ -131,10 +138,13 @@ bool Explorer::registerObject(const JSObjectDeclarationPtr& declaration,
     }
 
     if (declaration->checkIframesSupported()) {
+        LogDebug("Iframe supported");
         m_iframeSupport.registerDeclaration(declaration);
         //        m_iframeSupport.invokeCallbackForMainFrame(m_context,
         //                                                   declaration,
         //                                                   newObject);
+    } else {
+        LogDebug("Iframe NOT supported");
     }
 
     return retValue;
@@ -145,16 +155,19 @@ bool Explorer::registerObject(const JSObjectDeclarationPtr& declaration,
                               JSObjectPtr providedObject,
                               JSGlobalContextRef context)
 {
-    LogDebug("'" << providedObjectName << "' <- '" << declaration->getName() << "'");
+    LogDebug(
+        "Register object. Provided object name: '" << providedObjectName
+                                                   <<
+        "', registration of: '" << declaration->getName() << "'");
 
     std::string fullParentName = declaration->getParentName();
+    LogDebug("Parent name: " << declaration->getParentName());
 
     if (fullParentName == providedObjectName) {
+        LogDebug("Provided object match equaly to requested parent");
         return register_(declaration, providedObject, context);
     }
 
-    LogDebug("Provided object was not matched!!");
-
     //check if object exists in fullParentName
     auto pos = fullParentName.find(providedObjectName);
     if (pos == string::npos) {
@@ -206,14 +219,43 @@ bool Explorer::register_(const JSObjectDeclarationPtr& declaration,
     typedef JSObjectDeclaration::Options JO;
 
     JSGlobalContextRef gContext = (context == NULL) ? m_context : context;
+    JSObjectPtr newObject;
+
     JSObjectPtr objectInstance = JavaScriptInterfaceSingleton::Instance().
             createObject(gContext, declaration);
 
+    //function creation
+    if (declaration->getOptions() &&
+        declaration->getOptions()->getType() == JO::ClassType::Function)
+    {
+        LogDebug("Loading function object " << declaration->getName());
+
+        auto type = declaration->getOptions()->getIframeOverlay();
+        if (JO::IFrameOverlay::OverlayedBeforeOriginal == type) {
+            LogDebug("Create overlayed function");
+            JSObjectPtr original =
+                JavaScriptInterfaceSingleton::Instance().
+                    getJSObjectProperty(gContext,
+                                        parent,
+                                        declaration->getName());
+            newObject = JSOverlaySupport::
+                    createWrappedFunction(gContext,
+                                          original,
+                                          objectInstance,
+                                          declaration->getName());
+        } else {
+            LogDebug("create normal function");
+            newObject = objectInstance;
+        }
+    } else { //object creation
+        newObject = objectInstance;
+    }
+
     JavaScriptInterfaceSingleton::Instance().setObjectProperty(
         gContext,
         parent,
         declaration->getName(),
-        objectInstance);
+        newObject);
 
     //notice
     if (declaration->getOptions() &&
@@ -327,7 +369,7 @@ void Explorer::cleanIframesData()
     m_iframeSupport.clean();
 }
 
-void Explorer::callEventListeners(CustomEventType /*eventType*/, void* /*data*/)
+void Explorer::callEventListeners(CustomEventType eventType, void* data)
 {
 #if 0 // deprecated
     using namespace WrtPlugins::Tizen;
index 8619404..9cb8827 100644 (file)
@@ -122,7 +122,7 @@ void JavaScriptInterface::setObjectProperty(JSGlobalContextRef context,
                                             const std::string &propertyName,
                                             const JSObjectPtr& propertyObject)
 {
-    LogInfo("JSObjectSetProperty(" << context << ", \"" << propertyName << "\")");
+    LogInfo("Webkit:setting property --" << propertyName << "--");
 
     //create name
     JSStringRef name = JSStringCreateWithUTF8CString(propertyName.c_str());
@@ -144,7 +144,7 @@ void JavaScriptInterface::removeObjectProperty(JSGlobalContextRef context,
         //nothing to do -> no context
         return;
     }
-    LogDebug("JSObjectDeleteProperty(" << context << ", \"" << propertyName << "\")");
+    LogDebug("Deleting property --" << propertyName << "--");
 
     JSStringRef name = JSStringCreateWithUTF8CString(propertyName.c_str());
     JSObjectDeleteProperty(
@@ -179,7 +179,7 @@ JSObjectPtr JavaScriptInterface::makeJSFunctionObject(
     const std::string &name,
     js_function_impl functionImplementation) const
 {
-    LogDebug("JSObjectMakeFunctionWithCallback(" << context << ", \"" << name << "\")");
+    LogDebug("Create JS function");
     JSStringRef jsFunName = JSStringCreateWithUTF8CString(name.c_str());
 
     JSObjectRef object = JSObjectMakeFunctionWithCallback(
@@ -196,7 +196,7 @@ JSObjectPtr JavaScriptInterface::makeJSClassObject(
     JSGlobalContextRef context,
     JSObjectDeclaration::ConstClassTemplate classTemplate) const
 {
-    LogDebug("JSObjectMake(" << context << ")");
+    LogDebug("Create JS object");
     JSObjectRef object = JSObjectMake(
             context,
             static_cast<JSClassRef>(
@@ -209,7 +209,8 @@ JSObjectPtr JavaScriptInterface::makeJSObjectBasedOnInterface(
     JSGlobalContextRef context,
     const std::string &interfaceName) const
 {
-    LogDebug("makeJSObjectBasedOnInterface(" << context << ", \"" << interfaceName << "\"");
+    LogDebug("Create JS object base on interface: " << interfaceName);
+    LogDebug("Context: " << context);
 
     JSObjectPtr jsInterfaceObj = getJSObjectProperty(context,
                                                      getGlobalObject(
@@ -400,8 +401,6 @@ JSObjectPtr JavaScriptInterface::getJSObjectProperty(JSGlobalContextRef ctx,
                                                      const std::string& name)
 const
 {
-    LogDebug("getJSObjectProperty(" << ctx << ", \"" << name << "\")");
-
     JSObjectRef frame_js = static_cast<JSObjectRef>(frame->getObject());
 
     JSValueRef property = getPropertyObj(ctx, frame_js, name.c_str());
index 354403e..24a3d49 100644 (file)
@@ -100,8 +100,9 @@ class JSPageSession::Impl
   private:
     PluginPtr loadLibrary(PluginModelPtr& pluginModel);
 
+    void loadInjectedJavaScript();
     void installStandardFunctions();
-    void installRootPlugins();
+     void installRootPlugins();
     void installRequestedFeatures();
 
     //returns true if success or false if failed
@@ -147,8 +148,13 @@ JSPageSession::Impl::Impl(const PluginContainerSupportPtr& support) :
         m_sessionStarted(false),
         m_objectExplorer(NULL)
 {
+    //    DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
     LogDebug("Initializing Page Session");
     m_pluginsSupport = support;
+
+    // explicit call to keep singleton's lifetime until calling destructor.
+    //    JsFunctionManagerSingleton::Instance();
+    //    JavaScriptInterfaceSingleton::Instance();
 }
 
 JSPageSession::Impl::~Impl()
@@ -170,7 +176,7 @@ JSPageSession::Impl::~Impl()
         m_objectExplorer->registerObject(*it, NULL);
     }
 
-    LogInfo("Installing standard functions...[done]");
+     LogInfo("Standard functions installed.");
  }
 
 void JSPageSession::Impl::installRootPlugins()
@@ -184,7 +190,7 @@ void JSPageSession::Impl::installRootPlugins()
         installPlugin(*it);
     }
 
-    LogInfo("Installing requested root plugins...[done]");
+    LogInfo("requested root plugins installed.");
 }
 
 bool JSPageSession::Impl::installPlugin(PluginModelPtr plugin)
@@ -197,7 +203,7 @@ bool JSPageSession::Impl::installPlugin(PluginModelPtr plugin)
         return false;
     }
 
-    LogInfo("Install Plugin " << library->GetFileName());
+    LogInfo("Install Plugin '" << library->GetFileName());
 
     // Register new class
     FOREACH(it, *(library->GetClassList()))
@@ -207,7 +213,7 @@ bool JSPageSession::Impl::installPlugin(PluginModelPtr plugin)
         }
     }
 
-    LogInfo("Install Plugin [done]");
+    LogDebug("Registered feature.");
     return true;
 }
 
@@ -374,6 +380,115 @@ void JSPageSession::Impl::dispatchJavaScriptEvent(CustomEventType eventType,
     m_objectExplorer->callEventListeners(eventType, data);
 }
 
+void JSPageSession::Impl::loadInjectedJavaScript()
+{
+    LogInfo("Entered");
+
+    std::string DIR_PATH = "/usr/etc/wrt/injected-javascript";
+    std::string JS_EXTENSION = ".js";
+
+    DIR *dir = opendir(DIR_PATH.c_str());
+
+    if (!dir) {
+        LogError("opendir(\"" << DIR_PATH << "\") error!");
+        return;
+    }
+
+    int return_code;
+    struct dirent libdir;
+    struct dirent* result;
+    std::list<std::string> jsFiles;
+
+    // make file list from DIR_PATH
+    for (return_code = readdir_r(dir, &libdir, &result);
+            result != NULL && return_code == 0;
+            return_code = readdir_r(dir, &libdir, &result)) {
+        if (strncmp(libdir.d_name, ".", 2) == 0 ||
+            strncmp(libdir.d_name, "..", 3) == 0)
+        {
+            continue;
+        }
+
+        std::string filepath = DIR_PATH;
+        filepath += "/";
+        filepath += libdir.d_name;
+
+        std::string lowercase = filepath;
+        std::transform(lowercase.begin(), lowercase.end(), lowercase.begin(),
+                       towlower);
+
+        if (lowercase.rfind(JS_EXTENSION) == std::string::npos ||
+            lowercase.length() !=
+            lowercase.rfind(JS_EXTENSION) + JS_EXTENSION.length() )
+        {
+            LogError("This is not js file" << filepath);
+            continue;
+        }
+
+        struct stat tmp;
+
+        if (stat(filepath.c_str(), &tmp) == -1) {
+            LogError("Failed to open file " << filepath);
+            continue;
+        }
+
+        if (!S_ISREG(tmp.st_mode)) {
+            LogError("This is not a regular file " << filepath);
+            continue;
+        }
+
+        LogInfo("Added : " << filepath);
+        jsFiles.push_back(filepath);
+    }
+    if (0 != return_code)
+        LogError("Error while reading directory.");
+
+    closedir(dir);
+
+    FOREACH(it, jsFiles)
+    {
+        LogDebug("load file : " << (*it));
+        // load file
+        std::string content;
+        std::ifstream fin(it->c_str());
+
+        while (fin.good()) {
+            string line;
+            std::getline(fin, line);
+            content += line + "\n";
+        }
+
+        fin.close();
+        // execute
+        if (!content.empty()) {
+            JSValueRef exception = NULL;
+            JSStringRef script =
+                JSStringCreateWithUTF8CString(content.c_str());
+
+            JSEvaluateScript(m_context, script, NULL, NULL, 1, &exception);
+
+            JSStringRelease(script);
+
+            if (exception) {
+                LogDebug("Exception Occured while injecting javascript "
+                         "file. : " << *it);
+
+                JSStringRef exceptionJSString =
+                    JSValueToStringCopy(m_context, exception, NULL);
+                size_t size =
+                    JSStringGetMaximumUTF8CStringSize(exceptionJSString);
+                char* exceptionString = new char[size];
+                JSStringGetUTF8CString(exceptionJSString,
+                                       exceptionString, size);
+                LogDebug("Exception : " << exceptionString);
+
+                delete[] exceptionString;
+                JSStringRelease(exceptionJSString);
+            }
+        }
+    }
+}
+
 void JSPageSession::Impl::startSession(int widgetHandle,
                                        JSGlobalContextRef context,
                                        double scaleFactor,
@@ -410,7 +525,9 @@ void JSPageSession::Impl::startSession(int widgetHandle,
     // set scale, bundle as window's property
     setCustomProperties(scaleFactor, encodedBundle, theme);
 
-    LogInfo("Starting widget session...[done]");
+    // Load injected javascript files
+    loadInjectedJavaScript();
+    LogInfo("Widget session started.");
 }
 
 void JSPageSession::Impl::stopSession()
@@ -544,7 +661,7 @@ void JSPageSession::Impl::loadFrame(JSGlobalContextRef context)
 
     FOREACH(pluginIt, m_loadedPlugins)
     {
-        LogDebug("Try to call 'OnFrameLoad' callback : " << (*pluginIt)->GetFileName());
+        LogDebug("load plugin to frame" << (*pluginIt)->GetFileName());
 
         (*pluginIt)->OnFrameLoad(context);
     }
@@ -565,7 +682,7 @@ void JSPageSession::Impl::unloadFrame(JSGlobalContextRef context)
 
     FOREACH(pluginIt, m_loadedPlugins)
     {
-        LogDebug("Try to call 'OnFrameUnload' callback : " << (*pluginIt)->GetFileName());
+        LogDebug("unload plugin to frame" << (*pluginIt)->GetFileName());
 
         (*pluginIt)->OnFrameUnload(context);
     }
index f3cdb16..16b92e6 100644 (file)
@@ -208,7 +208,8 @@ void Plugin::OnWidgetStart(int widgetId)
 {
     if (NULL != m_apiOnWidgetStart) {
         (*m_apiOnWidgetStart)(widgetId);
-        LogInfo("Called!");
+    } else {
+        LogWarning("OnWidgetStart not set!");
     }
 }
 
@@ -217,7 +218,8 @@ void Plugin::OnWidgetInit(feature_mapping_interface_t* mapping)
     Assert(NULL != mapping && "NULL mapping interface provided");
     if (NULL != m_apiOnWidgetInit) {
         (*m_apiOnWidgetInit)(mapping);
-        LogInfo("Called!");
+    } else {
+        LogWarning("OnWidgetInit not set!");
     }
 }
 
@@ -225,7 +227,8 @@ void Plugin::OnWidgetStop(int widgetId)
 {
     if (NULL != m_apiOnWidgetStop) {
         (*m_apiOnWidgetStop)(widgetId);
-        LogInfo("Called!");
+    } else {
+        LogWarning("OnWidgetStop not set!");
     }
 }
 
@@ -233,7 +236,8 @@ void Plugin::OnFrameLoad(java_script_context_t context)
 {
     if (NULL != m_apiOnFrameLoad) {
         (*m_apiOnFrameLoad)(context);
-        LogInfo("Called!");
+    } else {
+        LogWarning("OnFrameLoad not set!");
     }
 }
 
@@ -241,7 +245,8 @@ void Plugin::OnFrameUnload(java_script_context_t context)
 {
     if (NULL != m_apiOnFrameUnload) {
         (*m_apiOnFrameUnload)(context);
-        LogInfo("Called!");
+    } else {
+        LogWarning("OnFrameUnload not set!");
     }
 }
 
index 8a6843c..162820f 100644 (file)
@@ -237,7 +237,8 @@ JSContextRef JSWidget::m_globalContext = NULL;
 void JSWidget::initialize(JSContextRef context,
                           JSObjectRef object)
 {
-    LogDebug("entered. Context : " << context << ", Object: " << object);
+    LogDebug("entered. Context : " << context);
+    LogDebug("Object: " << object);
 
     JSWidgetPrivateObject* priv =
         static_cast<JSWidgetPrivateObject*>(JSObjectGetPrivate(object));
@@ -265,6 +266,7 @@ void JSWidget::initialize(JSContextRef context,
 
             priv = new JSWidgetPrivateObject(context, widgetPriv);
             JSObjectSetPrivate(object, priv);
+            LogDebug("private object created");
         }
         Catch(Commons::InvalidArgumentException){
             LogError("You should register widget id in ON_WIDGET_START");
@@ -296,8 +298,8 @@ void JSWidget::finalize(JSObjectRef object)
 }
 
 void JSWidget::acquireGlobalContext(java_script_context_t global_context,
-                                    js_object_instance_t /*iframe*/,
-                                    js_object_instance_t /*object*/)
+                                    js_object_instance_t iframe,
+                                    js_object_instance_t object)
 {
     if (!m_globalContext) {
         m_globalContext = static_cast<JSContextRef>(global_context);