summaryrefslogtreecommitdiff
path: root/www/firefox/files/patch-system-openh264
diff options
context:
space:
mode:
Diffstat (limited to 'www/firefox/files/patch-system-openh264')
-rw-r--r--www/firefox/files/patch-system-openh264166
1 files changed, 87 insertions, 79 deletions
diff --git a/www/firefox/files/patch-system-openh264 b/www/firefox/files/patch-system-openh264
index 5215ddb43475..d51644631776 100644
--- a/www/firefox/files/patch-system-openh264
+++ b/www/firefox/files/patch-system-openh264
@@ -101,33 +101,60 @@ index 9593492..470384b 100644
this._deferred.resolve(extractedPaths);
}, err => {
this._deferred.reject(err);
-diff --git toolkit/mozapps/extensions/internal/OpenH264Provider.jsm toolkit/mozapps/extensions/internal/OpenH264Provider.jsm
+diff --git toolkit/mozapps/extensions/internal/GMPProvider.jsm toolkit/mozapps/extensions/internal/GMPProvider.jsm
index 1f3a0b1..93517be 100644
---- toolkit/mozapps/extensions/internal/OpenH264Provider.jsm
-+++ toolkit/mozapps/extensions/internal/OpenH264Provider.jsm
-@@ -29,6 +29,7 @@
- const OPENH264_PLUGIN_ID = "gmp-gmpopenh264";
- const OPENH264_PREF_BRANCH = "media." + OPENH264_PLUGIN_ID + ".";
- const OPENH264_PREF_ENABLED = "enabled";
-+const OPENH264_PREF_PATH = "path";
- const OPENH264_PREF_VERSION = "version";
- const OPENH264_PREF_LASTUPDATE = "lastUpdate";
- const OPENH264_PREF_AUTOUPDATE = "autoupdate";
-@@ -93,7 +94,12 @@
-
- get description() { return pluginsBundle.GetStringFromName("openH264_description"); },
+--- toolkit/mozapps/extensions/internal/GMPProvider.jsm
++++ toolkit/mozapps/extensions/internal/GMPProvider.jsm
+@@ -40,6 +40,7 @@ const KEY_LOGGING_LEVEL = KEY_LOG_B
+ const KEY_LOGGING_DUMP = KEY_LOG_BASE + "dump";
+ const KEY_EME_ENABLED = "media.eme.enabled"; // Global pref to enable/disable all EME plugins
+ const KEY_PLUGIN_ENABLED = "media.{0}.enabled";
++const KEY_PLUGIN_PATH = "media.{0}.path";
+ const KEY_PLUGIN_LAST_UPDATE = "media.{0}.lastUpdate";
+ const KEY_PLUGIN_VERSION = "media.{0}.version";
+ const KEY_PLUGIN_AUTOUPDATE = "media.{0}.autoupdate";
+@@ -165,8 +166,8 @@ function GMPWrapper(aPluginInfo) {
+ this._plugin.id + ") ");
+ Preferences.observe(GMPPrefs.getPrefKey(KEY_PLUGIN_ENABLED, this._plugin.id),
+ this.onPrefEnabledChanged, this);
+- Preferences.observe(GMPPrefs.getPrefKey(KEY_PLUGIN_VERSION, this._plugin.id),
+- this.onPrefVersionChanged, this);
++ Preferences.observe(GMPPrefs.getPrefKey(KEY_PLUGIN_PATH, this._plugin.id),
++ this.onPrefPathChanged, this);
+ if (this._plugin.isEME) {
+ Preferences.observe(GMPPrefs.getPrefKey(KEY_EME_ENABLED, this._plugin.id),
+ this.onPrefEnabledChanged, this);
+@@ -183,11 +184,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(KEY_PLUGIN_VERSION, null,
+- this._plugin.id));
++ if (!this._gmpPath) {
++ this._gmpPath = GMPPrefs.get(KEY_PLUGIN_PATH, null, this._plugin.id);
+ }
+ return this._gmpPath;
+ },
+@@ -202,8 +200,13 @@ GMPWrapper.prototype = {
+ get description() { return this._plugin.description; },
+ get fullDescription() { return this._plugin.fullDescription; },
-- get version() { return prefs.get(OPENH264_PREF_VERSION, ""); },
-+ get version() {
+- get version() { return GMPPrefs.get(KEY_PLUGIN_VERSION, null,
+- this._plugin.id); },
++ get version() {
+ if (this.isInstalled) {
-+ return prefs.get(OPENH264_PREF_VERSION, "");
++ return GMPPrefs.get(KEY_PLUGIN_VERSION, null,
++ this._plugin.id);
+ }
-+ return "";
++ return null;
+ },
get isActive() { return !this.userDisabled; },
get appDisabled() { return false; },
-@@ -217,24 +223,17 @@
+@@ -346,24 +349,17 @@ GMPWrapper.prototype = {
get pluginMimeTypes() { return []; },
get pluginLibraries() {
@@ -136,86 +163,67 @@ index 1f3a0b1..93517be 100644
- return [path];
- }
- return [];
-+ let path = prefs.get(OPENH264_PREF_PATH, null);
++ let path = GMPPrefs.get(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,
-- OPENH264_PLUGIN_ID,
+- this._plugin.id,
- this.version);
- return [path];
- }
- return [];
-+ let path = prefs.get(OPENH264_PREF_PATH, null);
++ let path = GMPPrefs.get(KEY_PLUGIN_PATH, null, this._plugin.id);
+ return path && path.length ? [path] : [];
},
get isInstalled() {
-- return this.version.length > 0;
-+ let path = prefs.get(OPENH264_PREF_PATH, "");
-+ return path.length > 0;
+- return this.version && this.version.length > 0;
++ let path = GMPPrefs.get(KEY_PLUGIN_PATH, null, this._plugin.id);
++ return path && path.length > 0;
},
- };
-
-@@ -245,19 +244,14 @@
- "OpenH264Provider" + "::");
- OpenH264Wrapper._log = Log.repository.getLoggerWithMessagePrefix("Toolkit.OpenH264Provider",
- "OpenH264Wrapper" + "::");
-- this.gmpPath = null;
-- if (OpenH264Wrapper.isInstalled) {
-- this.gmpPath = OS.Path.join(OS.Constants.Path.profileDir,
-- OPENH264_PLUGIN_ID,
-- prefs.get(OPENH264_PREF_VERSION, null));
-- }
-+ this.gmpPath = prefs.get(OPENH264_PREF_PATH, null);
- let enabled = prefs.get(OPENH264_PREF_ENABLED, true);
- this._log.trace("startup() - enabled=" + enabled + ", gmpPath="+this.gmpPath);
-
- Services.obs.addObserver(this, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, false);
- prefs.observe(OPENH264_PREF_ENABLED, this.onPrefEnabledChanged, this);
-- prefs.observe(OPENH264_PREF_VERSION, this.onPrefVersionChanged, this);
-+ prefs.observe(OPENH264_PREF_PATH, this.onPrefPathChanged, this);
- prefs.observe(OPENH264_PREF_LOGGING, configureLogging);
-
- if (this.gmpPath && enabled) {
-@@ -270,7 +264,7 @@
- this._log.trace("shutdown()");
- Services.obs.removeObserver(this, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED);
- prefs.ignore(OPENH264_PREF_ENABLED, this.onPrefEnabledChanged, this);
-- prefs.ignore(OPENH264_PREF_VERSION, this.onPrefVersionChanged, this);
-+ prefs.ignore(OPENH264_PREF_PATH, this.onPrefPathChanged, this);
- prefs.ignore(OPENH264_PREF_LOGGING, configureLogging);
-
- return OpenH264Wrapper._updateTask;
-@@ -296,25 +290,20 @@
- wrapper);
+ onPrefEnabledChanged: function() {
+@@ -386,10 +382,10 @@ GMPWrapper.prototype = {
+ this);
},
- onPrefVersionChanged: function() {
+ onPrefPathChanged: function() {
- let wrapper = OpenH264Wrapper;
-
- AddonManagerPrivate.callAddonListeners("onUninstalling", wrapper, false);
- if (this.gmpPath) {
-- this._log.info("onPrefVersionChanged() - unregistering gmp directory " + this.gmpPath);
-+ this._log.info("onPrefPathChanged() - removing gmp directory " + this.gmpPath);
- gmpService.removePluginDirectory(this.gmpPath);
+ 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.removePluginDirectory(this._gmpPath);
}
- AddonManagerPrivate.callAddonListeners("onUninstalled", wrapper);
+@@ -397,15 +393,9 @@ GMPWrapper.prototype = {
- AddonManagerPrivate.callInstallListeners("onExternalInstall", null, wrapper, null, false);
-- this.gmpPath = null;
-- if (OpenH264Wrapper.isInstalled) {
-- this.gmpPath = OS.Path.join(OS.Constants.Path.profileDir,
-- OPENH264_PLUGIN_ID,
-- prefs.get(OPENH264_PREF_VERSION, null));
+ AddonManagerPrivate.callInstallListeners("onExternalInstall", null, this,
+ null, false);
+- this._gmpPath = null;
+- if (this.isInstalled) {
+- this._gmpPath = OS.Path.join(OS.Constants.Path.profileDir,
+- this._plugin.id,
+- GMPPrefs.get(KEY_PLUGIN_VERSION, null,
+- this._plugin.id));
- }
-+ this.gmpPath = prefs.get(OPENH264_PREF_PATH, null);
- if (this.gmpPath && wrapper.isActive) {
-- this._log.info("onPrefVersionChanged() - registering gmp directory " + this.gmpPath);
-+ this._log.info("onPrefPathChanged() - adding gmp directory " + this.gmpPath);
- gmpService.addPluginDirectory(this.gmpPath);
++ this._gmpPath = GMPPrefs.get(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);
}
- AddonManagerPrivate.callAddonListeners("onInstalled", wrapper);
+@@ -415,8 +405,8 @@ GMPWrapper.prototype = {
+ shutdown: function() {
+ Preferences.ignore(GMPPrefs.getPrefKey(KEY_PLUGIN_ENABLED, this._plugin.id),
+ this.onPrefEnabledChanged, this);
+- Preferences.ignore(GMPPrefs.getPrefKey(KEY_PLUGIN_VERSION, this._plugin.id),
+- this.onPrefVersionChanged, this);
++ Preferences.ignore(GMPPrefs.getPrefKey(KEY_PLUGIN_PATH, this._plugin.id),
++ this.onPrefPathChanged, this);
+ if (this._isEME) {
+ Preferences.ignore(GMPPrefs.getPrefKey(KEY_EME_ENABLED, this._plugin.id),
+ this.onPrefEnabledChanged, this);