]> git.parisson.com Git - pdf.js.git/commitdiff
Switch to constant for max database length.
authorBrendan Dahl <brendan.dahl@gmail.com>
Wed, 8 Feb 2012 00:44:03 +0000 (16:44 -0800)
committerBrendan Dahl <brendan.dahl@gmail.com>
Wed, 8 Feb 2012 00:44:03 +0000 (16:44 -0800)
extensions/firefox/components/PdfStreamConverter.js

index 7b8cdab49a5f70573ef422523c7e0229046fa11d..4a990df92cd9cec15126b9a77d3dd6ed8c637270 100644 (file)
@@ -12,6 +12,7 @@ const Cu = Components.utils;
 const PDFJS_EVENT_ID = 'pdf.js.message';
 const PDF_CONTENT_TYPE = 'application/pdf';
 const EXT_PREFIX = 'extensions.uriloader@pdf.js';
+const MAX_DATABASE_LENGTH = 4096;
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 Cu.import('resource://gre/modules/Services.jsm');
@@ -51,7 +52,7 @@ ChromeActions.prototype = {
     if (this.inPrivateBrowswing)
       return;
     // Protect against something sending tons of data to setDatabase.
-    if (data.length > 4096)
+    if (data.length > MAX_DATABASE_LENGTH)
       return;
     application.prefs.setValue(EXT_PREFIX + '.database', data);
   },