Bug 1050346 - Loading of PDF is broken when range requests are active. a=sledru
authorYury Delendik <ydelendik@mozilla.com>
Mon, 18 Aug 2014 18:42:17 -0500
changeset 217546 8d741d6f270661214363daa545ba6cb3c1eb39c5
parent 217545 e935e84f4dcc205de82edaa35dc3ac295f3a64df
child 217547 83411dedecb455b1ce5debaa6338beda5f1cb5da
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssledru
bugs1050346
milestone33.0a2
Bug 1050346 - Loading of PDF is broken when range requests are active. a=sledru
browser/extensions/pdfjs/content/build/pdf.worker.js
--- a/browser/extensions/pdfjs/content/build/pdf.worker.js
+++ b/browser/extensions/pdfjs/content/build/pdf.worker.js
@@ -1418,25 +1418,18 @@ var ChunkedStream = (function ChunkedStr
       return this.length === 0;
     },
 
     getByte: function ChunkedStream_getByte() {
       var pos = this.pos;
       if (pos >= this.end) {
         return -1;
       }
-      var byte = this.bytes[pos];
-      if (byte === 0) {
-        // |byte| might be zero, because the corresponding chunk has not been
-        // loaded yet. In this case, this.ensureByte(pos) will throw an
-        // exception and nothing is returned.
-        this.ensureByte(pos);
-      }
-      this.pos++;
-      return byte;
+      this.ensureByte(pos);
+      return this.bytes[this.pos++];
     },
 
     getUint16: function ChunkedStream_getUint16() {
       var b0 = this.getByte();
       var b1 = this.getByte();
       return (b0 << 8) + b1;
     },