Update change log and spec for wrt-plugins-tizen_0.4.70
[framework/web/wrt-plugins-tizen.git] / src / Messaging / plugin_initializer.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 016421e..ede803d
@@ -23,6 +23,7 @@
 #include "JSMessageAttachment.h"
 #include "MessageAsyncCallbackManager.h"
 #include "MessageListenerManager.h"
+#include "plugin_config.h"
 
 #include <GlobalContextManager.h>
 #include <Logger.h>
 namespace DeviceAPI {
 namespace Messaging {
 
+using namespace WrtDeviceApis;
+using namespace WrtDeviceApis::Commons;
+
+AceSecurityStatus messagingAceCheckAccessFunction(const char* functionName)
+{
+    return MESSAGING_CHECK_ACCESS(functionName);
+}
+
+DEFINE_GLOBAL_SECURITY_ACCESSOR(gSecurityAccessor);
+
+DEFINE_SECURITY_ACCESSOR_SETTER(AceCheckerMessagingSetter, JSMessagingServiceManagerPriv, gSecurityAccessor);
+
 namespace Options{
 
 class_definition_options_t MessagingOptions =
 {
     JS_CLASS,
     CREATE_INSTANCE,
-    NONE_NOTICE,
+    ALWAYS_NOTICE,
     USE_OVERLAYED, //ignored
+    AceCheckerMessagingSetter,
     NULL,
     NULL
 };
@@ -56,9 +70,6 @@ class_definition_options_t MessagingInterfaceOptions = {
 
 }
 
-using namespace WrtDeviceApis;
-using namespace WrtDeviceApis::Commons;
-
 void on_widget_start_callback(int widgetId) {
        LoggerD("[Tizen\\MessagingServiceManager] on_widget_start_callback ("<<widgetId<<")");
     Try {
@@ -66,6 +77,8 @@ void on_widget_start_callback(int widgetId) {
     } Catch(Commons::Exception) {
         LoggerE("WrtAccess initialization failed");
     }
+
+    INITAILIZE_GLOBAL_SECURITY_ACCESSOR(gSecurityAccessor, messagingAceCheckAccessFunction);
 }
 
 void on_widget_stop_callback(int widgetId) {
@@ -75,6 +88,8 @@ void on_widget_stop_callback(int widgetId) {
     } Catch(Commons::Exception) {
         LoggerE("WrtAccess deinitialization failed");
     }
+
+    FINALIZE_GLOBAL_SECURITY_ACCESSOR(gSecurityAccessor);
 }
 
 void on_frame_load_callback(const void * context)