Title: [99015] trunk/Source
Revision
99015
Author
[email protected]
Date
2011-11-01 17:09:18 -0700 (Tue, 01 Nov 2011)

Log Message

Source/WebCore: [chromium] As of r98380, ThreadableLoaderClients are having their
ResourceRequest::TargetType clobbered. They set their own
type, but CachedResourceRequest (through which they now flow)
sets a TargetType without bothering to see if one has already been set.
https://bugs.webkit.org/show_bug.cgi?id=70972

Reviewed by Darin Fisher.

No new tests, this is chromium-specific and only affects
behavior seen in full builds of chromium.

* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::load):Don't setTargetType()
    if the value is something other than the default already.
* platform/network/chromium/ResourceRequest.h: Change default
    TargetType to TargetIsUnspecified.

Source/WebKit/chromium: Add 2 new TargetTypes (to match ResourceRequest::TargetType)
and ensure we don't pass chromium a TargetType it doesn't
yet understand.
https://bugs.webkit.org/show_bug.cgi?id=70972

Reviewed by Darin Fisher.

* public/WebURLRequest.h:
* src/WebURLRequest.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (99014 => 99015)


--- trunk/Source/WebCore/ChangeLog	2011-11-02 00:08:04 UTC (rev 99014)
+++ trunk/Source/WebCore/ChangeLog	2011-11-02 00:09:18 UTC (rev 99015)
@@ -1,3 +1,22 @@
+2011-11-01  Nate Chapin  <[email protected]>
+
+        [chromium] As of r98380, ThreadableLoaderClients are having their
+        ResourceRequest::TargetType clobbered. They set their own
+        type, but CachedResourceRequest (through which they now flow)
+        sets a TargetType without bothering to see if one has already been set.
+        https://bugs.webkit.org/show_bug.cgi?id=70972
+
+        Reviewed by Darin Fisher.
+
+        No new tests, this is chromium-specific and only affects
+        behavior seen in full builds of chromium.
+
+        * loader/cache/CachedResourceRequest.cpp:
+        (WebCore::CachedResourceRequest::load):Don't setTargetType()
+            if the value is something other than the default already.
+        * platform/network/chromium/ResourceRequest.h: Change default
+            TargetType to TargetIsUnspecified.
+
 2011-11-01  Emil A Eklund  <[email protected]>
 
         Use IntPoint for screen coordinates in MouseEvent

Modified: trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp (99014 => 99015)


--- trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp	2011-11-02 00:08:04 UTC (rev 99014)
+++ trunk/Source/WebCore/loader/cache/CachedResourceRequest.cpp	2011-11-02 00:09:18 UTC (rev 99015)
@@ -100,7 +100,8 @@
 
     ResourceRequest resourceRequest = resource->resourceRequest();
 #if PLATFORM(CHROMIUM)
-    resourceRequest.setTargetType(cachedResourceTypeToTargetType(resource->type()));
+    if (resourceRequest.targetType() == ResourceRequest::TargetIsUnspecified)
+        resourceRequest.setTargetType(cachedResourceTypeToTargetType(resource->type()));
 #endif
 
     if (!resource->accept().isEmpty())

Modified: trunk/Source/WebCore/platform/network/chromium/ResourceRequest.h (99014 => 99015)


--- trunk/Source/WebCore/platform/network/chromium/ResourceRequest.h	2011-11-02 00:08:04 UTC (rev 99014)
+++ trunk/Source/WebCore/platform/network/chromium/ResourceRequest.h	2011-11-02 00:09:18 UTC (rev 99015)
@@ -57,6 +57,7 @@
             TargetIsFavicon,
             TargetIsXHR,
             TargetIsTextTrack,
+            TargetIsUnspecified,
         };
 
         class ExtraData : public RefCounted<ExtraData> {
@@ -71,7 +72,7 @@
             , m_appCacheHostID(0)
             , m_hasUserGesture(false)
             , m_downloadToFile(false)
-            , m_targetType(TargetIsSubresource)
+            , m_targetType(TargetIsUnspecified)
         {
         }
 
@@ -82,7 +83,7 @@
             , m_appCacheHostID(0)
             , m_hasUserGesture(false)
             , m_downloadToFile(false)
-            , m_targetType(TargetIsSubresource)
+            , m_targetType(TargetIsUnspecified)
         {
         }
 
@@ -93,7 +94,7 @@
             , m_appCacheHostID(0)
             , m_hasUserGesture(false)
             , m_downloadToFile(false)
-            , m_targetType(TargetIsSubresource)
+            , m_targetType(TargetIsUnspecified)
         {
             setHTTPReferrer(referrer);
         }
@@ -105,7 +106,7 @@
             , m_appCacheHostID(0)
             , m_hasUserGesture(false)
             , m_downloadToFile(false)
-            , m_targetType(TargetIsSubresource)
+            , m_targetType(TargetIsUnspecified)
         {
         }
 

Modified: trunk/Source/WebKit/chromium/ChangeLog (99014 => 99015)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-11-02 00:08:04 UTC (rev 99014)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-11-02 00:09:18 UTC (rev 99015)
@@ -1,3 +1,15 @@
+2011-11-01  Nate Chapin  <[email protected]>
+
+        Add 2 new TargetTypes (to match ResourceRequest::TargetType)
+        and ensure we don't pass chromium a TargetType it doesn't
+        yet understand.
+        https://bugs.webkit.org/show_bug.cgi?id=70972
+
+        Reviewed by Darin Fisher.
+
+        * public/WebURLRequest.h:
+        * src/WebURLRequest.cpp:
+
 2011-11-01  Tommy Widenflycht  <[email protected]>
 
         [chromium] Media Stream API: Adding supporting classes to WebPeerConnectionHandler

Modified: trunk/Source/WebKit/chromium/public/WebURLRequest.h (99014 => 99015)


--- trunk/Source/WebKit/chromium/public/WebURLRequest.h	2011-11-02 00:08:04 UTC (rev 99014)
+++ trunk/Source/WebKit/chromium/public/WebURLRequest.h	2011-11-02 00:09:18 UTC (rev 99015)
@@ -72,6 +72,8 @@
         TargetIsPrerender = 12,
         TargetIsFavicon = 13,
         TargetIsXHR = 14,
+        TargetIsTextTrack = 15,
+        TargetIsUnspecified = 16,
     };
 
     class ExtraData {

Modified: trunk/Source/WebKit/chromium/src/WebURLRequest.cpp (99014 => 99015)


--- trunk/Source/WebKit/chromium/src/WebURLRequest.cpp	2011-11-02 00:08:04 UTC (rev 99014)
+++ trunk/Source/WebKit/chromium/src/WebURLRequest.cpp	2011-11-02 00:09:18 UTC (rev 99015)
@@ -241,7 +241,11 @@
 
 WebURLRequest::TargetType WebURLRequest::targetType() const
 {
-    return static_cast<TargetType>(m_private->m_resourceRequest->targetType());
+    // FIXME: Temporary special case until downstream chromium.org knows of the new TargetTypes.
+    TargetType targetType = static_cast<TargetType>(m_private->m_resourceRequest->targetType());
+    if (targetType == TargetIsTextTrack || targetType == TargetIsUnspecified)
+        return TargetIsSubresource;
+    return targetType;
 }
 
 bool WebURLRequest::hasUserGesture() const
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to