Update change log and spec for wrt-plugins-tizen_0.4.65
[platform/framework/web/wrt-plugins-tizen.git] / src / Messaging / JSMessagingServiceManager.cpp
index aa4aeed..a64a316 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <ArgumentValidator.h>
 #include <Export.h>
+#include <WidgetDB/WidgetDBMgr.h>
 
 #include "JSMessagingServiceManager.h"
 #include "MessagingController.h"
@@ -37,6 +38,7 @@
 #include "plugin_config.h"
 #include "MessageAsyncCallbackManager.h"
 #include "MessagingErrorMsg.h"
+#include "WidgetFilePathMgr.h"
 
 using namespace std;
 
@@ -90,6 +92,7 @@ namespace Messaging {
 
     void JSMessagingServiceManager::initialize(JSContextRef context, JSObjectRef object) {
         LoggerD("creation messaging instance");
+        int widgetId = -1;
 
         JSMessagingServiceManagerPriv *priv = static_cast<JSMessagingServiceManagerPriv*>(JSObjectGetPrivate(object));
         if (priv == NULL)
@@ -97,6 +100,10 @@ namespace Messaging {
             IMessagingServiceManagerPtr MessagingServiceManager(MessagingFactory::getInstance().getMessagingServiceManager());
             priv = new JSMessagingServiceManagerPriv( context, MessagingServiceManager);
 
+            widgetId = WrtAccessSingleton::Instance().getWidgetId();
+            WrtDeviceApis::WidgetDB::Api::IWidgetDBPtr widgetDB = WrtDeviceApis::WidgetDB::Api::getWidgetDB(widgetId);
+            GetWidgetPath(widgetDB->getWidgetPersistentStoragePath());
+
             if(!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
                 LoggerE("Object can't store private data.");
                 delete priv;