#include <Commons/WrtAccess/WrtAccess.h>
#include <Commons/plugin_initializer_def.h>
#include <TimeTracer.h>
+#include <Security.h>
#include "JSFilesystemManager.h"
#include "JSFile.h"
#include "JSFilestream.h"
#include "FilesystemAsyncCallbackManager.h"
#include "FilesystemListenerManager.h"
+#include "plugin_config.h"
+
#include <Logger.h>
using namespace WrtDeviceApis;
namespace DeviceAPI {
namespace Filesystem {
+AceSecurityStatus filesystemAceCheckAccessFunction(const char* functionName)
+{
+ return FILESYSTEM_CHECK_ACCESS(functionName);
+}
+
+DEFINE_GLOBAL_SECURITY_ACCESSOR(gSecurityAccessor);
+
+DEFINE_SECURITY_ACCESSOR_SETTER(AceCheckerFilesystemSetter, JSFilesystemManager::PrivateObject, gSecurityAccessor);
+DEFINE_JSOBJECT_SECURITY_ACCESSOR_SETTER(AceCheckerFilesystemConstructorSetter, gSecurityAccessor);
+
+class_definition_options_t FilesystemOptions =
+{
+ JS_CLASS,
+ CREATE_INSTANCE,
+ ALWAYS_NOTICE,
+ USE_OVERLAYED, //ignored
+ AceCheckerFilesystemSetter,
+ NULL
+};
+
void on_widget_start_callback(int widgetId)
{
TIME_TRACER_INIT();
} Catch (Commons::Exception) {
LoggerE("WrtAccess initialization failed");
}
+ INITAILIZE_GLOBAL_SECURITY_ACCESSOR(gSecurityAccessor, filesystemAceCheckAccessFunction);
}
void on_widget_stop_callback(int widgetId)
} Catch (Commons::Exception) {
LoggerE("WrtAccess deinitialization failed");
}
+ FINALIZE_GLOBAL_SECURITY_ACCESSOR(gSecurityAccessor);
}
void on_frame_unload_callback(const void * context)
PLUGIN_CLASS_MAP_ADD_CLASS(WRT_JS_EXTENSION_OBJECT_TIZEN,
"filesystem",
(js_class_template_getter)DeviceAPI::Filesystem::JSFilesystemManager::getClassRef,
- NULL)
+ &FilesystemOptions)
PLUGIN_CLASS_MAP_END
#undef FILESYSTEM