summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/network/ResourceRequestBase.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/network/ResourceRequestBase.h')
-rw-r--r--WebCore/platform/network/ResourceRequestBase.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/WebCore/platform/network/ResourceRequestBase.h b/WebCore/platform/network/ResourceRequestBase.h
index 84a7bd0..931a9de 100644
--- a/WebCore/platform/network/ResourceRequestBase.h
+++ b/WebCore/platform/network/ResourceRequestBase.h
@@ -46,12 +46,25 @@ namespace WebCore {
const int unspecifiedTimeoutInterval = INT_MAX;
- struct ResourceRequest;
+ class ResourceRequest;
struct CrossThreadResourceRequestData;
// Do not use this type directly. Use ResourceRequest instead.
class ResourceRequestBase {
public:
+ // The type of this ResourceRequest, based on how the resource will be used.
+ enum TargetType {
+ TargetIsMainFrame,
+ TargetIsSubframe,
+ TargetIsSubresource, // Resource is a generic subresource. (Generally a specific type should be specified)
+ TargetIsStyleSheet,
+ TargetIsScript,
+ TargetIsFontResource,
+ TargetIsImage,
+ TargetIsObject,
+ TargetIsMedia
+ };
+
static std::auto_ptr<ResourceRequest> adopt(std::auto_ptr<CrossThreadResourceRequestData>);
// Gets a copy of the data suitable for passing to another thread.
@@ -79,7 +92,9 @@ namespace WebCore {
const HTTPHeaderMap& httpHeaderFields() const;
String httpHeaderField(const AtomicString& name) const;
+ String httpHeaderField(const char* name) const;
void setHTTPHeaderField(const AtomicString& name, const String& value);
+ void setHTTPHeaderField(const char* name, const String& value);
void addHTTPHeaderField(const AtomicString& name, const String& value);
void addHTTPHeaderFields(const HTTPHeaderMap& headerFields);
@@ -115,12 +130,17 @@ namespace WebCore {
bool reportUploadProgress() const { return m_reportUploadProgress; }
void setReportUploadProgress(bool reportUploadProgress) { m_reportUploadProgress = reportUploadProgress; }
+ // What this request is for.
+ TargetType targetType() const { return m_targetType; }
+ void setTargetType(TargetType type) { m_targetType = type; }
+
protected:
// Used when ResourceRequest is initialized from a platform representation of the request
ResourceRequestBase()
: m_resourceRequestUpdated(false)
, m_platformRequestUpdated(true)
, m_reportUploadProgress(false)
+ , m_targetType(TargetIsSubresource)
{
}
@@ -133,6 +153,7 @@ namespace WebCore {
, m_resourceRequestUpdated(true)
, m_platformRequestUpdated(false)
, m_reportUploadProgress(false)
+ , m_targetType(TargetIsSubresource)
{
}
@@ -152,6 +173,7 @@ namespace WebCore {
mutable bool m_resourceRequestUpdated;
mutable bool m_platformRequestUpdated;
bool m_reportUploadProgress;
+ TargetType m_targetType;
private:
const ResourceRequest& asResourceRequest() const;
@@ -162,7 +184,7 @@ namespace WebCore {
bool operator==(const ResourceRequestBase&, const ResourceRequestBase&);
inline bool operator!=(ResourceRequestBase& a, const ResourceRequestBase& b) { return !(a == b); }
- struct CrossThreadResourceRequestData {
+ struct CrossThreadResourceRequestData : Noncopyable {
KURL m_url;
ResourceRequestCachePolicy m_cachePolicy;