Commit 50587b13 authored by rwlbuis@webkit.org's avatar rwlbuis@webkit.org

2012-02-03 Rob Buis <rbuis@rim.com>

        Upstream targetType usage on ResourceRequest for BlackBerry port
        https://bugs.webkit.org/show_bug.cgi?id=77649

        Reviewed by Antonio Gomes.

        Upstream bits that make use of targetType enum.

        * loader/PingLoader.cpp:
        (WebCore::PingLoader::loadImage):
        (WebCore::PingLoader::sendPing):
        (WebCore::PingLoader::reportContentSecurityPolicyViolation):
        * platform/network/blackberry/ResourceRequest.h:
        (ResourceRequest):
        (WebCore::ResourceRequest::targetType):
        (WebCore::ResourceRequest::setTargetType):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::createRequest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a8ca33b3
2012-02-03 Rob Buis <rbuis@rim.com>
Upstream targetType usage on ResourceRequest for BlackBerry port
https://bugs.webkit.org/show_bug.cgi?id=77649
Reviewed by Antonio Gomes.
Upstream bits that make use of targetType enum.
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage):
(WebCore::PingLoader::sendPing):
(WebCore::PingLoader::reportContentSecurityPolicyViolation):
* platform/network/blackberry/ResourceRequest.h:
(ResourceRequest):
(WebCore::ResourceRequest::targetType):
(WebCore::ResourceRequest::setTargetType):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
2012-02-03 Allan Sandfeld Jensen <allan.jensen@nokia.com>
Ensure timers and other active DOM objects do not fire in suspended documents.
......@@ -56,7 +56,7 @@ void PingLoader::loadImage(Frame* frame, const KURL& url)
}
ResourceRequest request(url);
#if PLATFORM(CHROMIUM)
#if PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY)
request.setTargetType(ResourceRequest::TargetIsImage);
#endif
request.setHTTPHeaderField("Cache-Control", "max-age=0");
......@@ -75,7 +75,7 @@ void PingLoader::loadImage(Frame* frame, const KURL& url)
void PingLoader::sendPing(Frame* frame, const KURL& pingURL, const KURL& destinationURL)
{
ResourceRequest request(pingURL);
#if PLATFORM(CHROMIUM)
#if PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY)
request.setTargetType(ResourceRequest::TargetIsSubresource);
#endif
request.setHTTPMethod("POST");
......@@ -106,7 +106,7 @@ void PingLoader::sendPing(Frame* frame, const KURL& pingURL, const KURL& destina
void PingLoader::reportContentSecurityPolicyViolation(Frame* frame, const KURL& reportURL, PassRefPtr<FormData> report)
{
ResourceRequest request(reportURL);
#if PLATFORM(CHROMIUM)
#if PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY)
request.setTargetType(ResourceRequest::TargetIsSubresource);
#endif
request.setHTTPMethod("POST");
......
......@@ -31,6 +31,26 @@ namespace WebCore {
class ResourceRequest : public 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,
TargetIsWorker,
TargetIsSharedWorker,
TargetIsPrefetch,
TargetIsPrerender,
TargetIsFavicon,
TargetIsXHR,
TargetIsTextTrack,
TargetIsUnspecified,
};
ResourceRequest(const String& url)
: ResourceRequestBase(KURL(ParsedURLString, url), UseProtocolCachePolicy)
, m_isXMLHTTPRequest(false)
......@@ -94,6 +114,10 @@ public:
void setForceDownload(bool forceDownload) { m_forceDownload = true; }
bool forceDownload() const { return m_forceDownload; }
// What this request is for.
TargetType targetType() const { return m_targetType; }
void setTargetType(TargetType type) { m_targetType = type; }
private:
friend class ResourceRequestBase;
......@@ -104,6 +128,7 @@ private:
bool m_mustHandleInternally;
bool m_isRequestedByPlugin;
bool m_forceDownload;
TargetType m_targetType;
void doUpdatePlatformRequest() { }
void doUpdateResourceRequest() { }
......
......@@ -670,7 +670,7 @@ void XMLHttpRequest::createRequest(ExceptionCode& ec)
ResourceRequest request(m_url);
request.setHTTPMethod(m_method);
#if PLATFORM(CHROMIUM)
#if PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY)
request.setTargetType(ResourceRequest::TargetIsXHR);
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment