Many resources with file scheme return error
authordaehyun81.yoo <daehyun81.yoo@samsung.com>
Fri, 28 Jun 2013 12:03:36 +0000 (21:03 +0900)
committerdaehyun81.yoo <daehyun81.yoo@samsung.com>
Fri, 28 Jun 2013 12:07:31 +0000 (21:07 +0900)
[Title] When lots of images (over 1000) with file scheme are loaded, they dont load properly
[Issue#] DCM-2062, WEB-3382
[Problem] Resource load scheduler limits number of requests to 20, but it does not work for file scheme.
          Since kernel limits the number of files open to 1024 at any moment, loading fails with error "Too many files".
[Cause] When file scheme is used, the resource limit is lifted off when parsing of document is completed
[Solution] Limit requests of every scheme, but raise the limit to 512

Change-Id: I22977fde46391fa52dfaf3259101ca4f8d557a9f

Source/WebCore/loader/ResourceLoadScheduler.cpp

index 8004d8f..bf452ff 100644 (file)
@@ -44,7 +44,7 @@
 namespace WebCore {
 
 #if REQUEST_MANAGEMENT_ENABLED
-static const unsigned maxRequestsInFlightForNonHTTPProtocols = 20;
+static const unsigned maxRequestsInFlightForNonHTTPProtocols = 512;
 // Match the parallel connection count used by the networking layer.
 static unsigned maxRequestsInFlightPerHost;
 #else
@@ -200,7 +200,11 @@ void ResourceLoadScheduler::servePendingRequests(HostInformation* host, Resource
             // For non-named hosts - everything but http(s) - we should only enforce the limit if the document isn't done parsing 
             // and we don't know all stylesheets yet.
             Document* document = resourceLoader->frameLoader() ? resourceLoader->frameLoader()->frame()->document() : 0;
+#if REQUEST_MANAGEMENT_ENABLED
+            bool shouldLimitRequests = true;
+#else
             bool shouldLimitRequests = !host->name().isNull() || (document && (document->parsing() || !document->haveStylesheetsLoaded()));
+#endif
             if (shouldLimitRequests && host->limitRequests(ResourceLoadPriority(priority)))
                 return;