michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: const { classes: Cc, interfaces: Ci, utils: Cu } = Components; michael@0: Cu.import("resource://gre/modules/XPCOMUtils.jsm"); michael@0: XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm"); michael@0: michael@0: function oopCommandlineHandler() { michael@0: } michael@0: michael@0: oopCommandlineHandler.prototype = { michael@0: handle: function(cmdLine) { michael@0: let oopFlag = cmdLine.handleFlag("oop", false); michael@0: if (oopFlag) { michael@0: /** michael@0: * Manipulate preferences by adding to the *default* branch. Adding michael@0: * to the default branch means the changes we make won"t get written michael@0: * back to user preferences. michael@0: */ michael@0: let prefs = Services.prefs michael@0: let branch = prefs.getDefaultBranch(""); michael@0: michael@0: try { michael@0: // Turn on all OOP services, making desktop run similar to phone michael@0: // environment michael@0: branch.setBoolPref("dom.ipc.tabs.disabled", false); michael@0: branch.setBoolPref("layers.acceleration.disabled", false); michael@0: branch.setBoolPref("layers.offmainthreadcomposition.enabled", true); michael@0: branch.setBoolPref("layers.offmainthreadcomposition.async-animations", true); michael@0: branch.setBoolPref("layers.async-video.enabled", true); michael@0: branch.setBoolPref("layers.async-pan-zoom.enabled", true); michael@0: branch.setCharPref("gfx.content.azure.backends", "cairo"); michael@0: } catch (e) { } michael@0: michael@0: } michael@0: if (cmdLine.state == Ci.nsICommandLine.STATE_REMOTE_AUTO) { michael@0: cmdLine.preventDefault = true; michael@0: } michael@0: }, michael@0: michael@0: helpInfo: " -oop Use out-of-process model in B2G\n", michael@0: classID: Components.ID("{e30b0e13-2d12-4cb0-bc4c-4e617a1bf76e}"), michael@0: QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]), michael@0: }; michael@0: michael@0: this.NSGetFactory = XPCOMUtils.generateNSGetFactory([oopCommandlineHandler]);