[Pkg-javascript-commits] [pdf.js] 82/204: Fix setPreferences regression from the e10s patch (PR 5115)
David Prévot
taffit at moszumanska.debian.org
Sat Oct 25 18:50:35 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 3ac9bd063d7b169834ba3edf2723992cfa557d2e
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Thu Sep 18 01:14:00 2014 +0200
Fix setPreferences regression from the e10s patch (PR 5115)
---
extensions/firefox/content/PdfjsChromeUtils.jsm | 8 ++++++--
make.js | 4 ++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/extensions/firefox/content/PdfjsChromeUtils.jsm b/extensions/firefox/content/PdfjsChromeUtils.jsm
index 89e995b..8b3efe1 100644
--- a/extensions/firefox/content/PdfjsChromeUtils.jsm
+++ b/extensions/firefox/content/PdfjsChromeUtils.jsm
@@ -1,3 +1,5 @@
+/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* Copyright 2012 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,7 +25,7 @@ const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;
-const PREF_PREFIX = 'pdfjs';
+const PREF_PREFIX = 'PDFJSSCRIPT_PREF_PREFIX';
const PDF_CONTENT_TYPE = 'application/pdf';
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
@@ -176,7 +178,9 @@ let PdfjsChromeUtils = {
},
_isPrefAllowed: function (aPrefName) {
- if (this._allowedPrefNames.indexOf(aPrefName) == -1) {
+ let unPrefixedName = aPrefName.split(PREF_PREFIX + '.');
+ if (unPrefixedName[0] !== '' ||
+ this._allowedPrefNames.indexOf(unPrefixedName[1]) === -1) {
let msg = "'" + aPrefName + "' ";
msg += "can't be accessed from content. See PdfjsChromeUtils."
throw new Error(msg);
diff --git a/make.js b/make.js
index 7ab11f7..f7789da 100644
--- a/make.js
+++ b/make.js
@@ -680,6 +680,8 @@ target.firefox = function() {
FIREFOX_BUILD_CONTENT_DIR + 'PdfStreamConverter.jsm');
sed('-i', /PDFJSSCRIPT_MOZ_CENTRAL/, 'false',
FIREFOX_BUILD_CONTENT_DIR + 'PdfStreamConverter.jsm');
+ sed('-i', /PDFJSSCRIPT_PREF_PREFIX/, FIREFOX_PREF_PREFIX,
+ FIREFOX_BUILD_CONTENT_DIR + 'PdfjsChromeUtils.jsm');
// Update localized metadata
var localizedMetadata = cat(EXTENSION_SRC_DIR + '/firefox/metadata.inc');
@@ -808,6 +810,8 @@ target.mozcentral = function() {
MOZCENTRAL_CONTENT_DIR + 'PdfStreamConverter.jsm');
sed('-i', /PDFJSSCRIPT_MOZ_CENTRAL/, 'true',
MOZCENTRAL_CONTENT_DIR + 'PdfStreamConverter.jsm');
+ sed('-i', /PDFJSSCRIPT_PREF_PREFIX/, MOZCENTRAL_PREF_PREFIX,
+ MOZCENTRAL_CONTENT_DIR + 'PdfjsChromeUtils.jsm');
// Copy test files
mkdir('-p', MOZCENTRAL_TEST_DIR);
--
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