merge with master
[platform/framework/web/wrt-plugins-common.git] / src / js-overlay / JSClass / JSStorageEvent.cpp
index 09c49ce..489656e 100644 (file)
@@ -41,31 +41,31 @@ using namespace WrtDeviceApis::StorageEvent::Api;
 #define WRT_STORAGE_EVENT_PROPERTY_STORAGE_AREA "storageArea"
 
 #define CATCH_EXCEPTION_CONVERSION \
-    Catch(Commons::ConversionException) {\
-        LogError("Error on conversion");\
-        return JSDOMExceptionFactory::\
-            UnknownException.make(context, exception);\
+    Catch(Commons::ConversionException) { \
+        LogError("Error on conversion"); \
+        return JSDOMExceptionFactory:: \
+                   UnknownException.make(context, exception); \
     }
 
 #define CATCH_EXCEPTION_NULL_PTR \
-    Catch(Commons::NullPointerException) {\
-        LogError("Error on pointer, null value");\
-        return JSDOMExceptionFactory::\
-            UnknownException.make(context, exception);\
+    Catch(Commons::NullPointerException) { \
+        LogError("Error on pointer, null value"); \
+        return JSDOMExceptionFactory:: \
+                   UnknownException.make(context, exception); \
     }
 
 #define CATCH_EXCEPTION_PLATFORM_ERROR \
-    Catch(Commons::PlatformException){\
-        LogError("PlatformException occured");\
-        return JSDOMExceptionFactory::\
-            UnknownException.make(context, exception);\
+    Catch(Commons::PlatformException){ \
+        LogError("PlatformException occured"); \
+        return JSDOMExceptionFactory:: \
+                   UnknownException.make(context, exception); \
     }
 
 #define CATCH_EXCEPTION_SECURITY \
-    Catch(Commons::SecurityException){\
-        LogError("Security exception occured");\
-        return JSDOMExceptionFactory::\
-            SecurityException.make(context, exception);\
+    Catch(Commons::SecurityException){ \
+        LogError("Security exception occured"); \
+        return JSDOMExceptionFactory:: \
+                   SecurityException.make(context, exception); \
     }
 
 namespace WrtPlugins {
@@ -104,7 +104,7 @@ JSStaticValue JSStorageEvent::m_property[] = {
     { 0, 0, 0, 0 }
 };
 
-const JSClassRef JSStorageEvent::getClassRef()
+JSClassRef JSStorageEvent::getClassRef()
 {
     if (!m_jsClassRef) {
         m_jsClassRef = JSClassCreate(&m_classInfo);
@@ -117,9 +117,10 @@ const JSClassDefinition* JSStorageEvent::getClassInfo()
     return &m_classInfo;
 }
 
-JSClassRef JSStorageEvent::m_jsClassRef = JSClassCreate(JSStorageEvent::getClassInfo());
+JSClassRef JSStorageEvent::m_jsClassRef = JSClassCreate(
+        JSStorageEvent::getClassInfo());
 
-void JSStorageEvent::initialize(JSContextRef context,
+void JSStorageEvent::initialize(JSContextRef /*context*/,
                                 JSObjectRef object)
 {
     LogDebug("entered");
@@ -138,14 +139,13 @@ void JSStorageEvent::finalize(JSObjectRef object)
 
     delete priv;
     LogDebug("private object is realised");
-
 }
 
 JSValueRef JSStorageEvent::getKey(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -154,19 +154,18 @@ JSValueRef JSStorageEvent::getKey(
         Converter converter(context);
 
         return converter.toJSValueRef(getPrivateObject(object)->getKey());
-
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 }
 
 JSValueRef JSStorageEvent::getOldValue(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -176,24 +175,23 @@ JSValueRef JSStorageEvent::getOldValue(
 
         DPL::OptionalString oldValue = getPrivateObject(object)->getOldValue();
 
-        if(!oldValue) {
+        if (!oldValue) {
             return JSValueMakeNull(context);
         } else {
             return converter.toJSValueRef(DPL::ToUTF8String(*oldValue));
         }
-
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 }
 
 JSValueRef JSStorageEvent::getNewValue(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -203,24 +201,23 @@ JSValueRef JSStorageEvent::getNewValue(
 
         DPL::OptionalString newValue = getPrivateObject(object)->getNewValue();
 
-        if(!newValue) {
+        if (!newValue) {
             return JSValueMakeNull(context);
         } else {
             return converter.toJSValueRef(DPL::ToUTF8String(*newValue));
         }
-
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 }
 
 JSValueRef JSStorageEvent::getUrl(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -229,17 +226,16 @@ JSValueRef JSStorageEvent::getUrl(
         Converter converter(context);
 
         return converter.toJSValueRef(getPrivateObject(object)->getUrl());
-
     }
     CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
+        CATCH_EXCEPTION_NULL_PTR
 }
 
 JSValueRef JSStorageEvent::getStorageArea(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef /*object*/,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -251,7 +247,7 @@ JSValueRef JSStorageEvent::getStorageArea(
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 }
 
 IStorageEventPtr JSStorageEvent::getPrivateObject(JSObjectRef arg)
@@ -272,6 +268,5 @@ IStorageEventPtr JSStorageEvent::getPrivateObject(JSObjectRef arg)
 #undef CATCH_EXCEPTION_NULL_PTR
 #undef CATCH_EXCEPTION_PLATFORM_ERROR
 #undef CATCH_EXCEPTION_SECURITY
-
 }
 }