[Pkg-javascript-commits] [pdf.js] 131/204: Disables hash options when PDFBug is disabled and fixed streaming regressions.

David Prévot taffit at moszumanska.debian.org
Sat Oct 25 18:50:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit a95123188aff44aac4478c05f04ec4da83d67f67
Author: Yury Delendik <ydelendik at mozilla.com>
Date:   Fri Sep 26 11:49:18 2014 -0500

    Disables hash options when PDFBug is disabled and fixed streaming regressions.
---
 extensions/firefox/content/PdfStreamConverter.jsm | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/extensions/firefox/content/PdfStreamConverter.jsm b/extensions/firefox/content/PdfStreamConverter.jsm
index 7f8124e..0c28a6b 100644
--- a/extensions/firefox/content/PdfStreamConverter.jsm
+++ b/extensions/firefox/content/PdfStreamConverter.jsm
@@ -554,7 +554,9 @@ var RangedChromeActions = (function RangedChromeActionsClosure() {
         this.headers[aHeader] = aValue;
       }
     };
-    originalRequest.visitRequestHeaders(httpHeaderVisitor);
+    if (originalRequest.visitRequestHeaders) {
+      originalRequest.visitRequestHeaders(httpHeaderVisitor);
+    }
 
     var self = this;
     var xhr_onreadystatechange = function xhr_onreadystatechange() {
@@ -874,8 +876,8 @@ PdfStreamConverter.prototype = {
     } catch (e) {}
 
     var rangeRequest = false;
-    var hash = aRequest.URI.ref;
-    if (isHttpRequest && !getBoolPref(PREF_PREFIX + '.disableRange', false)) {
+    var streamRequest = false;
+    if (isHttpRequest) {
       var contentEncoding = 'identity';
       try {
         contentEncoding = aRequest.getResponseHeader('Content-Encoding');
@@ -886,13 +888,19 @@ PdfStreamConverter.prototype = {
         acceptRanges = aRequest.getResponseHeader('Accept-Ranges');
       } catch (e) {}
 
+      var hash = aRequest.URI.ref;
+      var isPDFBugEnabled = getBoolPref(PREF_PREFIX + '.pdfBugEnabled', false);
       rangeRequest = contentEncoding === 'identity' &&
                      acceptRanges === 'bytes' &&
                      aRequest.contentLength >= 0 &&
-                     hash.toLowerCase().indexOf('disablerange=true') < 0;
+                     !getBoolPref(PREF_PREFIX + '.disableRange', false) &&
+                     (!isPDFBugEnabled ||
+                      hash.toLowerCase().indexOf('disablerange=true') < 0);
+      streamRequest = contentEncoding === 'identity' &&
+                      !getBoolPref(PREF_PREFIX + '.disableStream', false) &&
+                      (!isPDFBugEnabled ||
+                       hash.toLowerCase().indexOf('disablestream=true') < 0);
     }
-    var streamRequest = !getBoolPref(PREF_PREFIX + '.disableStream', false) &&
-                        hash.toLowerCase().indexOf('disablestream=true') < 0;
 
     aRequest.QueryInterface(Ci.nsIChannel);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list