OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #include "core/fetch/ResourceLoaderOptions.h" | 30 #include "core/fetch/ResourceLoaderOptions.h" |
31 #include "platform/network/ResourceRequest.h" | 31 #include "platform/network/ResourceRequest.h" |
32 #include "wtf/Forward.h" | 32 #include "wtf/Forward.h" |
33 #include "wtf/HashSet.h" | 33 #include "wtf/HashSet.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 typedef HashSet<String, CaseFoldingHash> HTTPHeaderSet; | 37 typedef HashSet<String, CaseFoldingHash> HTTPHeaderSet; |
38 | 38 |
39 class HTTPHeaderMap; | |
40 class Resource; | 39 class Resource; |
41 struct ResourceLoaderOptions; | 40 struct ResourceLoaderOptions; |
42 class ResourceRequest; | 41 class ResourceRequest; |
43 class ResourceResponse; | 42 class ResourceResponse; |
44 class SecurityOrigin; | 43 class SecurityOrigin; |
45 | 44 |
46 enum AccessControlStatus { | 45 enum AccessControlStatus { |
47 NotSharableCrossOrigin, | 46 NotSharableCrossOrigin, |
48 SharableCrossOrigin | 47 SharableCrossOrigin |
49 }; | 48 }; |
50 | 49 |
51 class CrossOriginAccessControl { | 50 class CrossOriginAccessControl { |
52 public: | 51 public: |
53 static bool isLegalRedirectLocation(const KURL&, String& errorDescription); | 52 static bool isLegalRedirectLocation(const KURL&, String& errorDescription); |
54 static bool handleRedirect(Resource*, SecurityOrigin*, ResourceRequest&, con
st ResourceResponse&, ResourceLoaderOptions&, String&); | 53 static bool handleRedirect(Resource*, SecurityOrigin*, ResourceRequest&, con
st ResourceResponse&, ResourceLoaderOptions&, String&); |
55 }; | 54 }; |
56 | 55 |
57 bool isOnAccessControlResponseHeaderWhitelist(const String&); | 56 bool isOnAccessControlResponseHeaderWhitelist(const String&); |
58 | 57 |
59 void updateRequestForAccessControl(ResourceRequest&, SecurityOrigin*, StoredCred
entials); | 58 void updateRequestForAccessControl(ResourceRequest&, SecurityOrigin*, StoredCred
entials); |
60 ResourceRequest createAccessControlPreflightRequest(const ResourceRequest&, Secu
rityOrigin*); | 59 ResourceRequest createAccessControlPreflightRequest(const ResourceRequest&, Secu
rityOrigin*); |
61 | 60 |
62 bool passesAccessControlCheck(const ResourceResponse&, StoredCredentials, Securi
tyOrigin*, String& errorDescription); | 61 bool passesAccessControlCheck(const ResourceResponse&, StoredCredentials, Securi
tyOrigin*, String& errorDescription); |
63 bool passesPreflightStatusCheck(const ResourceResponse&, String& errorDescriptio
n); | 62 bool passesPreflightStatusCheck(const ResourceResponse&, String& errorDescriptio
n); |
64 void parseAccessControlExposeHeadersAllowList(const String& headerValue, HTTPHea
derSet&); | 63 void parseAccessControlExposeHeadersAllowList(const String& headerValue, HTTPHea
derSet&); |
65 | 64 |
66 } // namespace blink | 65 } // namespace blink |
67 | 66 |
68 #endif // CrossOriginAccessControl_h | 67 #endif // CrossOriginAccessControl_h |
OLD | NEW |