#include <JSWebAPIErrorFactory.h>
#include <ArgumentValidator.h>
#include <TimeTracer.h>
+#include <Security.h>
#include "JSUtil.h"
#include "ContentFactory.h"
#include "JSVideo.h"
#include "JSAudio.h"
#include "ContentConverter.h"
-#include "plugin_config.h"
+#include "plugin_config_impl.h"
#include "ContentAsyncCallbackManager.h"
#include "ContentListener.h"
#include "ContentVideo.h"
{
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
- MediacontentManagerPrivObject *privateObject;
- privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(thisObject));
+ MediacontentManagerPriv *privateObject;
+ privateObject = static_cast<MediacontentManagerPriv*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
DeviceAPI::Common::UnknownException err("Content's private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
- MediacontentManagerPrivObject *privateObject;
- privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(thisObject));
+ MediacontentManagerPriv *privateObject;
+ privateObject = static_cast<MediacontentManagerPriv*>(JSObjectGetPrivate(thisObject));
if(!privateObject) {
DeviceAPI::Common::UnknownException err("Content's private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
- AceSecurityStatus status = CONTENT_CHECK_ACCESS(CONTENT_FUNCTION_API_FIND_ITEMS);
-
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ TIZEN_CHECK_ACCESS(context, exception, privateObject, CONTENT_FUNCTION_API_FIND_ITEMS);
JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
JSValueRef* exception)
{
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
- MediacontentManagerPrivObject *privateObject;
- privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(thisObject));
+ MediacontentManagerPriv *privateObject;
+ privateObject = static_cast<MediacontentManagerPriv*>(JSObjectGetPrivate(thisObject));
if(!privateObject) {
DeviceAPI::Common::UnknownException err("Content's private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
JSContextRef globalContext = GlobalContextManager::getInstance()->getGlobalContext(context);
- AceSecurityStatus status = CONTENT_CHECK_ACCESS(CONTENT_FUNCTION_API_UPDATE_ITEMS_BATCH);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ TIZEN_CHECK_ACCESS(context, exception, privateObject, CONTENT_FUNCTION_API_UPDATE_ITEMS_BATCH);
JSCallbackManagerPtr cbm(NULL);
MediaConverterFactory::ConverterType converter = MediaConverterFactory::getConverter(context);
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
- MediacontentManagerPrivObject *privateObject;
- privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(thisObject));
+ MediacontentManagerPriv *privateObject;
+ privateObject = static_cast<MediacontentManagerPriv*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
DeviceAPI::Common::UnknownException err("Content's private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
- AceSecurityStatus status = CONTENT_CHECK_ACCESS(CONTENT_FUNCTION_API_UPDATE_ITEM);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ TIZEN_CHECK_ACCESS(context, exception, privateObject, CONTENT_FUNCTION_API_UPDATE_ITEM);
Try
{
}
}
+ JSValueRef nameValRef = JSUtil::getProperty(context , JSUtil::JSValueToObject(context, arguments[0]), "name");
+ if((JSValueIsNull(context, nameValRef) || JSValueIsUndefined(context, nameValRef)) ||
+ JSUtil::JSValueToString(context, nameValRef) == ""){
+ ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "name is not valid.");
+ }
event = JSMedia::getMediaObject(arg);
dplEvent->setMediaItem(event);
{
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
- MediacontentManagerPrivObject *privateObject;
- privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(thisObject));
+ MediacontentManagerPriv *privateObject;
+ privateObject = static_cast<MediacontentManagerPriv*>(JSObjectGetPrivate(thisObject));
if(!privateObject) {
DeviceAPI::Common::UnknownException err("Content's private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
- AceSecurityStatus status = CONTENT_CHECK_ACCESS(CONTENT_FUNCTION_API_SCAN_FILE);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ TIZEN_CHECK_ACCESS(context, exception, privateObject, CONTENT_FUNCTION_API_SCAN_FILE);
string path;
CallbackUserData *callback = NULL;
{
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
- MediacontentManagerPrivObject *privateObject;
- privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(thisObject));
+ MediacontentManagerPriv *privateObject;
+ privateObject = static_cast<MediacontentManagerPriv*>(JSObjectGetPrivate(thisObject));
if(!privateObject) {
DeviceAPI::Common::UnknownException err("Content's private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
- AceSecurityStatus status = CONTENT_CHECK_ACCESS(CONTENT_FUNCTION_API_SET_CHANGE_LISTENER);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ TIZEN_CHECK_ACCESS(context, exception, privateObject, CONTENT_FUNCTION_API_SET_CHANGE_LISTENER);
try{
ArgumentValidator argValidator(context, argumentCount, arguments);
JSValueRef* exception)
{
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
- MediacontentManagerPrivObject *privateObject;
- privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(thisObject));
+ MediacontentManagerPriv *privateObject;
+ privateObject = static_cast<MediacontentManagerPriv*>(JSObjectGetPrivate(thisObject));
if(!privateObject) {
DeviceAPI::Common::UnknownException err("Content's private object is NULL.");
return JSWebAPIErrorFactory::postException(context, exception, err);
}
- AceSecurityStatus status = CONTENT_CHECK_ACCESS(CONTENT_FUNCTION_API_SET_CHANGE_LISTENER);
- TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ TIZEN_CHECK_ACCESS(context, exception, privateObject, CONTENT_FUNCTION_API_SET_CHANGE_LISTENER);
try{
// perform
void JSMediacontentManager::initialize(JSContextRef context, JSObjectRef object)
{
- MediacontentManagerPrivObject *privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(object));
+ MediacontentManagerPriv *privateObject = static_cast<MediacontentManagerPriv*>(JSObjectGetPrivate(object));
if (NULL == privateObject)
{
IMediacontentManagerPtr contentManager = MediacontentFactory::getInstance().createMediacontentManagerObject();
- privateObject = new MediacontentManagerPrivObject(context, contentManager);
+ privateObject = new MediacontentManagerPriv(context, contentManager);
if (!JSObjectSetPrivate(object, static_cast<void*>(privateObject)))
{
delete privateObject;
void JSMediacontentManager::finalize(JSObjectRef object)
{
- MediacontentManagerPrivObject* priv = static_cast<MediacontentManagerPrivObject*> (JSObjectGetPrivate(object));
+ MediacontentManagerPriv* priv = static_cast<MediacontentManagerPriv*> (JSObjectGetPrivate(object));
if(priv != NULL)
{
delete priv;
const JSObjectRef object,
JSValueRef* exception)
{
- MediacontentManagerPrivObject *priv = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(object));
+ MediacontentManagerPriv *priv = static_cast<MediacontentManagerPriv*>(JSObjectGetPrivate(object));
if (priv)
{
return priv->getObject();