From 396525896ec0ec29b17cdb867f0c7fc762389de8 Mon Sep 17 00:00:00 2001 From: James Willcox Date: Tue, 16 Dec 2014 17:01:31 -0600 Subject: [PATCH] Bug 1110271 - Enable GMPInstallManager on Android r=mfinkle --- layout/tools/reftest/remotereftest.py | 2 ++ mobile/android/app/mobile.js | 3 +++ mobile/android/chrome/content/browser.js | 10 ++++++++++ mobile/android/installer/package-manifest.in | 1 + toolkit/modules/moz.build | 2 +- toolkit/modules/tests/xpcshell/xpcshell.ini | 2 -- toolkit/mozapps/extensions/extensions.manifest | 2 +- toolkit/mozapps/extensions/internal/moz.build | 2 +- toolkit/mozapps/extensions/test/browser/browser.ini | 2 -- 9 files changed, 19 insertions(+), 7 deletions(-) diff --git a/layout/tools/reftest/remotereftest.py b/layout/tools/reftest/remotereftest.py index 9241e043ddd2..d80b5b1ea7d5 100644 --- a/layout/tools/reftest/remotereftest.py +++ b/layout/tools/reftest/remotereftest.py @@ -376,6 +376,8 @@ class RemoteReftest(RefTest): prefs["extensions.getAddons.search.url"] = "http://127.0.0.1:8888/extensions-dummy/repositorySearchURL" # Make sure that opening the plugins check page won't hit the network prefs["plugins.update.url"] = "http://127.0.0.1:8888/plugins-dummy/updateCheckURL" + # Make sure the GMPInstallManager won't hit the network + prefs["media.gmp-manager.url.override"] = "http://127.0.0.1:8888/dummy-gmp-manager.xml"; prefs["layout.css.devPixelsPerPx"] = "1.0" # Disable skia-gl: see bug 907351 diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index ebf22531febc..35f5cb3803a7 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -850,3 +850,6 @@ pref("device.storage.enabled", true); // Enable meta-viewport support for font inflation code pref("dom.meta-viewport.enabled", true); + +// Enable the OpenH264 plugin support in the addon manager. +pref("media.gmp-gmpopenh264.provider.enabled", true); diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index 2a417d4aacab..1393f4944498 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -112,6 +112,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "Notifications", XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "GMPInstallManager", + "resource://gre/modules/GMPInstallManager.jsm"); + // Lazily-loaded browser scripts: [ ["SelectHelper", "chrome://browser/content/SelectHelper.js"], @@ -342,6 +345,9 @@ var BrowserApp = { CastingApps.init(); }, Ci.nsIThread.DISPATCH_NORMAL); + BrowserApp.gmpInstallManager = new GMPInstallManager(); + BrowserApp.gmpInstallManager.simpleCheckAndInstall().then(null, () => {}); + #ifdef MOZ_SAFE_BROWSING Services.tm.mainThread.dispatch(function() { // Bug 778855 - Perf regression if we do this here. To be addressed in bug 779008. @@ -1193,6 +1199,10 @@ var BrowserApp = { }, quit: function quit(aClear = { sanitize: {}, dontSaveSession: false }) { + if (this.gmpInstallManager) { + this.gmpInstallManager.uninit(); + } + // Figure out if there's at least one other browser window around. let lastBrowser = true; let e = Services.wm.getEnumerator("navigator:browser"); diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index ebaa9d373d85..4a72bf49279f 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -126,6 +126,7 @@ @BINPATH@/components/commandlines.xpt @BINPATH@/components/composer.xpt @BINPATH@/components/content_events.xpt +@BINPATH@/components/content_geckomediaplugins.xpt @BINPATH@/components/content_html.xpt @BINPATH@/components/content_webrtc.xpt @BINPATH@/components/content_xslt.xpt diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build index 39126fec36bd..584778a7ccb2 100644 --- a/toolkit/modules/moz.build +++ b/toolkit/modules/moz.build @@ -62,6 +62,7 @@ EXTRA_JS_MODULES += [ EXTRA_PP_JS_MODULES += [ 'CertUtils.jsm', + 'GMPInstallManager.jsm', 'ResetProfile.jsm', 'secondscreen/RokuApp.jsm', 'Services.jsm', @@ -73,7 +74,6 @@ EXTRA_PP_JS_MODULES += [ if 'Android' != CONFIG['OS_TARGET']: EXTRA_PP_JS_MODULES += [ - 'GMPInstallManager.jsm', 'LightweightThemeConsumer.jsm', ] else: diff --git a/toolkit/modules/tests/xpcshell/xpcshell.ini b/toolkit/modules/tests/xpcshell/xpcshell.ini index 8f5b6f762801..f2fa7e635f4d 100644 --- a/toolkit/modules/tests/xpcshell/xpcshell.ini +++ b/toolkit/modules/tests/xpcshell/xpcshell.ini @@ -13,8 +13,6 @@ support-files = [test_dict.js] [test_FileUtils.js] [test_GMPInstallManager.js] -# GMPInstallManager is not shipped on Android -skip-if = os == 'android' [test_Http.js] [test_Log.js] [test_NewTabUtils.js] diff --git a/toolkit/mozapps/extensions/extensions.manifest b/toolkit/mozapps/extensions/extensions.manifest index af0f6c5966f4..1cfbee3ebe16 100644 --- a/toolkit/mozapps/extensions/extensions.manifest +++ b/toolkit/mozapps/extensions/extensions.manifest @@ -15,6 +15,6 @@ contract @mozilla.org/addons/installtrigger;1 {9df8ef2b-94da-45c9-ab9f-132eb55fd category JavaScript-global-property InstallTrigger @mozilla.org/addons/installtrigger;1 #ifndef MOZ_WIDGET_ANDROID category addon-provider-module PluginProvider resource://gre/modules/addons/PluginProvider.jsm +#endif category addon-provider-module OpenH264Provider resource://gre/modules/addons/OpenH264Provider.jsm #endif -#endif diff --git a/toolkit/mozapps/extensions/internal/moz.build b/toolkit/mozapps/extensions/internal/moz.build index 24fe344bf7d2..f0752799ab46 100644 --- a/toolkit/mozapps/extensions/internal/moz.build +++ b/toolkit/mozapps/extensions/internal/moz.build @@ -11,13 +11,13 @@ EXTRA_JS_MODULES.addons += [ 'AddonUpdateChecker.jsm', 'Content.js', 'LightweightThemeImageOptimizer.jsm', + 'OpenH264Provider.jsm', 'SpellCheckDictionaryBootstrap.js', ] # Don't ship unused providers on Android if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android': EXTRA_JS_MODULES.addons += [ - 'OpenH264Provider.jsm', 'PluginProvider.jsm', ] diff --git a/toolkit/mozapps/extensions/test/browser/browser.ini b/toolkit/mozapps/extensions/test/browser/browser.ini index 5ba5c4ae47b4..f8c0a069a882 100644 --- a/toolkit/mozapps/extensions/test/browser/browser.ini +++ b/toolkit/mozapps/extensions/test/browser/browser.ini @@ -45,8 +45,6 @@ skip-if = e10s [browser_newaddon.js] skip-if = e10s [browser_openH264.js] -# OpenH264Provider.jsm is not shipped on Android -skip-if = os == "android" [browser_select_compatoverrides.js] [browser_select_confirm.js] [browser_select_selection.js]