Bug 963703 - Don't use LoadUnblocked flag as cache priority load indication, r=michal
authorHonza Bambas <honzab.moz@firemni.cz>
Tue, 28 Jan 2014 17:21:21 +0100
changeset 165547 0eb2ba65a7023bbe0f5312ad8b626c7826c26534
parent 165526 340704b289c77ff93472cd13abcae29b64abceae
child 165584 245b92f1de4f189b3e55a80451af0fca8c7ba40b
push id4623
push userryanvm@gmail.com
push dateTue, 28 Jan 2014 21:48:39 +0000
treeherderfx-team@7e79536aca0a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs963703
milestone29.0a1
Bug 963703 - Don't use LoadUnblocked flag as cache priority load indication, r=michal
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -2551,20 +2551,21 @@ nsHttpChannel::OpenCacheEntry(bool using
     }
     else {
         rv = cacheStorageService->DiskCacheStorage(info,
             mChooseApplicationCache || (mLoadFlags & LOAD_CHECK_OFFLINE_CACHE),
             getter_AddRefs(cacheStorage));
     }
     NS_ENSURE_SUCCESS(rv, rv);
 
-    if (mLoadAsBlocking || mLoadUnblocked ||
-        (mLoadFlags & LOAD_INITIAL_DOCUMENT_URI)) {
+    // Don't consider mLoadUnblocked here, since it's not indication of a demand
+    // to load prioritly. It's mostly used to load XHR requests, but those should
+    // not be considered as influencing the page load performance.
+    if (mLoadAsBlocking || (mLoadFlags & LOAD_INITIAL_DOCUMENT_URI))
         cacheEntryOpenFlags |= nsICacheStorage::OPEN_PRIORITY;
-    }
 
     // Only for backward compatibility with the old cache back end.
     // When removed, remove the flags and related code snippets.
     if (mLoadFlags & LOAD_BYPASS_LOCAL_CACHE_IF_BUSY)
         cacheEntryOpenFlags |= nsICacheStorage::OPEN_BYPASS_IF_BUSY;
 
     rv = cacheStorage->AsyncOpenURI(
         openURI, mPostID ? nsPrintfCString("%d", mPostID) : EmptyCString(),