Update change log and spec for wrt-plugins-tizen_0.4.70
[framework/web/wrt-plugins-tizen.git] / src / NFC / JSNFCManager.cpp
index 7869f67..1264ed0 100755 (executable)
@@ -27,7 +27,7 @@
 #include "JSNFCAdapter.h"
 #include "NFCConverter.h"
 #include "NFCFactory.h"
-#include "plugin_config.h"
+#include "plugin_config_impl.h"
 #include "NFCDefaultAdapter.h"
 #include <Logger.h>
 
@@ -184,15 +184,16 @@ JSValueRef JSNFCManager::getDefaultAdapter (JSContextRef context, JSObjectRef ob
        LoggerD("Enter");
 
        Try {
-               AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_COMMON_FUNCS);
-               TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
                NFCManagerPrivObject* privateObject = static_cast<NFCManagerPrivObject*>(JSObjectGetPrivate(thisObject));
                if (!privateObject) {
                        LoggerE("private object is null");
                        ThrowMsg(UnsupportedException, "private object is null");
                }
-               return JSNFCAdapter::createJSObject(GlobalContextManager::getInstance()->getGlobalContext(context));
+
+               TIZEN_CHECK_ACCESS(context, exception, privateObject,
+               NFC_FUNCTION_API_COMMON_FUNCS);
+
+               return JSNFCAdapter::createJSObject(GlobalContextManager::getInstance()->getGlobalContext(context), privateObject);
        } Catch (UnsupportedException) {
                LoggerE("UnsupportedException: " << _rethrown_exception.GetMessage());
                return JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::NOT_SUPPORTED_ERROR, "Not Supported");
@@ -222,18 +223,20 @@ JSValueRef JSNFCManager::setExclusiveMode (JSContextRef context, JSObjectRef obj
        LoggerD("Enter");
 
        Try {
-               AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_COMMON_FUNCS);
-               TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
-
-               ArgumentValidator validator(context, argumentCount, arguments);
-               // mode
-        bool mode = validator.toBool(0);
-               LoggerD("mode : " << mode);
                NFCManagerPrivObject* privateObject = static_cast<NFCManagerPrivObject*>(JSObjectGetPrivate(thisObject));
                if (!privateObject) {
                        LoggerE("private object is null");
                        throw TypeMismatchException("private object is null");
                }
+
+               TIZEN_CHECK_ACCESS(context, exception, privateObject,
+               NFC_FUNCTION_API_COMMON_FUNCS);
+
+               ArgumentValidator validator(context, argumentCount, arguments);
+               // mode
+        bool mode = validator.toBool(0);
+               LoggerD("mode : " << mode);
+
                NFCDefaultAdapterSingleton::Instance().setExclusiveMode(mode);
                return JSValueMakeUndefined(context);
     } Catch (BasePlatformException) {