[Release] wrt_0.8.191
[platform/framework/web/wrt.git] / src / api_new / ewk_context_manager.cpp
index bbc0dbe..cb1ecae 100644 (file)
@@ -144,6 +144,13 @@ bool EwkContextManager::initialize()
 
     setAutoFullscreenMode();
     setBackgroundSupport();
+#ifdef CSP_ENABLED
+    if (dao.getSecurityModelVersion() ==
+        WrtDB::WidgetSecurityModelVersion::WIDGET_SECURITY_MODEL_V2)
+    {
+        setCSPSupport();
+    }
+#endif
 
     // ewk storage_path set
     ewk_context_storage_path_reset(m_ewkContext);
@@ -236,6 +243,19 @@ void EwkContextManager::setBackgroundSupport()
         backgroundSupport);
 }
 
+void EwkContextManager::setCSPSupport()
+{
+    if(!m_ewkContext) {
+        return;
+    }
+
+    WrtDB::WidgetDAOReadOnly dao(DPL::FromUTF8String(m_appId));
+    LogInfo("Setting CSP default policy");
+    ewk_context_tizen_extensible_api_set(m_ewkContext,
+                                         EWK_EXTENSIBLE_API_CSP,
+                                         true);
+}
+
 void EwkContextManager::unsetCallbacks()
 {
     if (!m_initialized) {