Merge pull request #9453 from Snuffleupagus/upstream-bug-1432992

Upstream the changes from: Bug 1432992 - Remove definitions of Ci, Cr, Cc, and Cu
This commit is contained in:
Tim van der Meij 2018-02-10 20:10:11 +01:00 committed by GitHub
commit 9767b8a9f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 6 additions and 36 deletions

View File

@ -20,11 +20,7 @@
const RESOURCE_NAME = "pdf.js"; const RESOURCE_NAME = "pdf.js";
const EXT_PREFIX = "extensions.uriloader@pdf.js"; const EXT_PREFIX = "extensions.uriloader@pdf.js";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cm = Components.manager; const Cm = Components.manager;
const Cu = Components.utils;
const Cr = Components.results;
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm");

View File

@ -19,11 +19,7 @@
(function contentScriptClosure() { (function contentScriptClosure() {
// we need to use closure here -- we are running in the global context // we need to use closure here -- we are running in the global context
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cm = Components.manager; const Cm = Components.manager;
const Cu = Components.utils;
const Cr = Components.results;
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm");

View File

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint max-len: ["error", 100] */
"use strict"; "use strict";

View File

@ -17,11 +17,7 @@
var EXPORTED_SYMBOLS = ["PdfJs"]; var EXPORTED_SYMBOLS = ["PdfJs"];
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cm = Components.manager; const Cm = Components.manager;
const Cu = Components.utils;
const PREF_PREFIX = "pdfjs"; const PREF_PREFIX = "pdfjs";
const PREF_DISABLED = PREF_PREFIX + ".disabled"; const PREF_DISABLED = PREF_PREFIX + ".disabled";
@ -50,9 +46,9 @@ XPCOMUtils.defineLazyServiceGetter(Svc, "pluginHost",
"@mozilla.org/plugin/host;1", "@mozilla.org/plugin/host;1",
"nsIPluginHost"); "nsIPluginHost");
ChromeUtils.defineModuleGetter(this, "PdfjsChromeUtils", ChromeUtils.defineModuleGetter(this, "PdfjsChromeUtils",
"resource://pdf.js/PdfjsChromeUtils.jsm"); "resource://pdf.js/PdfjsChromeUtils.jsm");
ChromeUtils.defineModuleGetter(this, "PdfjsContentUtils", ChromeUtils.defineModuleGetter(this, "PdfjsContentUtils",
"resource://pdf.js/PdfjsContentUtils.jsm"); "resource://pdf.js/PdfjsContentUtils.jsm");
function getBoolPref(aPref, aDefaultValue) { function getBoolPref(aPref, aDefaultValue) {
try { try {

View File

@ -18,7 +18,6 @@
this.EXPORTED_SYMBOLS = ["PdfJsTelemetry"]; this.EXPORTED_SYMBOLS = ["PdfJsTelemetry"];
const Cu = Components.utils;
ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm");
this.PdfJsTelemetry = { this.PdfJsTelemetry = {

View File

@ -17,11 +17,6 @@
var EXPORTED_SYMBOLS = ["PdfStreamConverter"]; var EXPORTED_SYMBOLS = ["PdfStreamConverter"];
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;
const PDFJS_EVENT_ID = "pdf.js.message"; const PDFJS_EVENT_ID = "pdf.js.message";
const PREF_PREFIX = "PDFJSSCRIPT_PREF_PREFIX"; const PREF_PREFIX = "PDFJSSCRIPT_PREF_PREFIX";
const PDF_VIEWER_WEB_PAGE = "resource://pdf.js/web/viewer.html"; const PDF_VIEWER_WEB_PAGE = "resource://pdf.js/web/viewer.html";
@ -111,7 +106,7 @@ function getDOMWindow(aChannel) {
var requestor = aChannel.notificationCallbacks ? var requestor = aChannel.notificationCallbacks ?
aChannel.notificationCallbacks : aChannel.notificationCallbacks :
aChannel.loadGroup.notificationCallbacks; aChannel.loadGroup.notificationCallbacks;
var win = requestor.getInterface(Components.interfaces.nsIDOMWindow); var win = requestor.getInterface(Ci.nsIDOMWindow);
return win; return win;
} }

View File

@ -17,11 +17,6 @@
var EXPORTED_SYMBOLS = ["PdfjsChromeUtils"]; var EXPORTED_SYMBOLS = ["PdfjsChromeUtils"];
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;
const PREF_PREFIX = "PDFJSSCRIPT_PREF_PREFIX"; const PREF_PREFIX = "PDFJSSCRIPT_PREF_PREFIX";
const PDF_CONTENT_TYPE = "application/pdf"; const PDF_CONTENT_TYPE = "application/pdf";

View File

@ -17,12 +17,6 @@
var EXPORTED_SYMBOLS = ["PdfjsContentUtils"]; var EXPORTED_SYMBOLS = ["PdfjsContentUtils"];
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm");
var PdfjsContentUtils = { var PdfjsContentUtils = {

View File

@ -112,7 +112,7 @@
// use the short language code for "full" codes like 'ar-sa' (issue 5440) // use the short language code for "full" codes like 'ar-sa' (issue 5440)
var shortCode = gLanguage.split("-")[0]; var shortCode = gLanguage.split("-")[0];
return (rtlList.indexOf(shortCode) >= 0) ? "rtl" : "ltr"; return (rtlList.includes(shortCode) ? "rtl" : "ltr");
}, },
getReadyState() { getReadyState() {

View File

@ -9,8 +9,8 @@
"babel-preset-env": "^1.6.1", "babel-preset-env": "^1.6.1",
"core-js": "^2.5.3", "core-js": "^2.5.3",
"escodegen": "^1.9.0", "escodegen": "^1.9.0",
"eslint": "^4.16.0", "eslint": "^4.17.0",
"eslint-plugin-mozilla": "^0.7.0", "eslint-plugin-mozilla": "^0.8.1",
"eslint-plugin-no-unsanitized": "^2.0.2", "eslint-plugin-no-unsanitized": "^2.0.2",
"fancy-log": "^1.3.2", "fancy-log": "^1.3.2",
"gulp": "^3.9.1", "gulp": "^3.9.1",