Title: [106655] trunk/Source/WebCore
Revision
106655
Author
rwlb...@webkit.org
Date
2012-02-03 06:05:32 -0800 (Fri, 03 Feb 2012)

Log Message

2012-02-03  Rob Buis  <rb...@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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106654 => 106655)


--- trunk/Source/WebCore/ChangeLog	2012-02-03 13:42:20 UTC (rev 106654)
+++ trunk/Source/WebCore/ChangeLog	2012-02-03 14:05:32 UTC (rev 106655)
@@ -1,3 +1,23 @@
+2012-02-03  Rob Buis  <rb...@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.jen...@nokia.com>
 
         Ensure timers and other active DOM objects do not fire in suspended documents.

Modified: trunk/Source/WebCore/loader/PingLoader.cpp (106654 => 106655)


--- trunk/Source/WebCore/loader/PingLoader.cpp	2012-02-03 13:42:20 UTC (rev 106654)
+++ trunk/Source/WebCore/loader/PingLoader.cpp	2012-02-03 14:05:32 UTC (rev 106655)
@@ -56,7 +56,7 @@
     }
 
     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::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::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");

Modified: trunk/Source/WebCore/platform/network/blackberry/ResourceRequest.h (106654 => 106655)


--- trunk/Source/WebCore/platform/network/blackberry/ResourceRequest.h	2012-02-03 13:42:20 UTC (rev 106654)
+++ trunk/Source/WebCore/platform/network/blackberry/ResourceRequest.h	2012-02-03 14:05:32 UTC (rev 106655)
@@ -31,6 +31,26 @@
 
 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 @@
     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 @@
     bool m_mustHandleInternally;
     bool m_isRequestedByPlugin;
     bool m_forceDownload;
+    TargetType m_targetType;
 
     void doUpdatePlatformRequest() { }
     void doUpdateResourceRequest() { }

Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (106654 => 106655)


--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2012-02-03 13:42:20 UTC (rev 106654)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2012-02-03 14:05:32 UTC (rev 106655)
@@ -670,7 +670,7 @@
 
     ResourceRequest request(m_url);
     request.setHTTPMethod(m_method);
-#if PLATFORM(CHROMIUM)
+#if PLATFORM(CHROMIUM) || PLATFORM(BLACKBERRY)
     request.setTargetType(ResourceRequest::TargetIsXHR);
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to