ResourceLoaderOptions.h [plain text]
#ifndef ResourceLoaderOptions_h
#define ResourceLoaderOptions_h
#include "ResourceHandleTypes.h"
namespace WebCore {
enum SendCallbackPolicy {
SendCallbacks,
DoNotSendCallbacks
};
enum ContentSniffingPolicy {
SniffContent,
DoNotSniffContent
};
enum DataBufferingPolicy {
BufferData,
DoNotBufferData
};
enum SecurityCheckPolicy {
SkipSecurityCheck,
DoSecurityCheck
};
enum RequestOriginPolicy {
UseDefaultOriginRestrictionsForType,
RestrictToSameOrigin,
PotentiallyCrossOriginEnabled };
enum CertificateInfoPolicy {
IncludeCertificateInfo,
DoNotIncludeCertificateInfo
};
enum class ContentSecurityPolicyImposition : uint8_t {
SkipPolicyCheck,
DoPolicyCheck
};
struct ResourceLoaderOptions {
ResourceLoaderOptions()
: m_sendLoadCallbacks(DoNotSendCallbacks)
, m_sniffContent(DoNotSniffContent)
, m_dataBufferingPolicy(BufferData)
, m_allowCredentials(DoNotAllowStoredCredentials)
, m_clientCredentialPolicy(DoNotAskClientForAnyCredentials)
, m_securityCheck(DoSecurityCheck)
, m_requestOriginPolicy(UseDefaultOriginRestrictionsForType)
, m_certificateInfoPolicy(DoNotIncludeCertificateInfo)
{
}
ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacks, ContentSniffingPolicy sniffContent, DataBufferingPolicy dataBufferingPolicy, StoredCredentials allowCredentials, ClientCredentialPolicy credentialPolicy, SecurityCheckPolicy securityCheck, RequestOriginPolicy requestOriginPolicy, CertificateInfoPolicy certificateInfoPolicy, ContentSecurityPolicyImposition contentSecurityPolicyImposition)
: m_sendLoadCallbacks(sendLoadCallbacks)
, m_sniffContent(sniffContent)
, m_dataBufferingPolicy(dataBufferingPolicy)
, m_allowCredentials(allowCredentials)
, m_clientCredentialPolicy(credentialPolicy)
, m_securityCheck(securityCheck)
, m_requestOriginPolicy(requestOriginPolicy)
, m_certificateInfoPolicy(certificateInfoPolicy)
, m_contentSecurityPolicyImposition(contentSecurityPolicyImposition)
{
}
SendCallbackPolicy sendLoadCallbacks() const { return static_cast<SendCallbackPolicy>(m_sendLoadCallbacks); }
void setSendLoadCallbacks(SendCallbackPolicy allow) { m_sendLoadCallbacks = allow; }
ContentSniffingPolicy sniffContent() const { return static_cast<ContentSniffingPolicy>(m_sniffContent); }
void setSniffContent(ContentSniffingPolicy policy) { m_sniffContent = policy; }
DataBufferingPolicy dataBufferingPolicy() const { return static_cast<DataBufferingPolicy>(m_dataBufferingPolicy); }
void setDataBufferingPolicy(DataBufferingPolicy policy) { m_dataBufferingPolicy = policy; }
StoredCredentials allowCredentials() const { return static_cast<StoredCredentials>(m_allowCredentials); }
void setAllowCredentials(StoredCredentials allow) { m_allowCredentials = allow; }
ClientCredentialPolicy clientCredentialPolicy() const { return static_cast<ClientCredentialPolicy>(m_clientCredentialPolicy); }
void setClientCredentialPolicy(ClientCredentialPolicy policy) { m_clientCredentialPolicy = policy; }
SecurityCheckPolicy securityCheck() const { return static_cast<SecurityCheckPolicy>(m_securityCheck); }
void setSecurityCheck(SecurityCheckPolicy check) { m_securityCheck = check; }
RequestOriginPolicy requestOriginPolicy() const { return static_cast<RequestOriginPolicy>(m_requestOriginPolicy); }
void setRequestOriginPolicy(RequestOriginPolicy policy) { m_requestOriginPolicy = policy; }
CertificateInfoPolicy certificateInfoPolicy() const { return static_cast<CertificateInfoPolicy>(m_certificateInfoPolicy); }
void setCertificateInfoPolicy(CertificateInfoPolicy policy) { m_certificateInfoPolicy = policy; }
ContentSecurityPolicyImposition contentSecurityPolicyImposition() const { return m_contentSecurityPolicyImposition; }
void setContentSecurityPolicyImposition(ContentSecurityPolicyImposition imposition) { m_contentSecurityPolicyImposition = imposition; }
unsigned m_sendLoadCallbacks : 1;
unsigned m_sniffContent : 1;
unsigned m_dataBufferingPolicy : 1;
unsigned m_allowCredentials : 1; unsigned m_clientCredentialPolicy : 2; unsigned m_securityCheck : 1;
unsigned m_requestOriginPolicy : 2;
unsigned m_certificateInfoPolicy : 1; ContentSecurityPolicyImposition m_contentSecurityPolicyImposition { ContentSecurityPolicyImposition::DoPolicyCheck };
};
}
#endif // ResourceLoaderOptions_h