[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:27:54 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 21a3c410ead79eee87f84bae9623b1afb5d54b99
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 8 17:04:59 2009 +0000

    2009-12-08  Mike Belshe  <mike at belshe.com>
    
            Reviewed by Darin Fisher.
    
            https://bugs.webkit.org/show_bug.cgi?id=32152
            Update the ResourceRequest::RequestType.  This previously
            was specific to Chromium.  Moved into ResourceRequestBase, enabling
            more specificity about the type (which is otherwise only known to the
            loader), and also making this information available to all platforms.
            Any platform with a network layer which can utilize this information
            may want to use it for prioritization.
    
            Note to Chromium glue: TargetIsSubResource renamed to TargetIsSubresource.
    
            * loader/loader.cpp:
            (WebCore::Loader::Loader):
            (WebCore::CachedResourceTypeToTargetType):
            (WebCore::Loader::Host::servePendingRequests):
            * platform/network/ResourceRequestBase.h:
            (WebCore::ResourceRequestBase::):
            (WebCore::ResourceRequestBase::targetType):
            (WebCore::ResourceRequestBase::setTargetType):
            (WebCore::ResourceRequestBase::ResourceRequestBase):
            * platform/network/chromium/ResourceRequest.h:
            (WebCore::ResourceRequest::ResourceRequest):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51859 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9ff94de..b962151 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2009-12-08  Mike Belshe  <mike at belshe.com>
+
+        Reviewed by Darin Fisher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32152
+        Update the ResourceRequest::RequestType.  This previously
+        was specific to Chromium.  Moved into ResourceRequestBase, enabling
+        more specificity about the type (which is otherwise only known to the
+        loader), and also making this information available to all platforms.
+        Any platform with a network layer which can utilize this information
+        may want to use it for prioritization.
+
+        Note to Chromium glue: TargetIsSubResource renamed to TargetIsSubresource.
+
+        * loader/loader.cpp:
+        (WebCore::Loader::Loader):
+        (WebCore::CachedResourceTypeToTargetType):
+        (WebCore::Loader::Host::servePendingRequests):
+        * platform/network/ResourceRequestBase.h:
+        (WebCore::ResourceRequestBase::):
+        (WebCore::ResourceRequestBase::targetType):
+        (WebCore::ResourceRequestBase::setTargetType):
+        (WebCore::ResourceRequestBase::ResourceRequestBase):
+        * platform/network/chromium/ResourceRequest.h:
+        (WebCore::ResourceRequest::ResourceRequest):
+
 2009-12-08  Steve Block  <steveblock at google.com>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/loader/loader.cpp b/WebCore/loader/loader.cpp
index 695a034..b33b9a0 100644
--- a/WebCore/loader/loader.cpp
+++ b/WebCore/loader/loader.cpp
@@ -61,7 +61,9 @@ Loader::Loader()
     , m_isSuspendingPendingRequests(false)
 {
     m_nonHTTPProtocolHost = Host::create(AtomicString(), maxRequestsInFlightForNonHTTPProtocols);
+#if REQUEST_MANAGEMENT_ENABLED
     maxRequestsInFlightPerHost = initializeMaximumHTTPConnectionCountPerHost();
+#endif
 }
 
 Loader::~Loader()
@@ -69,6 +71,27 @@ Loader::~Loader()
     ASSERT_NOT_REACHED();
 }
     
