DPL::OptionalString m_policy;
};
+class CspReportOnlyParser : public ElementParser
+{
+ public:
+ virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+ const DPL::String& /*name*/)
+ {
+ return &IgnoringParser::Create;
+ }
+
+ CspReportOnlyParser(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.cspPolicyReportOnly = *m_policy;
+ }
+ }
+
+ private:
+ ConfigParserData& m_data;
+ bool m_properNamespace;
+ DPL::OptionalString m_policy;
+};
+
ElementParser::ActionFunc WidgetParser::GetElementParser(
const DPL::String& /*ns*/,
const DPL::String&
this,
&WidgetParser::
OnCspElement);
+ m_map[L"Content-Security-Policy-Report-Only"] = DPL::MakeDelegate(
+ this,
+ &WidgetParser::
+ OnCspReportOnlyElement);
#endif
}
return ElementParserPtr(new CspParser(m_data));
}
+ElementParserPtr WidgetParser::OnCspReportOnlyElement()
+{
+ return ElementParserPtr(new CspReportOnlyParser(m_data));
+}
+
void WidgetParser::Accept(const Element& element)
{
if (element.ns != ConfigurationNamespace::W3CWidgetNamespaceName &&
ElementParserPtr OnCategoryElement();
ElementParserPtr OnLiveboxElement();
ElementParserPtr OnCspElement();
+ ElementParserPtr OnCspReportOnlyElement();
virtual ActionFunc GetElementParser(const DPL::String& ns,
const DPL::String& name);