diff options
author | Jan Beich <jbeich@FreeBSD.org> | 2015-08-11 13:22:54 +0000 |
---|---|---|
committer | Jan Beich <jbeich@FreeBSD.org> | 2015-08-11 13:22:54 +0000 |
commit | ca8a3f7f5989ac489fe9343c9b408e811c31f03c (patch) | |
tree | 975048d2c1b5ae4e089d5d1c66503f476a2fdb05 /www/firefox/files/patch-system-openh264 | |
parent | - Drop @dirrm* from plist (diff) |
Switch OpenH264 plugin to use environment variable
files/patch-system-openh264 causes patch churn on updates and hits
assertion with DEBUG=on[1]. Rework to use MOZ_GMP_PATH instead.
While here populate Last Updated field to avoid falling back to Epoch start
and disable Automatic Updates in an unlikely case of
- Cisco & Mozilla providing prebuilt version for FreeBSD
- Firefox running with root priveleges i.e., write permission under /usr/local
PR: 202218 [1]
Reported by: kib, pi [1]
Inspired by: Gentoo
MFH: 2015Q3
Notes
Notes:
svn path=/head/; revision=393941
Diffstat (limited to 'www/firefox/files/patch-system-openh264')
-rw-r--r-- | www/firefox/files/patch-system-openh264 | 231 |
1 files changed, 0 insertions, 231 deletions
diff --git a/www/firefox/files/patch-system-openh264 b/www/firefox/files/patch-system-openh264 deleted file mode 100644 index f2f8a9e796bf..000000000000 --- a/www/firefox/files/patch-system-openh264 +++ /dev/null @@ -1,231 +0,0 @@ -# Revert bug 1045209 to allow using absolute path - -diff --git dom/media/gmp/GMPChild.cpp dom/media/gmp/GMPChild.cpp -index 1dde3ac..12c88cf 100644 ---- dom/media/gmp/GMPChild.cpp -+++ dom/media/gmp/GMPChild.cpp -@@ -76,21 +76,14 @@ GetFileBase(const std::string& aPluginPa - } - #endif - -- nsCOMPtr<nsIFile> parent; -- rv = aFileBase->GetParent(getter_AddRefs(parent)); -- if (NS_FAILED(rv)) { -- return false; -- } -- -- nsAutoString parentLeafName; -- rv = parent->GetLeafName(parentLeafName); -- if (NS_FAILED(rv)) { -+ nsAutoString leafName; -+ if (NS_FAILED(aFileBase->GetLeafName(leafName))) { - return false; - } - -- aBaseName = Substring(parentLeafName, -+ aBaseName = Substring(leafName, - 4, -- parentLeafName.Length() - 1); -+ leafName.Length() - 1); - return true; - } - -diff --git dom/media/gmp/GMPParent.cpp dom/media/gmp/GMPParent.cpp -index aa60acf..90878ca 100644 ---- dom/media/gmp/GMPParent.cpp -+++ dom/media/gmp/GMPParent.cpp -@@ -93,22 +93,15 @@ - mService = aService; - mDirectory = aPluginDir; - -- // aPluginDir is <profile-dir>/<gmp-plugin-id>/<version> -- // where <gmp-plugin-id> should be gmp-gmpopenh264 -- nsCOMPtr<nsIFile> parent; -- nsresult rv = aPluginDir->GetParent(getter_AddRefs(parent)); -+ nsAutoString leafname; -+ nsresult rv = aPluginDir->GetLeafName(leafname); - if (NS_FAILED(rv)) { - return rv; - } -- nsAutoString parentLeafName; -- rv = parent->GetLeafName(parentLeafName); -- if (NS_FAILED(rv)) { -- return rv; -- } -- LOGD("%s: for %s", __FUNCTION__, NS_LossyConvertUTF16toASCII(parentLeafName).get()); -+ LOGD("%s: for %s", __FUNCTION__, NS_LossyConvertUTF16toASCII(leafname).get()); - -- MOZ_ASSERT(parentLeafName.Length() > 4); -- mName = Substring(parentLeafName, 4); -+ MOZ_ASSERT(leafname.Length() > 4); -+ mName = Substring(leafname, 4); - - return ReadGMPMetaData(); - } -diff --git toolkit/modules/GMPInstallManager.jsm toolkit/modules/GMPInstallManager.jsm -index 9593492..470384b 100644 ---- toolkit/modules/GMPInstallManager.jsm -+++ toolkit/modules/GMPInstallManager.jsm -@@ -888,9 +889,7 @@ - let gmpAddon = this._gmpAddon; - let installToDirPath = Cc["@mozilla.org/file/local;1"]. - createInstance(Ci.nsIFile); -- let path = OS.Path.join(OS.Constants.Path.profileDir, -- gmpAddon.id, -- gmpAddon.version); -+ let path = OS.Path.join(OS.Constants.Path.profileDir, gmpAddon.id); - installToDirPath.initWithPath(path); - log.info("install to directory path: " + installToDirPath.path); - let gmpInstaller = new GMPExtractor(zipPath, installToDirPath.path); -@@ -895,10 +893,12 @@ GMPDownloader.prototype = { - // Success, set the prefs - let now = Math.round(Date.now() / 1000); - GMPPrefs.set(GMPPrefs.KEY_PLUGIN_LAST_UPDATE, now, gmpAddon.id); -- // Setting the version pref signals installation completion to consumers, -- // if you need to set other prefs etc. do it before this. -+ // Setting the path pref signals installation completion to consumers, -+ // so set the version and potential other information they use first. - GMPPrefs.set(GMPPrefs.KEY_PLUGIN_VERSION, gmpAddon.version, - gmpAddon.id); -+ GMPPrefs.set(GMPPrefs.KEY_PLUGIN_PATH, -+ installToDirPath.path, gmpAddon.id); - // Reset the trial create pref, so that Gecko knows to do a test - // run before reporting that the GMP works to content. - GMPPrefs.reset(GMPPrefs.KEY_PLUGIN_TRIAL_CREATE, gmpAddon.version, -diff --git toolkit/modules/GMPUtils.jsm toolkit/modules/GMPUtils.jsm -index 1f3a0b1..93517be 100644 ---- toolkit/modules/GMPUtils.jsm -+++ toolkit/modules/GMPUtils.jsm -@@ -70,6 +70,7 @@ this.GMPPrefs = { - KEY_EME_ENABLED: "media.eme.enabled", - KEY_PLUGIN_ENABLED: "media.{0}.enabled", - KEY_PLUGIN_LAST_UPDATE: "media.{0}.lastUpdate", -+ KEY_PLUGIN_PATH: "media.{0}.path", - KEY_PLUGIN_VERSION: "media.{0}.version", - KEY_PLUGIN_AUTOUPDATE: "media.{0}.autoupdate", - KEY_PLUGIN_FORCEVISIBLE: "media.{0}.forcevisible", -diff --git toolkit/mozapps/extensions/internal/GMPProvider.jsm toolkit/mozapps/extensions/internal/GMPProvider.jsm -index 1f3a0b1..93517be 100644 ---- toolkit/mozapps/extensions/internal/GMPProvider.jsm -+++ toolkit/mozapps/extensions/internal/GMPProvider.jsm -@@ -100,12 +100,11 @@ - Log.repository.getLoggerWithMessagePrefix("Toolkit.GMP", - "GMPWrapper(" + - this._plugin.id + ") "); -- Preferences.observe(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_ENABLED, -- this._plugin.id), -+ Preferences.observe(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_ENABLED, this._plugin.id), - this.onPrefEnabledChanged, this); -- Preferences.observe(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_VERSION, -+ Preferences.observe(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_PATH, - this._plugin.id), -- this.onPrefVersionChanged, this); -+ this.onPrefPathChanged, this); - if (this._plugin.isEME) { - Preferences.observe(GMPPrefs.KEY_EME_ENABLED, - this.onPrefEMEGlobalEnabledChanged, this); -@@ -135,11 +134,8 @@ GMPWrapper.prototype = { - - set gmpPath(aPath) { this._gmpPath = aPath; }, - get gmpPath() { -- if (!this._gmpPath && this.isInstalled) { -- this._gmpPath = OS.Path.join(OS.Constants.Path.profileDir, -- this._plugin.id, -- GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION, -- null, this._plugin.id)); -+ if (!this._gmpPath) { -+ this._gmpPath = GMPPrefs.get(GMPPrefs.KEY_PLUGIN_PATH, null, this._plugin.id); - } - return this._gmpPath; - }, -@@ -158,8 +154,13 @@ GMPWrapper.prototype = { - get description() { return this._plugin.description; }, - get fullDescription() { return this._plugin.fullDescription; }, - -- get version() { return GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION, null, -- this._plugin.id); }, -+ get version() { -+ if (this.isInstalled) { -+ return GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION, null, -+ this._plugin.id); -+ } -+ return null; -+ }, - - get isActive() { return !this.appDisabled && !this.userDisabled; }, - get appDisabled() { -@@ -289,24 +290,17 @@ - - get pluginMimeTypes() { return []; }, - get pluginLibraries() { -- if (this.isInstalled) { -- let path = this.version; -- return [path]; -- } -- return []; -+ let path = GMPPrefs.get(GMPPrefs.KEY_PLUGIN_PATH, null, this._plugin.id); -+ return path && path.length ? [OS.Path.basename(path)] : []; - }, - get pluginFullpath() { -- if (this.isInstalled) { -- let path = OS.Path.join(OS.Constants.Path.profileDir, -- this._plugin.id, -- this.version); -- return [path]; -- } -- return []; -+ let path = GMPPrefs.get(GMPPrefs.KEY_PLUGIN_PATH, null, this._plugin.id); -+ return path && path.length ? [path] : []; - }, - - get isInstalled() { -- return this.version && this.version.length > 0; -+ let path = GMPPrefs.get(GMPPrefs.KEY_PLUGIN_PATH, null, this._plugin.id); -+ return path && path.length > 0; - }, - - _handleEnabledChanged: function() { -@@ -362,10 +356,10 @@ - } - }, - -- onPrefVersionChanged: function() { -+ onPrefPathChanged: function() { - AddonManagerPrivate.callAddonListeners("onUninstalling", this, false); - if (this._gmpPath) { -- this._log.info("onPrefVersionChanged() - unregistering gmp directory " + -+ this._log.info("onPrefPathChanged() - unregistering gmp directory " + - this._gmpPath); - gmpService.removeAndDeletePluginDirectory(this._gmpPath, true /* can defer */); - } -@@ -415,15 +409,10 @@ GMPWrapper.prototype = { - AddonManagerPrivate.callInstallListeners("onExternalInstall", null, this, - null, false); - AddonManagerPrivate.callAddonListeners("onInstalling", this, false); -- this._gmpPath = null; -- if (this.isInstalled) { -- this._gmpPath = OS.Path.join(OS.Constants.Path.profileDir, -- this._plugin.id, -- GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION, -- null, this._plugin.id)); -- } -+ this._gmpPath = GMPPrefs.get(GMPPrefs.KEY_PLUGIN_PATH, -+ null, this._plugin.id); - if (this._gmpPath && this.isActive) { -- this._log.info("onPrefVersionChanged() - registering gmp directory " + -+ this._log.info("onPrefPathChanged() - registering gmp directory " + - this._gmpPath); - gmpService.addPluginDirectory(this._gmpPath); - } -@@ -393,9 +382,9 @@ - Preferences.ignore(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_ENABLED, - this._plugin.id), - this.onPrefEnabledChanged, this); -- Preferences.ignore(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_VERSION, -+ Preferences.ignore(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_PATH, - this._plugin.id), -- this.onPrefVersionChanged, this); -+ this.onPrefPathChanged, this); - if (this._plugin.isEME) { - Preferences.ignore(GMPPrefs.KEY_EME_ENABLED, - this.onPrefEMEGlobalEnabledChanged, this); |