+ResourceRequest::TargetType cachedResourceTypeToTargetType(CachedResource::Type type)
+{
+    switch (type) {
+    case CachedResource::CSSStyleSheet:
+#if ENABLE(XSLT)
+    case CachedResource::XSLStyleSheet:
+#endif
+#if ENABLE(XBL)
+    case CachedResource::XBL:
+#endif
+        return ResourceRequest::TargetIsStyleSheet;
+    case CachedResource::Script: 
+        return ResourceRequest::TargetIsScript;
+    case CachedResource::FontResource:
+        return ResourceRequest::TargetIsFontResource;
+    case CachedResource::ImageResource:
+        return ResourceRequest::TargetIsImage;
+    }
+    return ResourceRequest::TargetIsSubresource;
+}
+
 Loader::Priority Loader::determinePriority(const CachedResource* resource) const
 {
 #if REQUEST_MANAGEMENT_ENABLED
@@ -299,6 +322,7 @@ void Loader::Host::servePendingRequests(RequestQueue& requestsPending, bool& ser
         requestsPending.removeFirst();
         
         ResourceRequest resourceRequest(request->cachedResource()->url());
+        resourceRequest.setTargetType(cachedResourceTypeToTargetType(request->cachedResource()->type()));
         
         if (!request->cachedResource()->accept().isEmpty())
             resourceRequest.setHTTPAccept(request->cachedResource()->accept());
diff --git a/WebCore/platform/network/ResourceRequestBase.h b/WebCore/platform/network/ResourceRequestBase.h
index 466b487..931a9de 100644
--- a/WebCore/platform/network/ResourceRequestBase.h
+++ b/WebCore/platform/network/ResourceRequestBase.h
@@ -52,6 +52,19 @@ namespace WebCore {
     // 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.
@@ -117,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)
         {
         }
 
@@ -135,6 +153,7 @@ namespace WebCore {
             , m_resourceRequestUpdated(true)
             , m_platformRequestUpdated(false)
             , m_reportUploadProgress(false)
+            , m_targetType(TargetIsSubresource)
         {
         }
 
@@ -154,6 +173,7 @@ namespace WebCore {
         mutable bool m_resourceRequestUpdated;
         mutable bool m_platformRequestUpdated;
         bool m_reportUploadProgress;
+        TargetType m_targetType;
 
     private:
         const ResourceRequest& asResourceRequest() const;
diff --git a/WebCore/platform/network/chromium/ResourceRequest.h b/WebCore/platform/network/chromium/ResourceRequest.h
index c412ad3..176f923 100644
--- a/WebCore/platform/network/chromium/ResourceRequest.h
+++ b/WebCore/platform/network/chromium/ResourceRequest.h
@@ -37,20 +37,11 @@ namespace WebCore {
 
     class ResourceRequest : public ResourceRequestBase {
     public:
-        enum TargetType {
-            TargetIsMainFrame,
-            TargetIsSubFrame,
-            TargetIsSubResource,
-            TargetIsObject,
-            TargetIsMedia
-        };
-
         ResourceRequest(const String& url) 
             : ResourceRequestBase(KURL(ParsedURLString, url), UseProtocolCachePolicy)
             , m_requestorID(0)
             , m_requestorProcessID(0)
             , m_appCacheHostID(0)
-            , m_targetType(TargetIsSubResource)
         {
         }
 
@@ -59,7 +50,6 @@ namespace WebCore {
             , m_requestorID(0)
             , m_requestorProcessID(0)
             , m_appCacheHostID(0)
-            , m_targetType(TargetIsSubResource)
             , m_securityInfo(securityInfo)
         {
         }
@@ -69,7 +59,6 @@ namespace WebCore {
             , m_requestorID(0)
             , m_requestorProcessID(0)
             , m_appCacheHostID(0)
-            , m_targetType(TargetIsSubResource)
         {
         }
 
@@ -78,7 +67,6 @@ namespace WebCore {
             , m_requestorID(0)
             , m_requestorProcessID(0)
             , m_appCacheHostID(0)
-            , m_targetType(TargetIsSubResource)
         {
             setHTTPReferrer(referrer);
         }
@@ -88,7 +76,6 @@ namespace WebCore {
             , m_requestorID(0)
             , m_requestorProcessID(0)
             , m_appCacheHostID(0)
-            , m_targetType(TargetIsSubResource)
         {
         }
 
@@ -96,10 +83,6 @@ namespace WebCore {
         int requestorID() const { return m_requestorID; }
         void setRequestorID(int requestorID) { m_requestorID = requestorID; }
 
-        // What this request is for.
-        TargetType targetType() const { return m_targetType; }
-        void setTargetType(TargetType type) { m_targetType = type; }
-
         // The process id of the process from which this request originated. In
         // the case of out-of-process plugins, this allows to link back the
         // request to the plugin process (as it is processed through a render
@@ -129,7 +112,6 @@ namespace WebCore {
         int m_requestorID;
         int m_requestorProcessID;
         int m_appCacheHostID;
-        TargetType m_targetType;
         CString m_securityInfo;
     };
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list