Bug 1470355 - Firefox is unresponsive when visiting https://www.youtube.com/premium, r=valentin a=lizzard
authorMichal Novotny <michal.novotny>
Mon, 02 Jul 2018 00:26:00 +0300
changeset 477843 db0c2c7b36318f970b417373d611ad9971c9bf98
parent 477842 14485670c0795d5ee019aa4a23b69927d5e946eb
child 477844 2d9b44bd2d74fbb8f64d86b666e05bb08fa04a6b
push id9444
push userarchaeopteryx@coole-files.de
push dateSat, 07 Jul 2018 21:01:06 +0000
treeherdermozilla-beta@3c8ab5a011e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin, lizzard
bugs1470355
milestone62.0
Bug 1470355 - Firefox is unresponsive when visiting https://www.youtube.com/premium, r=valentin a=lizzard This patch avoids returning NS_BASE_STREAM_WOULD_BLOCK from CacheFileInputStream::ReadSegments when it was called with aCount=0.
netwerk/cache2/CacheFileInputStream.cpp
--- a/netwerk/cache2/CacheFileInputStream.cpp
+++ b/netwerk/cache2/CacheFileInputStream.cpp
@@ -147,16 +147,20 @@ CacheFileInputStream::ReadSegments(nsWri
 
     if (NS_FAILED(mStatus)) {
       return mStatus;
     }
 
     return NS_OK;
   }
 
+  if (aCount == 0) {
+    return NS_OK;
+  }
+
   EnsureCorrectChunk(false);
 
   while (true) {
     if (NS_FAILED(mStatus))
       return mStatus;
 
     if (!mChunk) {
       if (mListeningForChunk == -1) {