summaryrefslogtreecommitdiff
path: root/Source/WebCore/loader/ThreadableLoader.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/loader/ThreadableLoader.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/loader/ThreadableLoader.h')
-rw-r--r--Source/WebCore/loader/ThreadableLoader.h50
1 files changed, 24 insertions, 26 deletions
diff --git a/Source/WebCore/loader/ThreadableLoader.h b/Source/WebCore/loader/ThreadableLoader.h
index 0c9a0f253..e924b240a 100644
--- a/Source/WebCore/loader/ThreadableLoader.h
+++ b/Source/WebCore/loader/ThreadableLoader.h
@@ -28,18 +28,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ThreadableLoader_h
-#define ThreadableLoader_h
+#pragma once
#include "ResourceLoaderOptions.h"
#include <wtf/Noncopyable.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-
-#if ENABLE(RESOURCE_TIMING)
#include <wtf/text/AtomicString.h>
-#endif
namespace WebCore {
@@ -47,14 +41,7 @@ namespace WebCore {
class ResourceRequest;
class ResourceResponse;
class ScriptExecutionContext;
- class SecurityOrigin;
class ThreadableLoaderClient;
-
- enum CrossOriginRequestPolicy {
- DenyCrossOriginRequests,
- UseAccessControl,
- AllowCrossOriginRequests
- };
enum PreflightPolicy {
ConsiderPreflight,
@@ -62,30 +49,43 @@ namespace WebCore {
PreventPreflight
};
- struct ThreadableLoaderOptions : public ResourceLoaderOptions {
+ enum class ContentSecurityPolicyEnforcement {
+ DoNotEnforce,
+ EnforceChildSrcDirective,
+ EnforceConnectSrcDirective,
+ EnforceScriptSrcDirective,
+ };
+
+ enum class ResponseFilteringPolicy {
+ Enable,
+ Disable,
+ };
+
+ struct ThreadableLoaderOptions : ResourceLoaderOptions {
ThreadableLoaderOptions();
+ ThreadableLoaderOptions(const ResourceLoaderOptions&, PreflightPolicy, ContentSecurityPolicyEnforcement, String&& initiator, ResponseFilteringPolicy);
~ThreadableLoaderOptions();
- PreflightPolicy preflightPolicy; // If AccessControl is used, how to determine if a preflight is needed.
- CrossOriginRequestPolicy crossOriginRequestPolicy;
- RefPtr<SecurityOrigin> securityOrigin;
-#if ENABLE(RESOURCE_TIMING)
- AtomicString initiator;
-#endif
+ PreflightPolicy preflightPolicy { ConsiderPreflight };
+ ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement { ContentSecurityPolicyEnforcement::EnforceConnectSrcDirective };
+ String initiator; // This cannot be an AtomicString, as isolatedCopy() wouldn't create an object that's safe for passing to another thread.
+ ResponseFilteringPolicy filteringPolicy { ResponseFilteringPolicy::Disable };
};
- // Useful for doing loader operations from any thread (not threadsafe,
+ // Useful for doing loader operations from any thread (not threadsafe,
// just able to run on threads other than the main thread).
class ThreadableLoader {
WTF_MAKE_NONCOPYABLE(ThreadableLoader);
public:
- static void loadResourceSynchronously(ScriptExecutionContext*, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
- static PassRefPtr<ThreadableLoader> create(ScriptExecutionContext*, ThreadableLoaderClient*, const ResourceRequest&, const ThreadableLoaderOptions&);
+ static void loadResourceSynchronously(ScriptExecutionContext&, ResourceRequest&&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
+ static RefPtr<ThreadableLoader> create(ScriptExecutionContext&, ThreadableLoaderClient&, ResourceRequest&&, const ThreadableLoaderOptions&, String&& referrer = String());
virtual void cancel() = 0;
void ref() { refThreadableLoader(); }
void deref() { derefThreadableLoader(); }
+ static void logError(ScriptExecutionContext&, const ResourceError&, const String&);
+
protected:
ThreadableLoader() { }
virtual ~ThreadableLoader() { }
@@ -94,5 +94,3 @@ namespace WebCore {
};
} // namespace WebCore
-
-#endif // ThreadableLoader_h