if ((m_data.m_uriList.find(wildString) ==
m_data.m_uriList.end())
&& (m_data.m_uriList.find(*m_value) ==
- m_data.m_uriList.end())) {
-
+ m_data.m_uriList.end())) {
+
m_data.m_uriList.insert(*m_value);
} else {
LogDebug("Ignoring uri with name" <<
if ((m_data.m_mimeList.find(wildString) ==
m_data.m_mimeList.end())
&& (m_data.m_mimeList.find(*m_value) ==
- m_data.m_mimeList.end())) {
+ m_data.m_mimeList.end())) {
m_data.m_mimeList.insert(*m_value);
} else {
LogDebug("Ignoring mime with name" <<
DPL::OptionalString m_value;
ConfigParserData::AppControlInfo& m_data;
};
-
+
virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
const DPL::String& name)
{
{
return ElementParserPtr(new MimeParser(m_appControl));
}
-
+
AppControlParser(ConfigParserData& data) :
ElementParser(),
m_data(data),
bool m_properNamespace;
};
+class CspParser : public ElementParser
+{
+ public:
+ virtual ActionFunc GetElementParser(const DPL::String& ns,
+ const DPL::String& name)
+ {
+ return &IgnoringParser::Create;
+ }
+
+ CspParser(ConfigParserData& data) :
+ ElementParser(),
+ m_data(data),
+ m_properNamespace(false)
+ {
+ }
+
+ virtual void Accept(const Element& element)
+ {
+ if (element.ns == ConfigurationNamespace::TizenWebAppNamespaceName)
+ {
+ m_properNamespace = true;
+ }
+ }
+
+ virtual void Accept(const XmlAttribute& attribute)
+ {
+ }
+
+ virtual void Accept(const Text& text)
+ {
+ if (m_properNamespace)
+ m_policy = text.value;
+ }
+
+ virtual void Verify()
+ {
+ if (!m_policy.IsNull())
+ m_data.cspPolicy = *m_policy;
+ }
+
+ private:
+ ConfigParserData& m_data;
+ bool m_properNamespace;
+ DPL::OptionalString m_policy;
+};
+
ElementParser::ActionFunc WidgetParser::GetElementParser(const DPL::String& /*ns*/,
const DPL::String& name)
m_map[L"category"] = DPL::MakeDelegate(this,
&WidgetParser::OnCategoryElement);
m_map[L"livebox"] = DPL::MakeDelegate(this, &WidgetParser::OnLiveboxElement);
-
+#ifdef CSP_ENABLED
+ m_map[L"Content-Security-Policy"] = DPL::MakeDelegate(this, &WidgetParser::OnCspElement);
+#endif
}
ElementParserPtr WidgetParser::OnNameElement()
return ElementParserPtr(new LiveboxParser(m_data));
}
+ElementParserPtr WidgetParser::OnCspElement()
+{
+ return ElementParserPtr(new CspParser(m_data));
+}
+
void WidgetParser::Accept(const Element& element)
{
if (element.ns != ConfigurationNamespace::W3CWidgetNamespaceName &&