Update change log and spec for wrt-plugins-tizen_0.4.70
[framework/web/wrt-plugins-tizen.git] / src / Calendar / JSCalendarManager.cpp
index 27cb03c..86dbe9d 100755 (executable)
@@ -115,9 +115,7 @@ JSValueRef JSCalendarManager::getCalendars(JSContextRef context,
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
     CalendarManagerPrivObject *privateObject = static_cast<CalendarManagerPrivObject*>(JSObjectGetPrivate(thisObject));
 
-    AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_CALENDARS);
-
-    TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+    TIZEN_CHECK_ACCESS(context, exception, privateObject, CALENDAR_FUNCTION_API_GET_CALENDARS);
 
     Try {
         if (!privateObject) {
@@ -151,6 +149,7 @@ JSValueRef JSCalendarManager::getCalendars(JSContextRef context,
         dplEvent->setType(calendarType);
         dplEvent->setPrivateData(DPL::StaticPointerCast<IEventPrivateData>(cbm));
         dplEvent->setForAsynchronousCall(&CalendarResponseDispatcher::getInstance());
+        dplEvent->copyAceCheckAccessFunction(privateObject);
         privateObject->getObject()->getCalendars(dplEvent);
 
                TIME_TRACER_ITEM_END(__FUNCTION__, 0);
@@ -188,9 +187,7 @@ JSValueRef JSCalendarManager::getDefaultCalendar(JSContextRef context,
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
     CalendarManagerPrivObject *privateObject = static_cast<CalendarManagerPrivObject*>(JSObjectGetPrivate(thisObject));
 
-    AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_DEFAULT_CALENDAR);
-
-    TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+    TIZEN_CHECK_ACCESS(context, exception, privateObject, CALENDAR_FUNCTION_API_GET_DEFAULT_CALENDAR);
 
     Try {
         if (!privateObject) {
@@ -200,7 +197,7 @@ JSValueRef JSCalendarManager::getDefaultCalendar(JSContextRef context,
                // Global context should be passed to the calendar object.
         JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
 
-        CalendarConverter converter(globalContext);
+        CalendarConverter converter(globalContext, privateObject);
         CalendarEvent::CalendarType calendarType = CalendarEvent::UNDEFINED_TYPE;
         if (argumentCount>=1) {
             calendarType = converter.toCalendarType(converter.toString(arguments[0]));
@@ -264,9 +261,7 @@ JSValueRef JSCalendarManager::getUnifiedCalendar(JSContextRef context,
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
     CalendarManagerPrivObject *privateObject = static_cast<CalendarManagerPrivObject*>(JSObjectGetPrivate(thisObject));
 
-    AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_UNIFIED_CALENDAR);
-
-    TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+    TIZEN_CHECK_ACCESS(context, exception, privateObject, CALENDAR_FUNCTION_API_GET_UNIFIED_CALENDAR);
 
     Try {
         if (!privateObject) {
@@ -276,7 +271,7 @@ JSValueRef JSCalendarManager::getUnifiedCalendar(JSContextRef context,
                // Global context should be passed to the calendar object.
         JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
 
-        CalendarConverter converter(globalContext);
+        CalendarConverter converter(globalContext, privateObject);
         CalendarEvent::CalendarType calendarType = CalendarEvent::UNDEFINED_TYPE;
         if (argumentCount>=1) {
             calendarType = converter.toCalendarType(converter.toString(arguments[0]));
@@ -340,9 +335,7 @@ JSValueRef JSCalendarManager::getCalendar(JSContextRef context,
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
     CalendarManagerPrivObject *privateObject = static_cast<CalendarManagerPrivObject*>(JSObjectGetPrivate(thisObject));
 
-    AceSecurityStatus status = CALENDAR_CHECK_ACCESS(CALENDAR_FUNCTION_API_GET_CALENDAR);
-
-    TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+    TIZEN_CHECK_ACCESS(context, exception, privateObject, CALENDAR_FUNCTION_API_GET_CALENDAR);
 
     Try {
         if (!privateObject) {
@@ -352,7 +345,7 @@ JSValueRef JSCalendarManager::getCalendar(JSContextRef context,
                // Global context should be passed to the calendar object.
         JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
 
-        CalendarConverter converter(globalContext);
+        CalendarConverter converter(globalContext, privateObject);
 
         CalendarEvent::CalendarType calendarType = CalendarEvent::UNDEFINED_TYPE;
         if (argumentCount>=1) {