#ifndef ResourceLoaderOptions_h
#define ResourceLoaderOptions_h
#include "core/fetch/FetchInitiatorInfo.h"
#include "platform/weborigin/SecurityOrigin.h"
namespace WebCore {
enum ContentSniffingPolicy {
SniffContent,
DoNotSniffContent
};
enum DataBufferingPolicy {
BufferData,
DoNotBufferData
};
enum ContentSecurityPolicyCheck {
CheckContentSecurityPolicy,
DoNotCheckContentSecurityPolicy
};
enum RequestInitiatorContext {
DocumentContext,
WorkerContext,
};
enum StoredCredentials {
AllowStoredCredentials,
DoNotAllowStoredCredentials
};
enum CredentialRequest {
ClientRequestedCredentials,
ClientDidNotRequestCredentials
};
enum MixedContentBlockingTreatment {
TreatAsDefaultForType,
TreatAsPassiveContent,
TreatAsActiveContent,
TreatAsAlwaysAllowedContent
};
enum SynchronousPolicy {
RequestSynchronously,
RequestAsynchronously
};
enum CORSEnabled {
NotCORSEnabled,
IsCORSEnabled
};
struct ResourceLoaderOptions {
ResourceLoaderOptions()
: sniffContent(DoNotSniffContent)
, dataBufferingPolicy(BufferData)
, allowCredentials(DoNotAllowStoredCredentials)
, credentialsRequested(ClientDidNotRequestCredentials)
, contentSecurityPolicyOption(CheckContentSecurityPolicy)
, requestInitiatorContext(DocumentContext)
, mixedContentBlockingTreatment(TreatAsDefaultForType)
, synchronousPolicy(RequestAsynchronously)
, corsEnabled(NotCORSEnabled)
{
}
ResourceLoaderOptions(
ContentSniffingPolicy sniffContent,
DataBufferingPolicy dataBufferingPolicy,
StoredCredentials allowCredentials,
CredentialRequest credentialsRequested,
ContentSecurityPolicyCheck contentSecurityPolicyOption,
RequestInitiatorContext requestInitiatorContext)
: sniffContent(sniffContent)
, dataBufferingPolicy(dataBufferingPolicy)
, allowCredentials(allowCredentials)
, credentialsRequested(credentialsRequested)
, contentSecurityPolicyOption(contentSecurityPolicyOption)
, requestInitiatorContext(requestInitiatorContext)
, mixedContentBlockingTreatment(TreatAsDefaultForType)
, synchronousPolicy(RequestAsynchronously)
, corsEnabled(NotCORSEnabled)
{
}
ContentSniffingPolicy sniffContent;
DataBufferingPolicy dataBufferingPolicy;
StoredCredentials allowCredentials;
CredentialRequest credentialsRequested;
ContentSecurityPolicyCheck contentSecurityPolicyOption;
FetchInitiatorInfo initiatorInfo;
RequestInitiatorContext requestInitiatorContext;
MixedContentBlockingTreatment mixedContentBlockingTreatment;
SynchronousPolicy synchronousPolicy;
CORSEnabled corsEnabled;
RefPtr<SecurityOrigin> securityOrigin;
};
}
#endif