[CSS Shapes] CORS-enabled fetch for shape image values
[WebKit-https.git] / Source / WebCore / loader / ResourceLoaderOptions.h
index a92fb22..8e1b74d 100644 (file)
@@ -31,6 +31,8 @@
 #ifndef ResourceLoaderOptions_h
 #define ResourceLoaderOptions_h
 
 #ifndef ResourceLoaderOptions_h
 #define ResourceLoaderOptions_h
 
+#include "ResourceHandleTypes.h"
+
 namespace WebCore {
     
 enum SendCallbackPolicy {
 namespace WebCore {
     
 enum SendCallbackPolicy {
@@ -48,12 +50,46 @@ enum DataBufferingPolicy {
     DoNotBufferData
 };
 
     DoNotBufferData
 };
 
+enum SecurityCheckPolicy {
+    SkipSecurityCheck,
+    DoSecurityCheck
+};
+
+enum RequestOriginPolicy {
+    UseDefaultOriginRestrictionsForType,
+    RestrictToSameOrigin,
+    PotentiallyCrossOriginEnabled // Indicates "potentially CORS-enabled fetch" in HTML standard.
+};
+
 struct ResourceLoaderOptions {
 struct ResourceLoaderOptions {
-    ResourceLoaderOptions() : sendLoadCallbacks(DoNotSendCallbacks), sniffContent(DoNotSniffContent), shouldBufferData(BufferData) { }
-    ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacksArg, ContentSniffingPolicy sniffContentArg, DataBufferingPolicy shouldBufferDataArg) : sendLoadCallbacks(sendLoadCallbacksArg), sniffContent(sniffContentArg), shouldBufferData(shouldBufferDataArg) { }
+    ResourceLoaderOptions()
+        : sendLoadCallbacks(DoNotSendCallbacks)
+        , sniffContent(DoNotSniffContent)
+        , dataBufferingPolicy(BufferData)
+        , allowCredentials(DoNotAllowStoredCredentials)
+        , clientCredentialPolicy(DoNotAskClientForAnyCredentials)
+        , securityCheck(DoSecurityCheck)
+        , requestOriginPolicy(UseDefaultOriginRestrictionsForType)
+    {
+    }
+
+    ResourceLoaderOptions(SendCallbackPolicy sendLoadCallbacks, ContentSniffingPolicy sniffContent, DataBufferingPolicy dataBufferingPolicy, StoredCredentials allowCredentials, ClientCredentialPolicy credentialPolicy, SecurityCheckPolicy securityCheck, RequestOriginPolicy requestOriginPolicy)
+        : sendLoadCallbacks(sendLoadCallbacks)
+        , sniffContent(sniffContent)
+        , dataBufferingPolicy(dataBufferingPolicy)
+        , allowCredentials(allowCredentials)
+        , clientCredentialPolicy(credentialPolicy)
+        , securityCheck(securityCheck)
+        , requestOriginPolicy(requestOriginPolicy)
+    {
+    }
     SendCallbackPolicy sendLoadCallbacks;
     ContentSniffingPolicy sniffContent;
     SendCallbackPolicy sendLoadCallbacks;
     ContentSniffingPolicy sniffContent;
-    DataBufferingPolicy shouldBufferData;
+    DataBufferingPolicy dataBufferingPolicy;
+    StoredCredentials allowCredentials; // Whether HTTP credentials and cookies are sent with the request.
+    ClientCredentialPolicy clientCredentialPolicy; // When we should ask the client for credentials (if we allow credentials at all).
+    SecurityCheckPolicy securityCheck;
+    RequestOriginPolicy requestOriginPolicy;
 };
 
 } // namespace WebCore    
 };
 
 } // namespace WebCore