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 };
struct ResourceLoaderOptions {
ResourceLoaderOptions()
: m_sendLoadCallbacks(DoNotSendCallbacks)
, m_sniffContent(DoNotSniffContent)
, m_dataBufferingPolicy(BufferData)
, m_allowCredentials(DoNotAllowStoredCredentials)
, m_clientCredentialPolicy(DoNotAskClientForAnyCredentials)
, m_securityCheck(DoSecurityCheck)
, m_requestOriginPolicy(UseDefaultOriginRestrictionsForType)
{
}
ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacks, ContentSniffingPolicy sniffContent, DataBufferingPolicy dataBufferingPolicy, StoredCredentials allowCredentials, ClientCredentialPolicy credentialPolicy, SecurityCheckPolicy securityCheck, RequestOriginPolicy requestOriginPolicy)
: m_sendLoadCallbacks(sendLoadCallbacks)
, m_sniffContent(sniffContent)
, m_dataBufferingPolicy(dataBufferingPolicy)
, m_allowCredentials(allowCredentials)
, m_clientCredentialPolicy(credentialPolicy)
, m_securityCheck(securityCheck)
, m_requestOriginPolicy(requestOriginPolicy)
{
}
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; }
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;
};
}
#endif // ResourceLoaderOptions_h