diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /b2g/components/OopCommandLine.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'b2g/components/OopCommandLine.js')
-rw-r--r-- | b2g/components/OopCommandLine.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/b2g/components/OopCommandLine.js b/b2g/components/OopCommandLine.js new file mode 100644 index 000000000..658bbdde5 --- /dev/null +++ b/b2g/components/OopCommandLine.js @@ -0,0 +1,46 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +const { classes: Cc, interfaces: Ci, utils: Cu } = Components; +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm"); + +function oopCommandlineHandler() { +} + +oopCommandlineHandler.prototype = { + handle: function(cmdLine) { + let oopFlag = cmdLine.handleFlag("oop", false); + if (oopFlag) { + /** + * Manipulate preferences by adding to the *default* branch. Adding + * to the default branch means the changes we make won"t get written + * back to user preferences. + */ + let prefs = Services.prefs + let branch = prefs.getDefaultBranch(""); + + try { + // Turn on all OOP services, making desktop run similar to phone + // environment + branch.setBoolPref("dom.ipc.tabs.disabled", false); + branch.setBoolPref("layers.acceleration.disabled", false); + branch.setBoolPref("layers.offmainthreadcomposition.async-animations", true); + branch.setBoolPref("layers.async-video.enabled", true); + branch.setBoolPref("layers.async-pan-zoom.enabled", true); + branch.setCharPref("gfx.content.azure.backends", "cairo"); + } catch (e) { } + + } + if (cmdLine.state == Ci.nsICommandLine.STATE_REMOTE_AUTO) { + cmdLine.preventDefault = true; + } + }, + + helpInfo: " --oop Use out-of-process model in B2G\n", + classID: Components.ID("{e30b0e13-2d12-4cb0-bc4c-4e617a1bf76e}"), + QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]), +}; + +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([oopCommandlineHandler]); |