diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-12-10 16:59:13 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-12-10 16:59:13 +0100 |
commit | 9697bfa68f32984b196748e388d743dddbe6aa7b (patch) | |
tree | 3d8d23560d512199fbc8334bd15514d70ea00268 | |
parent | 7d398710beb67e03bf1690f73cdfd1ef2b76d31a (diff) | |
parent | fbbda481dce5c367b4ccdeacc70cdcd7f68ac8af (diff) | |
download | UXP-9697bfa68f32984b196748e388d743dddbe6aa7b.tar UXP-9697bfa68f32984b196748e388d743dddbe6aa7b.tar.gz UXP-9697bfa68f32984b196748e388d743dddbe6aa7b.tar.lz UXP-9697bfa68f32984b196748e388d743dddbe6aa7b.tar.xz UXP-9697bfa68f32984b196748e388d743dddbe6aa7b.zip |
Merge branch 'master' into Sync-weave
184 files changed, 1071 insertions, 5134 deletions
diff --git a/application/palemoon/app/moz.build b/application/palemoon/app/moz.build index 8b358b622..c11f4c37e 100644 --- a/application/palemoon/app/moz.build +++ b/application/palemoon/app/moz.build @@ -6,7 +6,6 @@ DIRS += ['profile/extensions'] - GeckoProgram(CONFIG['MOZ_APP_NAME']) JS_PREFERENCE_PP_FILES += [ @@ -18,18 +17,14 @@ if CONFIG['LIBXUL_SDK']: 'profile/channel-prefs.js', ] -SOURCES += [ - 'nsBrowserApp.cpp', -] +SOURCES += ['nsBrowserApp.cpp'] FINAL_TARGET_FILES += ['blocklist.xml'] FINAL_TARGET_FILES.defaults.profile += ['profile/prefs.js'] DEFINES['APP_VERSION'] = CONFIG['MOZ_APP_VERSION'] -LOCAL_INCLUDES += [ - '!/build', -] +LOCAL_INCLUDES += ['!/build'] LOCAL_INCLUDES += [ '/toolkit/xre', @@ -37,9 +32,7 @@ LOCAL_INCLUDES += [ '/xpcom/build', ] -USE_LIBS += [ - 'mozglue', -] +USE_LIBS += ['mozglue'] if CONFIG['_MSC_VER']: # Always enter a Windows program through wmain, whether or not we're diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index 69f8f6651..1c6016f0f 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -264,6 +264,9 @@ pref("browser.slowStartup.maxSamples", 5); pref("browser.enable_automatic_image_resizing", true); pref("browser.chrome.site_icons", true); pref("browser.chrome.favicons", true); +// If enabled, will process favicons by drawing them on a canvas, +// optimizing display size for the UI. This also strips animations. +pref("browser.chrome.favicons.process", false); // browser.warnOnQuit == false will override all other possible prompts when quitting or restarting pref("browser.warnOnQuit", true); // browser.showQuitWarning specifically controls the quit warning dialog. We @@ -1152,19 +1155,6 @@ pref("toolkit.pageThumbs.minHeight", 180); pref("ui.key.menuAccessKeyFocuses", true); #endif -// ****************** domain-specific UAs ****************** - -// AMO needs "Firefox", obviously - pass on the OS (determined at build time) -#ifdef XP_UNIX -#ifdef XP_MACOSX -pref("general.useragent.override.addons.mozilla.org","Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:27.0) Gecko/20100101 Firefox/27.0"); -#else -pref("general.useragent.override.addons.mozilla.org","Mozilla/5.0 (Linux; X11; rv:27.0) Gecko/20100101 Firefox/27.0"); -#endif -#else -pref("general.useragent.override.addons.mozilla.org","Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0"); -#endif - // ****************** s4e prefs ****************** pref("status4evar.addonbar.borderStyle", false); pref("status4evar.addonbar.closeButton", false); diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index 929afd057..988cae55c 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -831,13 +831,40 @@ "-moz-resolution=" + size + "," + size; } if (sizedIconUrl != aTab.getAttribute("image")) { - if (browser.mIconURL) //PMed + if (browser.mIconURL) aTab.setAttribute("image", sizedIconUrl); else aTab.removeAttribute("image"); this._tabAttrModified(aTab, ["image"]); } + if (Services.prefs.getBoolPref("browser.chrome.favicons.process")) { + let favImage = new Image; + favImage.src = browser.mIconURL; + var tabBrowser = this; + favImage.onload = function () { + try { + // Draw the icon on a hidden canvas + var canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); + var tabImg = document.getAnonymousElementByAttribute(aTab, "anonid", "tab-icon"); + var w = tabImg.boxObject.width; + var h = tabImg.boxObject.height; + canvas.width = w; + canvas.height = h; + var ctx = canvas.getContext('2d'); + ctx.drawImage(favImage, 0, 0, w, h); + icon = canvas.toDataURL(); + browser.mIconURL = icon; + aTab.setAttribute("image", icon); + } + catch (e) { + console.warn("Processing of favicon failed."); + // Canvas failed: icon remains as it was + } + tabBrowser._callProgressListeners(browser, "onLinkIconAvailable", [browser.mIconURL]); + } + } + this._callProgressListeners(browser, "onLinkIconAvailable", [browser.mIconURL]); ]]> </body> diff --git a/application/palemoon/base/jar.mn b/application/palemoon/base/jar.mn index d8c3f4b21..8931c0260 100644 --- a/application/palemoon/base/jar.mn +++ b/application/palemoon/base/jar.mn @@ -2,135 +2,81 @@ # 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/. browser.jar: -% content browser %content/browser/ contentaccessible=yes +% content browser %content/browser/ contentaccessible=yes #ifdef XP_MACOSX -% overlay chrome://mozapps/content/downloads/downloads.xul chrome://browser/content/downloadManagerOverlay.xul -% overlay chrome://global/content/console.xul chrome://browser/content/jsConsoleOverlay.xul -% overlay chrome://mozapps/content/update/updates.xul chrome://browser/content/softwareUpdateOverlay.xul +% overlay chrome://mozapps/content/downloads/downloads.xul chrome://browser/content/downloadManagerOverlay.xul +% overlay chrome://global/content/console.xul chrome://browser/content/jsConsoleOverlay.xul +% overlay chrome://mozapps/content/update/updates.xul chrome://browser/content/softwareUpdateOverlay.xul #endif #ifdef XP_WIN -% overlay chrome://browser/content/browser.xul chrome://browser/content/win6BrowserOverlay.xul os=WINNT osversion>=6 +% overlay chrome://browser/content/browser.xul chrome://browser/content/win6BrowserOverlay.xul os=WINNT osversion>=6 #endif -% overlay chrome://global/content/viewSource.xul chrome://browser/content/viewSourceOverlay.xul -% overlay chrome://global/content/viewPartialSource.xul chrome://browser/content/viewSourceOverlay.xul -% style chrome://global/content/customizeToolbar.xul chrome://browser/content/browser.css -% style chrome://global/content/customizeToolbar.xul chrome://browser/skin/ -* content/browser/aboutDialog.xul (content/aboutDialog.xul) -* content/browser/aboutDialog.js (content/aboutDialog.js) - content/browser/aboutDialog.css (content/aboutDialog.css) - content/browser/aboutRobots.xhtml (content/aboutRobots.xhtml) - content/browser/abouthome/aboutHome.xhtml (content/abouthome/aboutHome.xhtml) - content/browser/abouthome/aboutHome.js (content/abouthome/aboutHome.js) -* content/browser/abouthome/aboutHome.css (content/abouthome/aboutHome.css) - content/browser/abouthome/noise.png (content/abouthome/noise.png) - content/browser/abouthome/snippet1.png (content/abouthome/snippet1.png) - content/browser/abouthome/snippet2.png (content/abouthome/snippet2.png) - content/browser/abouthome/downloads.png (content/abouthome/downloads.png) - content/browser/abouthome/bookmarks.png (content/abouthome/bookmarks.png) - content/browser/abouthome/history.png (content/abouthome/history.png) - content/browser/abouthome/addons.png (content/abouthome/addons.png) - content/browser/abouthome/sync.png (content/abouthome/sync.png) - content/browser/abouthome/settings.png (content/abouthome/settings.png) - content/browser/abouthome/restore.png (content/abouthome/restore.png) - content/browser/abouthome/restore-large.png (content/abouthome/restore-large.png) - content/browser/abouthome/snippet1@2x.png (content/abouthome/snippet1@2x.png) - content/browser/abouthome/snippet2@2x.png (content/abouthome/snippet2@2x.png) - content/browser/abouthome/downloads@2x.png (content/abouthome/downloads@2x.png) - content/browser/abouthome/bookmarks@2x.png (content/abouthome/bookmarks@2x.png) - content/browser/abouthome/history@2x.png (content/abouthome/history@2x.png) - content/browser/abouthome/addons@2x.png (content/abouthome/addons@2x.png) - content/browser/abouthome/sync@2x.png (content/abouthome/sync@2x.png) - content/browser/abouthome/settings@2x.png (content/abouthome/settings@2x.png) - content/browser/abouthome/restore@2x.png (content/abouthome/restore@2x.png) - content/browser/abouthome/restore-large@2x.png (content/abouthome/restore-large@2x.png) - content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png) - content/browser/aboutRobots-widget-left.png (content/aboutRobots-widget-left.png) - content/browser/autorecovery.js (content/autorecovery.js) - content/browser/autorecovery.xul (content/autorecovery.xul) -* content/browser/browser.css (content/browser.css) - content/browser/browser-menudragging.xul (content/browser-menudragging.xul) - content/browser/browser-menudragging.js (content/browser-menudragging.js) - content/browser/browser-title.css (content/browser-title.css) -* content/browser/browser.js (content/browser.js) -* content/browser/browser.xul (content/browser.xul) +% overlay chrome://global/content/viewSource.xul chrome://browser/content/viewSourceOverlay.xul +% overlay chrome://global/content/viewPartialSource.xul chrome://browser/content/viewSourceOverlay.xul +% style chrome://global/content/customizeToolbar.xul chrome://browser/content/browser.css +% style chrome://global/content/customizeToolbar.xul chrome://browser/skin/ +* content/browser/aboutDialog.xul (content/aboutDialog.xul) +* content/browser/aboutDialog.js (content/aboutDialog.js) + content/browser/aboutDialog.css (content/aboutDialog.css) + content/browser/aboutRobots.xhtml (content/aboutRobots.xhtml) + content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png) + content/browser/aboutRobots-widget-left.png (content/aboutRobots-widget-left.png) + content/browser/autorecovery.js (content/autorecovery.js) + content/browser/autorecovery.xul (content/autorecovery.xul) +* content/browser/browser.css (content/browser.css) + content/browser/browser-menudragging.xul (content/browser-menudragging.xul) + content/browser/browser-menudragging.js (content/browser-menudragging.js) + content/browser/browser-title.css (content/browser-title.css) +* content/browser/browser.js (content/browser.js) +* content/browser/browser.xul (content/browser.xul) #ifdef MOZ_DEVTOOLS - content/browser/browser-devtools-theme.js (content/browser-devtools-theme.js) + content/browser/browser-devtools-theme.js (content/browser-devtools-theme.js) #endif -* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml) - content/browser/content.js (content/content.js) - content/browser/padlock.xul (content/padlock.xul) - content/browser/padlock.js (content/padlock.js) - content/browser/padlock.css (content/padlock.css) - content/browser/padlock_mod_ev.png (content/padlock_mod_ev.png) - content/browser/padlock_mod_https.png (content/padlock_mod_https.png) - content/browser/padlock_mod_low.png (content/padlock_mod_low.png) - content/browser/padlock_mod_broken.png (content/padlock_mod_broken.png) - content/browser/padlock_classic_ev.png (content/padlock_classic_ev.png) - content/browser/padlock_classic_https.png (content/padlock_classic_https.png) - content/browser/padlock_classic_low.png (content/padlock_classic_low.png) - content/browser/padlock_classic_broken.png (content/padlock_classic_broken.png) - content/browser/palemoon.xhtml (content/palemoon.xhtml) - content/browser/newtab/newTab.xhtml (content/newtab/newTab.xhtml) -* content/browser/newtab/newTab.js (content/newtab/newTab.js) - content/browser/newtab/newTab.css (content/newtab/newTab.css) -* content/browser/pageinfo/pageInfo.xul (content/pageinfo/pageInfo.xul) - content/browser/pageinfo/pageInfo.js (content/pageinfo/pageInfo.js) - content/browser/pageinfo/pageInfo.css (content/pageinfo/pageInfo.css) - content/browser/pageinfo/pageInfo.xml (content/pageinfo/pageInfo.xml) - content/browser/pageinfo/feeds.js (content/pageinfo/feeds.js) - content/browser/pageinfo/feeds.xml (content/pageinfo/feeds.xml) - content/browser/pageinfo/permissions.js (content/pageinfo/permissions.js) - content/browser/pageinfo/security.js (content/pageinfo/security.js) -#ifdef MOZ_SERVICES_SYNC - content/browser/sync/aboutSyncTabs.xul (content/sync/aboutSyncTabs.xul) - content/browser/sync/aboutSyncTabs.js (content/sync/aboutSyncTabs.js) - content/browser/sync/aboutSyncTabs.css (content/sync/aboutSyncTabs.css) - content/browser/sync/aboutSyncTabs-bindings.xml (content/sync/aboutSyncTabs-bindings.xml) - content/browser/sync/setup.xul (content/sync/setup.xul) - content/browser/sync/addDevice.js (content/sync/addDevice.js) - content/browser/sync/addDevice.xul (content/sync/addDevice.xul) - content/browser/sync/setup.js (content/sync/setup.js) - content/browser/sync/genericChange.xul (content/sync/genericChange.xul) - content/browser/sync/genericChange.js (content/sync/genericChange.js) - content/browser/sync/key.xhtml (content/sync/key.xhtml) - content/browser/sync/notification.xml (content/sync/notification.xml) - content/browser/sync/quota.xul (content/sync/quota.xul) - content/browser/sync/quota.js (content/sync/quota.js) - content/browser/sync/utils.js (content/sync/utils.js) - content/browser/sync/progress.js (content/sync/progress.js) - content/browser/sync/progress.xhtml (content/sync/progress.xhtml) -#endif - content/browser/openLocation.js (content/openLocation.js) - content/browser/openLocation.xul (content/openLocation.xul) - content/browser/safeMode.css (content/safeMode.css) - content/browser/safeMode.js (content/safeMode.js) -* content/browser/safeMode.xul (content/safeMode.xul) -* content/browser/sanitize.js (content/sanitize.js) -* content/browser/sanitize.xul (content/sanitize.xul) -* content/browser/sanitizeDialog.js (content/sanitizeDialog.js) - content/browser/sanitizeDialog.css (content/sanitizeDialog.css) - content/browser/autocomplete.css (content/autocomplete.css) -* content/browser/autocomplete.xml (content/autocomplete.xml) - content/browser/tabbrowser.css (content/tabbrowser.css) -* content/browser/tabbrowser.xml (content/tabbrowser.xml) -* content/browser/urlbarBindings.xml (content/urlbarBindings.xml) -* content/browser/utilityOverlay.js (content/utilityOverlay.js) - content/browser/web-panels.js (content/web-panels.js) -* content/browser/web-panels.xul (content/web-panels.xul) -* content/browser/baseMenuOverlay.xul (content/baseMenuOverlay.xul) -* content/browser/nsContextMenu.js (content/nsContextMenu.js) +* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml) + content/browser/content.js (content/content.js) + content/browser/padlock.xul (content/padlock.xul) + content/browser/padlock.js (content/padlock.js) + content/browser/padlock.css (content/padlock.css) + content/browser/padlock_mod_ev.png (content/padlock_mod_ev.png) + content/browser/padlock_mod_https.png (content/padlock_mod_https.png) + content/browser/padlock_mod_low.png (content/padlock_mod_low.png) + content/browser/padlock_mod_broken.png (content/padlock_mod_broken.png) + content/browser/padlock_classic_ev.png (content/padlock_classic_ev.png) + content/browser/padlock_classic_https.png (content/padlock_classic_https.png) + content/browser/padlock_classic_low.png (content/padlock_classic_low.png) + content/browser/padlock_classic_broken.png (content/padlock_classic_broken.png) + content/browser/palemoon.xhtml (content/palemoon.xhtml) + content/browser/openLocation.js (content/openLocation.js) + content/browser/openLocation.xul (content/openLocation.xul) + content/browser/safeMode.css (content/safeMode.css) + content/browser/safeMode.js (content/safeMode.js) +* content/browser/safeMode.xul (content/safeMode.xul) +* content/browser/sanitize.js (content/sanitize.js) +* content/browser/sanitize.xul (content/sanitize.xul) +* content/browser/sanitizeDialog.js (content/sanitizeDialog.js) + content/browser/sanitizeDialog.css (content/sanitizeDialog.css) + content/browser/autocomplete.css (content/autocomplete.css) +* content/browser/autocomplete.xml (content/autocomplete.xml) + content/browser/tabbrowser.css (content/tabbrowser.css) +* content/browser/tabbrowser.xml (content/tabbrowser.xml) +* content/browser/urlbarBindings.xml (content/urlbarBindings.xml) +* content/browser/utilityOverlay.js (content/utilityOverlay.js) + content/browser/web-panels.js (content/web-panels.js) +* content/browser/web-panels.xul (content/web-panels.xul) +* content/browser/baseMenuOverlay.xul (content/baseMenuOverlay.xul) +* content/browser/nsContextMenu.js (content/nsContextMenu.js) # XXX: We should exclude this one as well (bug 71895) -* content/browser/hiddenWindow.xul (content/hiddenWindow.xul) +* content/browser/hiddenWindow.xul (content/hiddenWindow.xul) #ifdef XP_MACOSX -* content/browser/macBrowserOverlay.xul (content/macBrowserOverlay.xul) -* content/browser/downloadManagerOverlay.xul (content/downloadManagerOverlay.xul) -* content/browser/jsConsoleOverlay.xul (content/jsConsoleOverlay.xul) -* content/browser/softwareUpdateOverlay.xul (content/softwareUpdateOverlay.xul) +* content/browser/macBrowserOverlay.xul (content/macBrowserOverlay.xul) +* content/browser/downloadManagerOverlay.xul (content/downloadManagerOverlay.xul) +* content/browser/jsConsoleOverlay.xul (content/jsConsoleOverlay.xul) +* content/browser/softwareUpdateOverlay.xul (content/softwareUpdateOverlay.xul) #endif -* content/browser/viewSourceOverlay.xul (content/viewSourceOverlay.xul) +* content/browser/viewSourceOverlay.xul (content/viewSourceOverlay.xul) #ifdef XP_WIN - content/browser/win6BrowserOverlay.xul (content/win6BrowserOverlay.xul) + content/browser/win6BrowserOverlay.xul (content/win6BrowserOverlay.xul) #endif # the following files are browser-specific overrides -* content/browser/license.html (/toolkit/content/license.html) +* content/browser/license.html (/toolkit/content/license.html) % override chrome://global/content/license.html chrome://browser/content/license.html diff --git a/application/palemoon/branding/official/content/moz.build b/application/palemoon/branding/official/content/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/branding/official/content/moz.build +++ b/application/palemoon/branding/official/content/moz.build @@ -4,5 +4,4 @@ # 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/. - JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file diff --git a/application/palemoon/branding/official/locales/jar.mn b/application/palemoon/branding/official/locales/jar.mn index 79078217e..f02dd95f3 100644 --- a/application/palemoon/branding/official/locales/jar.mn +++ b/application/palemoon/branding/official/locales/jar.mn @@ -6,6 +6,6 @@ @AB_CD@.jar: % locale branding @AB_CD@ %locale/branding/ - locale/branding/brand.dtd (%brand.dtd) - locale/branding/brand.properties (%brand.properties) - locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) + locale/branding/brand.dtd (%brand.dtd) + locale/branding/brand.properties (%brand.properties) + locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) diff --git a/application/palemoon/branding/official/locales/moz.build b/application/palemoon/branding/official/locales/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/branding/official/locales/moz.build +++ b/application/palemoon/branding/official/locales/moz.build @@ -4,5 +4,4 @@ # 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/. - JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file diff --git a/application/palemoon/branding/shared/pref/uaoverrides.inc b/application/palemoon/branding/shared/pref/uaoverrides.inc index e5e727ee5..b33758ea9 100644 --- a/application/palemoon/branding/shared/pref/uaoverrides.inc +++ b/application/palemoon/branding/shared/pref/uaoverrides.inc @@ -21,6 +21,11 @@ #define OS_SLICE Windows NT 6.1; WOW64;
#endif
+// Special-case AMO
+// We send the native UA slice now, since they no longer offer any compatible extensions for us.
+// This will result in an "only with Firefox" message which suits us fine, because it's the truth.
+pref("@GUAO_PREF@.addons.mozilla.org","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
+
// Required for domains that have proven unresponsive to requests from users
pref("@GUAO_PREF@.live.com","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)");
pref("@GUAO_PREF@.msn.com","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)");
diff --git a/application/palemoon/branding/unofficial/content/jar.mn b/application/palemoon/branding/unofficial/content/jar.mn index 821aa03bc..bdb1e8129 100644 --- a/application/palemoon/branding/unofficial/content/jar.mn +++ b/application/palemoon/branding/unofficial/content/jar.mn @@ -4,13 +4,13 @@ browser.jar: % content branding %content/branding/ contentaccessible=yes - content/branding/about.png (about.png) - content/branding/about-background.png (about-background.png) - content/branding/about-logo.png (about-logo.png) - content/branding/about-logo@2x.png (about-logo@2x.png) - content/branding/about-wordmark.svg (about-wordmark.svg) - content/branding/icon48.png (icon48.png) - content/branding/icon64.png (icon64.png) - content/branding/icon16.png (../default16.png) - content/branding/icon32.png (../default32.png) - content/branding/aboutDialog.css (aboutDialog.css) + content/branding/about.png (about.png) + content/branding/about-background.png (about-background.png) + content/branding/about-logo.png (about-logo.png) + content/branding/about-logo@2x.png (about-logo@2x.png) + content/branding/about-wordmark.svg (about-wordmark.svg) + content/branding/icon48.png (icon48.png) + content/branding/icon64.png (icon64.png) + content/branding/icon16.png (../default16.png) + content/branding/icon32.png (../default32.png) + content/branding/aboutDialog.css (aboutDialog.css) diff --git a/application/palemoon/branding/unofficial/content/moz.build b/application/palemoon/branding/unofficial/content/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/branding/unofficial/content/moz.build +++ b/application/palemoon/branding/unofficial/content/moz.build @@ -4,5 +4,4 @@ # 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/. - JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file diff --git a/application/palemoon/branding/unofficial/locales/jar.mn b/application/palemoon/branding/unofficial/locales/jar.mn index 88aa07434..9de6cfc83 100644 --- a/application/palemoon/branding/unofficial/locales/jar.mn +++ b/application/palemoon/branding/unofficial/locales/jar.mn @@ -7,6 +7,6 @@ @AB_CD@.jar: % locale branding @AB_CD@ %locale/branding/ # Unofficial branding only exists in en-US - locale/branding/brand.dtd (en-US/brand.dtd) - locale/branding/brand.properties (en-US/brand.properties) - locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) + locale/branding/brand.dtd (en-US/brand.dtd) + locale/branding/brand.properties (en-US/brand.properties) + locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) diff --git a/application/palemoon/branding/unstable/content/jar.mn b/application/palemoon/branding/unstable/content/jar.mn index d8038bf9e..6903e9ac5 100644 --- a/application/palemoon/branding/unstable/content/jar.mn +++ b/application/palemoon/branding/unstable/content/jar.mn @@ -4,13 +4,13 @@ browser.jar: % content branding %content/branding/ contentaccessible=yes - content/branding/about.png (about.png) - content/branding/about-background.png (about-background.png) - content/branding/about-logo.png (about-logo.png) - content/branding/about-logo@2x.png (about-logo@2x.png) - content/branding/about-wordmark.png (about-wordmark.png) - content/branding/icon48.png (icon48.png) - content/branding/icon64.png (icon64.png) - content/branding/icon16.png (../default16.png) - content/branding/icon32.png (../default32.png) - content/branding/aboutDialog.css (aboutDialog.css) + content/branding/about.png (about.png) + content/branding/about-background.png (about-background.png) + content/branding/about-logo.png (about-logo.png) + content/branding/about-logo@2x.png (about-logo@2x.png) + content/branding/about-wordmark.png (about-wordmark.png) + content/branding/icon48.png (icon48.png) + content/branding/icon64.png (icon64.png) + content/branding/icon16.png (../default16.png) + content/branding/icon32.png (../default32.png) + content/branding/aboutDialog.css (aboutDialog.css) diff --git a/application/palemoon/branding/unstable/content/moz.build b/application/palemoon/branding/unstable/content/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/branding/unstable/content/moz.build +++ b/application/palemoon/branding/unstable/content/moz.build @@ -4,5 +4,4 @@ # 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/. - JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file diff --git a/application/palemoon/branding/unstable/locales/jar.mn b/application/palemoon/branding/unstable/locales/jar.mn index 88aa07434..9de6cfc83 100644 --- a/application/palemoon/branding/unstable/locales/jar.mn +++ b/application/palemoon/branding/unstable/locales/jar.mn @@ -7,6 +7,6 @@ @AB_CD@.jar: % locale branding @AB_CD@ %locale/branding/ # Unofficial branding only exists in en-US - locale/branding/brand.dtd (en-US/brand.dtd) - locale/branding/brand.properties (en-US/brand.properties) - locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) + locale/branding/brand.dtd (en-US/brand.dtd) + locale/branding/brand.properties (en-US/brand.properties) + locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) diff --git a/application/palemoon/components/BrowserComponents.manifest b/application/palemoon/components/BrowserComponents.manifest index 1e4bff59a..b7f054eab 100644 --- a/application/palemoon/components/BrowserComponents.manifest +++ b/application/palemoon/components/BrowserComponents.manifest @@ -1,3 +1,22 @@ +# nsAboutRedirector.js +component {8cc51368-6aa0-43e8-b762-bde9b9fd828c} nsAboutRedirector.js +# Each entry here should be coupled with an entry in nsAboutRedirector.js +contract @mozilla.org/network/protocol/about;1?what=certerror {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=downloads {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=feeds {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=home {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=newtab {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=palemoon {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=permissions {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=privatebrowsing {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=rights {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=robots {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=sessionrestore {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +#ifdef MOZ_SERVICES_SYNC +contract @mozilla.org/network/protocol/about;1?what=sync-progress {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=sync-tabs {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +#endif + # nsBrowserContentHandler.js component {5d0ce354-df01-421a-83fb-7ead0990c24e} nsBrowserContentHandler.js application={8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} contract @mozilla.org/browser/clh;1 {5d0ce354-df01-421a-83fb-7ead0990c24e} application={8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} diff --git a/application/palemoon/components/about/AboutRedirector.cpp b/application/palemoon/components/about/AboutRedirector.cpp deleted file mode 100644 index fbcad6094..000000000 --- a/application/palemoon/components/about/AboutRedirector.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. */ - -// See also: docshell/base/nsAboutRedirector.cpp - -#include "AboutRedirector.h" -#include "nsNetUtil.h" -#include "nsIScriptSecurityManager.h" -#include "mozilla/ArrayUtils.h" - -namespace mozilla { -namespace browser { - -NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule) - -struct RedirEntry { - const char* id; - const char* url; - uint32_t flags; -}; - -/* - Entries which do not have URI_SAFE_FOR_UNTRUSTED_CONTENT will run with chrome - privileges. This is potentially dangerous. Please use - URI_SAFE_FOR_UNTRUSTED_CONTENT in the third argument to each map item below - unless your about: page really needs chrome privileges. Security review is - required before adding new map entries without - URI_SAFE_FOR_UNTRUSTED_CONTENT. -*/ -static RedirEntry kRedirMap[] = { - { - "certerror", "chrome://browser/content/certerror/aboutCertError.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT - }, - { - "downloads", "chrome://browser/content/downloads/contentAreaDownloadsView.xul", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "feeds", "chrome://browser/content/feeds/subscribe.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT - }, - { - "home", "chrome://browser/content/abouthome/aboutHome.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::MAKE_LINKABLE | - nsIAboutModule::ALLOW_SCRIPT - }, - { - "newtab", "chrome://browser/content/newtab/newTab.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "palemoon", "chrome://browser/content/palemoon.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT - }, - { - "permissions", "chrome://browser/content/permissions/aboutPermissions.xul", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "rights", "chrome://global/content/aboutRights.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::MAKE_LINKABLE | - nsIAboutModule::ALLOW_SCRIPT - }, - { - "robots", "chrome://browser/content/aboutRobots.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT - }, - { - "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, -#ifdef MOZ_SERVICES_SYNC - { - "sync-progress", "chrome://browser/content/sync/progress.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "sync-tabs", "chrome://browser/content/sync/aboutSyncTabs.xul", - nsIAboutModule::ALLOW_SCRIPT - }, -#endif -}; -static const int kRedirTotal = ArrayLength(kRedirMap); - -static nsAutoCString -GetAboutModuleName(nsIURI *aURI) -{ - nsAutoCString path; - aURI->GetPath(path); - - int32_t f = path.FindChar('#'); - if (f >= 0) - path.SetLength(f); - - f = path.FindChar('?'); - if (f >= 0) - path.SetLength(f); - - ToLowerCase(path); - return path; -} - -NS_IMETHODIMP -AboutRedirector::NewChannel(nsIURI* aURI, - nsILoadInfo* aLoadInfo, - nsIChannel** result) -{ - NS_ENSURE_ARG_POINTER(aURI); - NS_ASSERTION(result, "must not be null"); - - nsAutoCString path = GetAboutModuleName(aURI); - - nsresult rv; - nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv); - NS_ENSURE_SUCCESS(rv, rv); - - for (int i = 0; i < kRedirTotal; i++) { - if (!strcmp(path.get(), kRedirMap[i].id)) { - nsCOMPtr<nsIChannel> tempChannel; - nsCOMPtr<nsIURI> tempURI; - rv = NS_NewURI(getter_AddRefs(tempURI), - nsDependentCString(kRedirMap[i].url)); - NS_ENSURE_SUCCESS(rv, rv); - rv = NS_NewChannelInternal(getter_AddRefs(tempChannel), - tempURI, - aLoadInfo); - NS_ENSURE_SUCCESS(rv, rv); - - tempChannel->SetOriginalURI(aURI); - - NS_ADDREF(*result = tempChannel); - return rv; - } - } - - return NS_ERROR_ILLEGAL_VALUE; -} - -NS_IMETHODIMP -AboutRedirector::GetURIFlags(nsIURI *aURI, uint32_t *result) -{ - NS_ENSURE_ARG_POINTER(aURI); - - nsAutoCString name = GetAboutModuleName(aURI); - - for (int i = 0; i < kRedirTotal; i++) { - if (name.Equals(kRedirMap[i].id)) { - *result = kRedirMap[i].flags; - return NS_OK; - } - } - - return NS_ERROR_ILLEGAL_VALUE; -} - -nsresult -AboutRedirector::Create(nsISupports *aOuter, REFNSIID aIID, void **result) -{ - AboutRedirector* about = new AboutRedirector(); - if (about == nullptr) - return NS_ERROR_OUT_OF_MEMORY; - NS_ADDREF(about); - nsresult rv = about->QueryInterface(aIID, result); - NS_RELEASE(about); - return rv; -} - -} // namespace browser -} // namespace mozilla diff --git a/application/palemoon/components/about/AboutRedirector.h b/application/palemoon/components/about/AboutRedirector.h deleted file mode 100644 index 8feeb7491..000000000 --- a/application/palemoon/components/about/AboutRedirector.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. */ - -#ifndef AboutRedirector_h__ -#define AboutRedirector_h__ - -#include "nsIAboutModule.h" - -namespace mozilla { -namespace browser { - -class AboutRedirector : public nsIAboutModule -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIABOUTMODULE - - AboutRedirector() {} - - static nsresult - Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); - -protected: - virtual ~AboutRedirector() {} -}; - -} // namespace browser -} // namespace mozilla - -#endif // AboutRedirector_h__ diff --git a/application/palemoon/base/content/abouthome/aboutHome.css b/application/palemoon/components/abouthome/aboutHome.css index 73c686202..2b062e8e7 100644 --- a/application/palemoon/base/content/abouthome/aboutHome.css +++ b/application/palemoon/components/abouthome/aboutHome.css @@ -262,9 +262,11 @@ body[narrow] #restorePreviousSession { content: url("chrome://browser/content/abouthome/addons.png"); } +%ifdef MOZ_SERVICES_SYNC #sync::before { content: url("chrome://browser/content/abouthome/sync.png"); } +%endif #settings::before { content: url("chrome://browser/content/abouthome/settings.png"); @@ -320,9 +322,11 @@ body[narrow] #restorePreviousSession::before { content: url("chrome://browser/content/abouthome/addons@2x.png"); } +%ifdef MOZ_SERVICES_SYNC #sync::before { content: url("chrome://browser/content/abouthome/sync@2x.png"); } +%endif #settings::before { content: url("chrome://browser/content/abouthome/settings@2x.png"); diff --git a/application/palemoon/base/content/abouthome/aboutHome.js b/application/palemoon/components/abouthome/aboutHome.js index 6ff8eee98..6ff8eee98 100644 --- a/application/palemoon/base/content/abouthome/aboutHome.js +++ b/application/palemoon/components/abouthome/aboutHome.js diff --git a/application/palemoon/base/content/abouthome/aboutHome.xhtml b/application/palemoon/components/abouthome/aboutHome.xhtml index cb3fa634a..d72ec492e 100644 --- a/application/palemoon/base/content/abouthome/aboutHome.xhtml +++ b/application/palemoon/components/abouthome/aboutHome.xhtml @@ -51,7 +51,9 @@ <button class="launchButton" id="bookmarks">&abouthome.bookmarksButton.label;</button> <button class="launchButton" id="history">&abouthome.historyButton.label;</button> <button class="launchButton" id="addons">&abouthome.addonsButton.label;</button> +#ifdef MOZ_SERVICES_SYNC <button class="launchButton" id="sync">&abouthome.syncButton.label;</button> +#endif <button class="launchButton" id="settings">&abouthome.settingsButton.label;</button> <div id="restorePreviousSessionSeparator"/> <button class="launchButton" id="restorePreviousSession">&historyRestoreLastSession.label;</button> diff --git a/application/palemoon/base/content/abouthome/addons.png b/application/palemoon/components/abouthome/addons.png Binary files differindex 41519ce49..41519ce49 100644 --- a/application/palemoon/base/content/abouthome/addons.png +++ b/application/palemoon/components/abouthome/addons.png diff --git a/application/palemoon/base/content/abouthome/addons@2x.png b/application/palemoon/components/abouthome/addons@2x.png Binary files differindex d4d04ee8c..d4d04ee8c 100644 --- a/application/palemoon/base/content/abouthome/addons@2x.png +++ b/application/palemoon/components/abouthome/addons@2x.png diff --git a/application/palemoon/base/content/abouthome/bookmarks.png b/application/palemoon/components/abouthome/bookmarks.png Binary files differindex 5c7e194a6..5c7e194a6 100644 --- a/application/palemoon/base/content/abouthome/bookmarks.png +++ b/application/palemoon/components/abouthome/bookmarks.png diff --git a/application/palemoon/base/content/abouthome/bookmarks@2x.png b/application/palemoon/components/abouthome/bookmarks@2x.png Binary files differindex 7ede00744..7ede00744 100644 --- a/application/palemoon/base/content/abouthome/bookmarks@2x.png +++ b/application/palemoon/components/abouthome/bookmarks@2x.png diff --git a/application/palemoon/base/content/abouthome/downloads.png b/application/palemoon/components/abouthome/downloads.png Binary files differindex 3d4d10e7a..3d4d10e7a 100644 --- a/application/palemoon/base/content/abouthome/downloads.png +++ b/application/palemoon/components/abouthome/downloads.png diff --git a/application/palemoon/base/content/abouthome/downloads@2x.png b/application/palemoon/components/abouthome/downloads@2x.png Binary files differindex d384a22c6..d384a22c6 100644 --- a/application/palemoon/base/content/abouthome/downloads@2x.png +++ b/application/palemoon/components/abouthome/downloads@2x.png diff --git a/application/palemoon/base/content/abouthome/history.png b/application/palemoon/components/abouthome/history.png Binary files differindex ae742b1aa..ae742b1aa 100644 --- a/application/palemoon/base/content/abouthome/history.png +++ b/application/palemoon/components/abouthome/history.png diff --git a/application/palemoon/base/content/abouthome/history@2x.png b/application/palemoon/components/abouthome/history@2x.png Binary files differindex 696902e7c..696902e7c 100644 --- a/application/palemoon/base/content/abouthome/history@2x.png +++ b/application/palemoon/components/abouthome/history@2x.png diff --git a/application/palemoon/components/abouthome/jar.mn b/application/palemoon/components/abouthome/jar.mn new file mode 100644 index 000000000..e1ae4ac42 --- /dev/null +++ b/application/palemoon/components/abouthome/jar.mn @@ -0,0 +1,33 @@ +# 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/. + +browser.jar: +* content/browser/abouthome/aboutHome.xhtml + content/browser/abouthome/aboutHome.js +* content/browser/abouthome/aboutHome.css + content/browser/abouthome/noise.png + content/browser/abouthome/snippet1.png + content/browser/abouthome/snippet2.png + content/browser/abouthome/downloads.png + content/browser/abouthome/bookmarks.png + content/browser/abouthome/history.png + content/browser/abouthome/addons.png +#ifdef MOZ_SERVICES_SYNC + content/browser/abouthome/sync.png +#endif + content/browser/abouthome/settings.png + content/browser/abouthome/restore.png + content/browser/abouthome/restore-large.png + content/browser/abouthome/snippet1@2x.png + content/browser/abouthome/snippet2@2x.png + content/browser/abouthome/downloads@2x.png + content/browser/abouthome/bookmarks@2x.png + content/browser/abouthome/history@2x.png + content/browser/abouthome/addons@2x.png +#ifdef MOZ_SERVICES_SYNC + content/browser/abouthome/sync@2x.png +#endif + content/browser/abouthome/settings@2x.png + content/browser/abouthome/restore@2x.png + content/browser/abouthome/restore-large@2x.png
\ No newline at end of file diff --git a/application/palemoon/components/abouthome/moz.build b/application/palemoon/components/abouthome/moz.build new file mode 100644 index 000000000..2d64d506c --- /dev/null +++ b/application/palemoon/components/abouthome/moz.build @@ -0,0 +1,8 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +JAR_MANIFESTS += ['jar.mn'] + diff --git a/application/palemoon/base/content/abouthome/noise.png b/application/palemoon/components/abouthome/noise.png Binary files differindex 3467cf4d4..3467cf4d4 100644 --- a/application/palemoon/base/content/abouthome/noise.png +++ b/application/palemoon/components/abouthome/noise.png diff --git a/application/palemoon/base/content/abouthome/restore-large.png b/application/palemoon/components/abouthome/restore-large.png Binary files differindex ef593e6e1..ef593e6e1 100644 --- a/application/palemoon/base/content/abouthome/restore-large.png +++ b/application/palemoon/components/abouthome/restore-large.png diff --git a/application/palemoon/base/content/abouthome/restore-large@2x.png b/application/palemoon/components/abouthome/restore-large@2x.png Binary files differindex d5c71d0b0..d5c71d0b0 100644 --- a/application/palemoon/base/content/abouthome/restore-large@2x.png +++ b/application/palemoon/components/abouthome/restore-large@2x.png diff --git a/application/palemoon/base/content/abouthome/restore.png b/application/palemoon/components/abouthome/restore.png Binary files differindex 5c3d6f437..5c3d6f437 100644 --- a/application/palemoon/base/content/abouthome/restore.png +++ b/application/palemoon/components/abouthome/restore.png diff --git a/application/palemoon/base/content/abouthome/restore@2x.png b/application/palemoon/components/abouthome/restore@2x.png Binary files differindex 5acb63052..5acb63052 100644 --- a/application/palemoon/base/content/abouthome/restore@2x.png +++ b/application/palemoon/components/abouthome/restore@2x.png diff --git a/application/palemoon/base/content/abouthome/settings.png b/application/palemoon/components/abouthome/settings.png Binary files differindex 4b0c30990..4b0c30990 100644 --- a/application/palemoon/base/content/abouthome/settings.png +++ b/application/palemoon/components/abouthome/settings.png diff --git a/application/palemoon/base/content/abouthome/settings@2x.png b/application/palemoon/components/abouthome/settings@2x.png Binary files differindex c77cb9a92..c77cb9a92 100644 --- a/application/palemoon/base/content/abouthome/settings@2x.png +++ b/application/palemoon/components/abouthome/settings@2x.png diff --git a/application/palemoon/base/content/abouthome/snippet1.png b/application/palemoon/components/abouthome/snippet1.png Binary files differindex ce2ec55c2..ce2ec55c2 100644 --- a/application/palemoon/base/content/abouthome/snippet1.png +++ b/application/palemoon/components/abouthome/snippet1.png diff --git a/application/palemoon/base/content/abouthome/snippet1@2x.png b/application/palemoon/components/abouthome/snippet1@2x.png Binary files differindex f57cd0a82..f57cd0a82 100644 --- a/application/palemoon/base/content/abouthome/snippet1@2x.png +++ b/application/palemoon/components/abouthome/snippet1@2x.png diff --git a/application/palemoon/base/content/abouthome/snippet2.png b/application/palemoon/components/abouthome/snippet2.png Binary files differindex e0724fb6d..e0724fb6d 100644 --- a/application/palemoon/base/content/abouthome/snippet2.png +++ b/application/palemoon/components/abouthome/snippet2.png diff --git a/application/palemoon/base/content/abouthome/snippet2@2x.png b/application/palemoon/components/abouthome/snippet2@2x.png Binary files differindex 40577f52f..40577f52f 100644 --- a/application/palemoon/base/content/abouthome/snippet2@2x.png +++ b/application/palemoon/components/abouthome/snippet2@2x.png diff --git a/application/palemoon/base/content/abouthome/sync.png b/application/palemoon/components/abouthome/sync.png Binary files differindex 11e40cc93..11e40cc93 100644 --- a/application/palemoon/base/content/abouthome/sync.png +++ b/application/palemoon/components/abouthome/sync.png diff --git a/application/palemoon/base/content/abouthome/sync@2x.png b/application/palemoon/components/abouthome/sync@2x.png Binary files differindex 6354f5bf9..6354f5bf9 100644 --- a/application/palemoon/base/content/abouthome/sync@2x.png +++ b/application/palemoon/components/abouthome/sync@2x.png diff --git a/application/palemoon/components/build/moz.build b/application/palemoon/components/build/moz.build index c85723e16..ea1f77163 100644 --- a/application/palemoon/components/build/moz.build +++ b/application/palemoon/components/build/moz.build @@ -4,18 +4,13 @@ # 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/. -EXPORTS += [ - 'nsBrowserCompsCID.h', -] +EXPORTS += ['nsBrowserCompsCID.h'] -SOURCES += [ - 'nsModule.cpp', -] +SOURCES += ['nsModule.cpp'] XPCOMBinaryComponent('browsercomps') LOCAL_INCLUDES += [ - '../about', '../dirprovider', '../feeds', '../shell', diff --git a/application/palemoon/components/build/nsBrowserCompsCID.h b/application/palemoon/components/build/nsBrowserCompsCID.h index 23670ae80..bbaa9ab8a 100644 --- a/application/palemoon/components/build/nsBrowserCompsCID.h +++ b/application/palemoon/components/build/nsBrowserCompsCID.h @@ -26,10 +26,6 @@ #define NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID \ { 0x136e2c4d, 0xc5a4, 0x477c, { 0xb1, 0x31, 0xd9, 0x3d, 0x7d, 0x70, 0x4f, 0x64 } } -// 7e4bb6ad-2fc4-4dc6-89ef-23e8e5ccf980 -#define NS_BROWSER_ABOUT_REDIRECTOR_CID \ -{ 0x7e4bb6ad, 0x2fc4, 0x4dc6, { 0x89, 0xef, 0x23, 0xe8, 0xe5, 0xcc, 0xf9, 0x80 } } - // {6DEB193C-F87D-4078-BC78-5E64655B4D62} #define NS_BROWSERDIRECTORYPROVIDER_CID \ { 0x6deb193c, 0xf87d, 0x4078, { 0xbc, 0x78, 0x5e, 0x64, 0x65, 0x5b, 0x4d, 0x62 } } diff --git a/application/palemoon/components/build/nsModule.cpp b/application/palemoon/components/build/nsModule.cpp index 304280ca9..f98fc08d7 100644 --- a/application/palemoon/components/build/nsModule.cpp +++ b/application/palemoon/components/build/nsModule.cpp @@ -18,8 +18,6 @@ #include "rdf.h" #include "nsFeedSniffer.h" -#include "AboutRedirector.h" -#include "nsIAboutModule.h" #include "nsNetCID.h" @@ -45,7 +43,6 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID); NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID); #endif NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID); -NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID); #ifdef XP_MACOSX NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID); #endif @@ -58,7 +55,6 @@ static const mozilla::Module::CIDEntry kBrowserCIDs[] = { { &kNS_SHELLSERVICE_CID, false, nullptr, nsGNOMEShellServiceConstructor }, #endif { &kNS_FEEDSNIFFER_CID, false, nullptr, nsFeedSnifferConstructor }, - { &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, nullptr, AboutRedirector::Create }, #ifdef XP_MACOSX { &kNS_SHELLSERVICE_CID, false, nullptr, nsMacShellServiceConstructor }, #endif @@ -73,22 +69,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = { { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID }, #endif { NS_FEEDSNIFFER_CONTRACTID, &kNS_FEEDSNIFFER_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "certerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "socialerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "feeds", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "privatebrowsing", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "rights", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "palemoon", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "robots", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sessionrestore", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, -#ifdef MOZ_SERVICES_SYNC - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-tabs", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-progress", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, -#endif - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "home", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "newtab", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "permissions", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "downloads", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, #ifdef XP_MACOSX { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID }, #endif diff --git a/application/palemoon/components/certerror/jar.mn b/application/palemoon/components/certerror/jar.mn index 64aecae92..08e071027 100644 --- a/application/palemoon/components/certerror/jar.mn +++ b/application/palemoon/components/certerror/jar.mn @@ -3,5 +3,5 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: - content/browser/certerror/aboutCertError.xhtml (content/aboutCertError.xhtml) - content/browser/certerror/aboutCertError.css (content/aboutCertError.css) + content/browser/certerror/aboutCertError.xhtml (content/aboutCertError.xhtml) + content/browser/certerror/aboutCertError.css (content/aboutCertError.css) diff --git a/application/palemoon/components/certerror/moz.build b/application/palemoon/components/certerror/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/components/certerror/moz.build +++ b/application/palemoon/components/certerror/moz.build @@ -4,5 +4,4 @@ # 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/. - JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file diff --git a/application/palemoon/components/dirprovider/moz.build b/application/palemoon/components/dirprovider/moz.build index e51e63449..b01c4a3bc 100644 --- a/application/palemoon/components/dirprovider/moz.build +++ b/application/palemoon/components/dirprovider/moz.build @@ -4,16 +4,10 @@ # 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/. -EXPORTS.mozilla.browser += [ - 'DirectoryProvider.h', -] +EXPORTS.mozilla.browser += ['DirectoryProvider.h'] -SOURCES += [ - 'DirectoryProvider.cpp', -] +SOURCES += ['DirectoryProvider.cpp'] FINAL_LIBRARY = 'browsercomps' -LOCAL_INCLUDES += [ - '../build' -] +LOCAL_INCLUDES += ['../build'] diff --git a/application/palemoon/components/downloads/jar.mn b/application/palemoon/components/downloads/jar.mn index 8f8c66dd7..8c0b51902 100644 --- a/application/palemoon/components/downloads/jar.mn +++ b/application/palemoon/components/downloads/jar.mn @@ -3,16 +3,16 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/downloads/download.xml (content/download.xml) - content/browser/downloads/download.css (content/download.css) - content/browser/downloads/downloads.css (content/downloads.css) -* content/browser/downloads/downloads.js (content/downloads.js) -* content/browser/downloads/downloadsOverlay.xul (content/downloadsOverlay.xul) - content/browser/downloads/indicator.js (content/indicator.js) - content/browser/downloads/indicatorOverlay.xul (content/indicatorOverlay.xul) -* content/browser/downloads/allDownloadsViewOverlay.xul (content/allDownloadsViewOverlay.xul) - content/browser/downloads/allDownloadsViewOverlay.js (content/allDownloadsViewOverlay.js) - content/browser/downloads/allDownloadsViewOverlay.css (content/allDownloadsViewOverlay.css) -* content/browser/downloads/contentAreaDownloadsView.xul (content/contentAreaDownloadsView.xul) - content/browser/downloads/contentAreaDownloadsView.js (content/contentAreaDownloadsView.js) - content/browser/downloads/contentAreaDownloadsView.css (content/contentAreaDownloadsView.css) +* content/browser/downloads/download.xml (content/download.xml) + content/browser/downloads/download.css (content/download.css) + content/browser/downloads/downloads.css (content/downloads.css) +* content/browser/downloads/downloads.js (content/downloads.js) +* content/browser/downloads/downloadsOverlay.xul (content/downloadsOverlay.xul) + content/browser/downloads/indicator.js (content/indicator.js) + content/browser/downloads/indicatorOverlay.xul (content/indicatorOverlay.xul) +* content/browser/downloads/allDownloadsViewOverlay.xul (content/allDownloadsViewOverlay.xul) + content/browser/downloads/allDownloadsViewOverlay.js (content/allDownloadsViewOverlay.js) + content/browser/downloads/allDownloadsViewOverlay.css (content/allDownloadsViewOverlay.css) +* content/browser/downloads/contentAreaDownloadsView.xul (content/contentAreaDownloadsView.xul) + content/browser/downloads/contentAreaDownloadsView.js (content/contentAreaDownloadsView.js) + content/browser/downloads/contentAreaDownloadsView.css (content/contentAreaDownloadsView.css) diff --git a/application/palemoon/components/feeds/WebContentConverter.js b/application/palemoon/components/feeds/WebContentConverter.js index 674c8f363..41679b028 100644 --- a/application/palemoon/components/feeds/WebContentConverter.js +++ b/application/palemoon/components/feeds/WebContentConverter.js @@ -63,7 +63,7 @@ const PREF_SELECTED_WEB = "browser.feeds.handlers.webservice"; const PREF_SELECTED_ACTION = "browser.feeds.handler"; const PREF_SELECTED_READER = "browser.feeds.handler.default"; const PREF_HANDLER_EXTERNAL_PREFIX = "network.protocol-handler.external"; -const PREF_ALLOW_DIFFERENT_HOST = "goanna.handlerService.allowRegisterFromDifferentHost"; +const PREF_ALLOW_DIFFERENT_HOST = "gecko.handlerService.allowRegisterFromDifferentHost"; const STRING_BUNDLE_URI = "chrome://browser/locale/feeds/subscribe.properties"; diff --git a/application/palemoon/components/feeds/jar.mn b/application/palemoon/components/feeds/jar.mn index 2fae7efae..f8896f877 100644 --- a/application/palemoon/components/feeds/jar.mn +++ b/application/palemoon/components/feeds/jar.mn @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: - content/browser/feeds/subscribe.xhtml (content/subscribe.xhtml) - content/browser/feeds/subscribe.js (content/subscribe.js) - content/browser/feeds/subscribe.xml (content/subscribe.xml) - content/browser/feeds/subscribe.css (content/subscribe.css) + content/browser/feeds/subscribe.xhtml (content/subscribe.xhtml) + content/browser/feeds/subscribe.js (content/subscribe.js) + content/browser/feeds/subscribe.xml (content/subscribe.xml) + content/browser/feeds/subscribe.css (content/subscribe.css) diff --git a/application/palemoon/components/feeds/moz.build b/application/palemoon/components/feeds/moz.build index 7ae9141aa..736920a73 100644 --- a/application/palemoon/components/feeds/moz.build +++ b/application/palemoon/components/feeds/moz.build @@ -13,9 +13,7 @@ XPIDL_SOURCES += [ XPIDL_MODULE = 'browser-feeds' -SOURCES += [ - 'nsFeedSniffer.cpp', -] +SOURCES += ['nsFeedSniffer.cpp'] EXTRA_COMPONENTS += [ 'BrowserFeeds.manifest', @@ -32,6 +30,4 @@ FINAL_LIBRARY = 'browsercomps' for var in ('MOZ_APP_NAME', 'MOZ_MACBUNDLE_NAME'): DEFINES[var] = CONFIG[var] -LOCAL_INCLUDES += [ - '../build', -] +LOCAL_INCLUDES += ['../build'] diff --git a/application/palemoon/components/fuel/moz.build b/application/palemoon/components/fuel/moz.build index e78eda088..5c468f27d 100644 --- a/application/palemoon/components/fuel/moz.build +++ b/application/palemoon/components/fuel/moz.build @@ -4,17 +4,11 @@ # 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/. -XPIDL_SOURCES += [ - 'fuelIApplication.idl', -] +XPIDL_SOURCES += ['fuelIApplication.idl'] XPIDL_MODULE = 'fuel' -EXTRA_COMPONENTS += [ - 'fuelApplication.manifest', -] +EXTRA_COMPONENTS += ['fuelApplication.manifest'] -EXTRA_PP_COMPONENTS += [ - 'fuelApplication.js', -] +EXTRA_PP_COMPONENTS += ['fuelApplication.js'] diff --git a/application/palemoon/components/moz.build b/application/palemoon/components/moz.build index 397bf5142..eb2771c48 100644 --- a/application/palemoon/components/moz.build +++ b/application/palemoon/components/moz.build @@ -5,12 +5,14 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. DIRS += [ - 'about', + 'abouthome', 'certerror', 'dirprovider', 'downloads', 'feeds', 'fuel', + 'newtab', + 'pageinfo', 'places', 'permissions', 'preferences', @@ -23,6 +25,9 @@ DIRS += [ if CONFIG['MOZ_BROWSER_STATUSBAR']: DIRS += ['statusbar'] +if CONFIG['MOZ_SERVICES_SYNC']: + DIRS += ['sync'] + DIRS += ['build'] XPIDL_SOURCES += [ @@ -32,9 +37,9 @@ XPIDL_SOURCES += [ XPIDL_MODULE = 'browsercompsbase' -EXTRA_COMPONENTS += [ 'BrowserComponents.manifest' ] - EXTRA_PP_COMPONENTS += [ + 'BrowserComponents.manifest', + 'nsAboutRedirector.js', 'nsBrowserContentHandler.js', 'nsBrowserGlue.js', ] diff --git a/application/palemoon/base/content/newtab/cells.js b/application/palemoon/components/newtab/cells.js index 47d4ef52d..47d4ef52d 100644 --- a/application/palemoon/base/content/newtab/cells.js +++ b/application/palemoon/components/newtab/cells.js diff --git a/application/palemoon/base/content/newtab/drag.js b/application/palemoon/components/newtab/drag.js index e3928ebd0..e3928ebd0 100644 --- a/application/palemoon/base/content/newtab/drag.js +++ b/application/palemoon/components/newtab/drag.js diff --git a/application/palemoon/base/content/newtab/dragDataHelper.js b/application/palemoon/components/newtab/dragDataHelper.js index 675ff2671..675ff2671 100644 --- a/application/palemoon/base/content/newtab/dragDataHelper.js +++ b/application/palemoon/components/newtab/dragDataHelper.js diff --git a/application/palemoon/base/content/newtab/drop.js b/application/palemoon/components/newtab/drop.js index 748652455..748652455 100644 --- a/application/palemoon/base/content/newtab/drop.js +++ b/application/palemoon/components/newtab/drop.js diff --git a/application/palemoon/base/content/newtab/dropPreview.js b/application/palemoon/components/newtab/dropPreview.js index fd7587a35..fd7587a35 100644 --- a/application/palemoon/base/content/newtab/dropPreview.js +++ b/application/palemoon/components/newtab/dropPreview.js diff --git a/application/palemoon/base/content/newtab/dropTargetShim.js b/application/palemoon/components/newtab/dropTargetShim.js index 57a97fa00..57a97fa00 100644 --- a/application/palemoon/base/content/newtab/dropTargetShim.js +++ b/application/palemoon/components/newtab/dropTargetShim.js diff --git a/application/palemoon/base/content/newtab/grid.js b/application/palemoon/components/newtab/grid.js index db3d319c3..db3d319c3 100644 --- a/application/palemoon/base/content/newtab/grid.js +++ b/application/palemoon/components/newtab/grid.js diff --git a/application/palemoon/components/newtab/jar.mn b/application/palemoon/components/newtab/jar.mn new file mode 100644 index 000000000..2d6291422 --- /dev/null +++ b/application/palemoon/components/newtab/jar.mn @@ -0,0 +1,8 @@ +# 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/. + +browser.jar: + content/browser/newtab/newTab.xhtml +* content/browser/newtab/newTab.js + content/browser/newtab/newTab.css
\ No newline at end of file diff --git a/application/palemoon/components/newtab/moz.build b/application/palemoon/components/newtab/moz.build new file mode 100644 index 000000000..2d64d506c --- /dev/null +++ b/application/palemoon/components/newtab/moz.build @@ -0,0 +1,8 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +JAR_MANIFESTS += ['jar.mn'] + diff --git a/application/palemoon/base/content/newtab/newTab.css b/application/palemoon/components/newtab/newTab.css index 3c7cfa102..3c7cfa102 100644 --- a/application/palemoon/base/content/newtab/newTab.css +++ b/application/palemoon/components/newtab/newTab.css diff --git a/application/palemoon/base/content/newtab/newTab.js b/application/palemoon/components/newtab/newTab.js index 0022f21bb..0022f21bb 100644 --- a/application/palemoon/base/content/newtab/newTab.js +++ b/application/palemoon/components/newtab/newTab.js diff --git a/application/palemoon/base/content/newtab/newTab.xhtml b/application/palemoon/components/newtab/newTab.xhtml index de000e723..de000e723 100644 --- a/application/palemoon/base/content/newtab/newTab.xhtml +++ b/application/palemoon/components/newtab/newTab.xhtml diff --git a/application/palemoon/base/content/newtab/page.js b/application/palemoon/components/newtab/page.js index 7117d4527..7117d4527 100644 --- a/application/palemoon/base/content/newtab/page.js +++ b/application/palemoon/components/newtab/page.js diff --git a/application/palemoon/base/content/newtab/search.js b/application/palemoon/components/newtab/search.js index 8bc959eee..8bc959eee 100644 --- a/application/palemoon/base/content/newtab/search.js +++ b/application/palemoon/components/newtab/search.js diff --git a/application/palemoon/base/content/newtab/sites.js b/application/palemoon/components/newtab/sites.js index a368146bb..a368146bb 100644 --- a/application/palemoon/base/content/newtab/sites.js +++ b/application/palemoon/components/newtab/sites.js diff --git a/application/palemoon/base/content/newtab/transformations.js b/application/palemoon/components/newtab/transformations.js index f7db0ad84..f7db0ad84 100644 --- a/application/palemoon/base/content/newtab/transformations.js +++ b/application/palemoon/components/newtab/transformations.js diff --git a/application/palemoon/base/content/newtab/undo.js b/application/palemoon/components/newtab/undo.js index b856914d2..b856914d2 100644 --- a/application/palemoon/base/content/newtab/undo.js +++ b/application/palemoon/components/newtab/undo.js diff --git a/application/palemoon/base/content/newtab/updater.js b/application/palemoon/components/newtab/updater.js index 2bab74d70..2bab74d70 100644 --- a/application/palemoon/base/content/newtab/updater.js +++ b/application/palemoon/components/newtab/updater.js diff --git a/application/palemoon/components/nsAboutRedirector.js b/application/palemoon/components/nsAboutRedirector.js new file mode 100644 index 000000000..9c7d7953f --- /dev/null +++ b/application/palemoon/components/nsAboutRedirector.js @@ -0,0 +1,118 @@ +/* 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/. */ + +var Ci = Components.interfaces; +var Cr = Components.results; +var Cu = Components.utils; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); + +// See: netwerk/protocol/about/nsIAboutModule.idl +const URI_SAFE_FOR_UNTRUSTED_CONTENT = Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT; +const ALLOW_SCRIPT = Ci.nsIAboutModule.ALLOW_SCRIPT; +const HIDE_FROM_ABOUTABOUT = Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT; +const MAKE_LINKABLE = Ci.nsIAboutModule.MAKE_LINKABLE; + +function AboutRedirector() {} +AboutRedirector.prototype = { + classDescription: "Browser about: Redirector", + classID: Components.ID("{8cc51368-6aa0-43e8-b762-bde9b9fd828c}"), + QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]), + + // Each entry in the map has the key as the part after the "about:" and the + // value as a record with url and flags entries. Note that each addition here + // should be coupled with a corresponding addition in BrowserComponents.manifest. + _redirMap: { + "certerror": { + url: "chrome://browser/content/certerror/aboutCertError.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | ALLOW_SCRIPT | HIDE_FROM_ABOUTABOUT) + }, + "downloads": { + url: "chrome://browser/content/downloads/contentAreaDownloadsView.xul", + flags: ALLOW_SCRIPT + }, + "feeds": { + url: "chrome://browser/content/feeds/subscribe.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | ALLOW_SCRIPT | HIDE_FROM_ABOUTABOUT) + }, + "home": { + url: "chrome://browser/content/abouthome/aboutHome.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | MAKE_LINKABLE | ALLOW_SCRIPT) + }, + "newtab": { + url: "chrome://browser/content/newtab/newTab.xhtml", + flags: ALLOW_SCRIPT + }, + "palemoon": { + url: "chrome://browser/content/palemoon.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | HIDE_FROM_ABOUTABOUT) + }, + "permissions": { + url: "chrome://browser/content/permissions/aboutPermissions.xul", + flags: ALLOW_SCRIPT + }, + "privatebrowsing": { + url: "chrome://browser/content/aboutPrivateBrowsing.xhtml", + flags: ALLOW_SCRIPT + }, + "rights": { + url: "chrome://global/content/aboutRights.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | MAKE_LINKABLE | ALLOW_SCRIPT) + }, + "robots": { + url: "chrome://browser/content/aboutRobots.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | ALLOW_SCRIPT | HIDE_FROM_ABOUTABOUT) + }, + "sessionrestore": { + url: "chrome://browser/content/aboutSessionRestore.xhtml", + flags: ALLOW_SCRIPT + }, +#ifdef MOZ_SERVICES_SYNC + "sync-progress": { + url: "chrome://browser/content/sync/progress.xhtml", + flags: ALLOW_SCRIPT + }, + "sync-tabs": { + url: "chrome://browser/content/sync/aboutSyncTabs.xul", + flags: ALLOW_SCRIPT + }, +#endif + }, + + /** + * Gets the module name from the given URI. + */ + _getModuleName: function AboutRedirector__getModuleName(aURI) { + // Strip out the first ? or #, and anything following it + let name = (/[^?#]+/.exec(aURI.path))[0]; + return name.toLowerCase(); + }, + + getURIFlags: function(aURI) { + let name = this._getModuleName(aURI); + if (!(name in this._redirMap)) + throw Cr.NS_ERROR_ILLEGAL_VALUE; + return this._redirMap[name].flags; + }, + + newChannel: function(aURI, aLoadInfo) { + let name = this._getModuleName(aURI); + if (!(name in this._redirMap)) + throw Cr.NS_ERROR_ILLEGAL_VALUE; + + let newURI = Services.io.newURI(this._redirMap[name].url, null, null); + let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, aLoadInfo); + channel.originalURI = aURI; + + if (this._redirMap[name].flags & Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT) { + let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(aURI); + channel.owner = principal; + } + + return channel; + } +}; + +var NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutRedirector]); diff --git a/application/palemoon/base/content/pageinfo/feeds.js b/application/palemoon/components/pageinfo/feeds.js index 468d8c19d..468d8c19d 100644 --- a/application/palemoon/base/content/pageinfo/feeds.js +++ b/application/palemoon/components/pageinfo/feeds.js diff --git a/application/palemoon/base/content/pageinfo/feeds.xml b/application/palemoon/components/pageinfo/feeds.xml index 782c05a73..782c05a73 100644 --- a/application/palemoon/base/content/pageinfo/feeds.xml +++ b/application/palemoon/components/pageinfo/feeds.xml diff --git a/application/palemoon/components/pageinfo/jar.mn b/application/palemoon/components/pageinfo/jar.mn new file mode 100644 index 000000000..229f99168 --- /dev/null +++ b/application/palemoon/components/pageinfo/jar.mn @@ -0,0 +1,13 @@ +# 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/. + +browser.jar: +* content/browser/pageinfo/pageInfo.xul + content/browser/pageinfo/pageInfo.js + content/browser/pageinfo/pageInfo.css + content/browser/pageinfo/pageInfo.xml + content/browser/pageinfo/feeds.js + content/browser/pageinfo/feeds.xml + content/browser/pageinfo/permissions.js + content/browser/pageinfo/security.js
\ No newline at end of file diff --git a/application/palemoon/components/pageinfo/moz.build b/application/palemoon/components/pageinfo/moz.build new file mode 100644 index 000000000..2d64d506c --- /dev/null +++ b/application/palemoon/components/pageinfo/moz.build @@ -0,0 +1,8 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +JAR_MANIFESTS += ['jar.mn'] + diff --git a/application/palemoon/base/content/pageinfo/pageInfo.css b/application/palemoon/components/pageinfo/pageInfo.css index 622b56bb5..622b56bb5 100644 --- a/application/palemoon/base/content/pageinfo/pageInfo.css +++ b/application/palemoon/components/pageinfo/pageInfo.css diff --git a/application/palemoon/base/content/pageinfo/pageInfo.js b/application/palemoon/components/pageinfo/pageInfo.js index 600174ad9..600174ad9 100644 --- a/application/palemoon/base/content/pageinfo/pageInfo.js +++ b/application/palemoon/components/pageinfo/pageInfo.js diff --git a/application/palemoon/base/content/pageinfo/pageInfo.xml b/application/palemoon/components/pageinfo/pageInfo.xml index 20d330046..20d330046 100644 --- a/application/palemoon/base/content/pageinfo/pageInfo.xml +++ b/application/palemoon/components/pageinfo/pageInfo.xml diff --git a/application/palemoon/base/content/pageinfo/pageInfo.xul b/application/palemoon/components/pageinfo/pageInfo.xul index e3a61d31e..c7c486ab9 100644 --- a/application/palemoon/base/content/pageinfo/pageInfo.xul +++ b/application/palemoon/components/pageinfo/pageInfo.xul @@ -501,7 +501,7 @@ </deck> #ifdef XP_MACOSX -#include ../browserMountPoints.inc +#include ../../base/content/browserMountPoints.inc #endif </window> diff --git a/application/palemoon/base/content/pageinfo/permissions.js b/application/palemoon/components/pageinfo/permissions.js index 4f8382f66..4f8382f66 100644 --- a/application/palemoon/base/content/pageinfo/permissions.js +++ b/application/palemoon/components/pageinfo/permissions.js diff --git a/application/palemoon/base/content/pageinfo/security.js b/application/palemoon/components/pageinfo/security.js index e791ab92a..e791ab92a 100644 --- a/application/palemoon/base/content/pageinfo/security.js +++ b/application/palemoon/components/pageinfo/security.js diff --git a/application/palemoon/components/permissions/jar.mn b/application/palemoon/components/permissions/jar.mn index 53fb2b41e..c78893837 100644 --- a/application/palemoon/components/permissions/jar.mn +++ b/application/palemoon/components/permissions/jar.mn @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: - content/browser/permissions/aboutPermissions.xul - content/browser/permissions/aboutPermissions.js - content/browser/permissions/aboutPermissions.css - content/browser/permissions/aboutPermissions.xml + content/browser/permissions/aboutPermissions.xul + content/browser/permissions/aboutPermissions.js + content/browser/permissions/aboutPermissions.css + content/browser/permissions/aboutPermissions.xml diff --git a/application/palemoon/components/permissions/moz.build b/application/palemoon/components/permissions/moz.build index a4c26de89..3bbe67297 100644 --- a/application/palemoon/components/permissions/moz.build +++ b/application/palemoon/components/permissions/moz.build @@ -4,5 +4,4 @@ # 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/. - JAR_MANIFESTS += ['jar.mn'] diff --git a/application/palemoon/components/places/jar.mn b/application/palemoon/components/places/jar.mn index 44ae61fd3..41222e156 100644 --- a/application/palemoon/components/places/jar.mn +++ b/application/palemoon/components/places/jar.mn @@ -6,29 +6,29 @@ browser.jar: % overlay chrome://browser/content/places/places.xul chrome://browser/content/places/downloadsViewOverlay.xul # Provide another URI for the bookmarkProperties dialog so we can persist the # attributes separately - content/browser/places/bookmarkProperties2.xul (content/bookmarkProperties.xul) -* content/browser/places/places.xul (content/places.xul) -* content/browser/places/places.js (content/places.js) - content/browser/places/places.css (content/places.css) - content/browser/places/organizer.css (content/organizer.css) - content/browser/places/bookmarkProperties.xul (content/bookmarkProperties.xul) - content/browser/places/bookmarkProperties.js (content/bookmarkProperties.js) - content/browser/places/placesOverlay.xul (content/placesOverlay.xul) -* content/browser/places/menu.xml (content/menu.xml) - content/browser/places/tree.xml (content/tree.xml) - content/browser/places/controller.js (content/controller.js) - content/browser/places/treeView.js (content/treeView.js) -* content/browser/places/browserPlacesViews.js (content/browserPlacesViews.js) + content/browser/places/bookmarkProperties2.xul (content/bookmarkProperties.xul) +* content/browser/places/places.xul (content/places.xul) +* content/browser/places/places.js (content/places.js) + content/browser/places/places.css (content/places.css) + content/browser/places/organizer.css (content/organizer.css) + content/browser/places/bookmarkProperties.xul (content/bookmarkProperties.xul) + content/browser/places/bookmarkProperties.js (content/bookmarkProperties.js) + content/browser/places/placesOverlay.xul (content/placesOverlay.xul) +* content/browser/places/menu.xml (content/menu.xml) + content/browser/places/tree.xml (content/tree.xml) + content/browser/places/controller.js (content/controller.js) + content/browser/places/treeView.js (content/treeView.js) +* content/browser/places/browserPlacesViews.js (content/browserPlacesViews.js) # keep the Places version of the history sidebar at history/history-panel.xul # to prevent having to worry about between versions of the browser -* content/browser/history/history-panel.xul (content/history-panel.xul) - content/browser/places/history-panel.js (content/history-panel.js) +* content/browser/history/history-panel.xul (content/history-panel.xul) + content/browser/places/history-panel.js (content/history-panel.js) # ditto for the bookmarks sidebar - content/browser/bookmarks/bookmarksPanel.xul (content/bookmarksPanel.xul) - content/browser/bookmarks/bookmarksPanel.js (content/bookmarksPanel.js) -* content/browser/bookmarks/sidebarUtils.js (content/sidebarUtils.js) - content/browser/places/moveBookmarks.xul (content/moveBookmarks.xul) - content/browser/places/moveBookmarks.js (content/moveBookmarks.js) - content/browser/places/editBookmarkOverlay.xul (content/editBookmarkOverlay.xul) - content/browser/places/editBookmarkOverlay.js (content/editBookmarkOverlay.js) -* content/browser/places/downloadsViewOverlay.xul (content/downloadsViewOverlay.xul) + content/browser/bookmarks/bookmarksPanel.xul (content/bookmarksPanel.xul) + content/browser/bookmarks/bookmarksPanel.js (content/bookmarksPanel.js) +* content/browser/bookmarks/sidebarUtils.js (content/sidebarUtils.js) + content/browser/places/moveBookmarks.xul (content/moveBookmarks.xul) + content/browser/places/moveBookmarks.js (content/moveBookmarks.js) + content/browser/places/editBookmarkOverlay.xul (content/editBookmarkOverlay.xul) + content/browser/places/editBookmarkOverlay.js (content/editBookmarkOverlay.js) +* content/browser/places/downloadsViewOverlay.xul (content/downloadsViewOverlay.xul) diff --git a/application/palemoon/components/places/moz.build b/application/palemoon/components/places/moz.build index 2e35e1951..f8b0d125d 100644 --- a/application/palemoon/components/places/moz.build +++ b/application/palemoon/components/places/moz.build @@ -7,4 +7,3 @@ JAR_MANIFESTS += ['jar.mn'] EXTRA_JS_MODULES += [ 'PlacesUIUtils.jsm' ] - diff --git a/application/palemoon/components/preferences/jar.mn b/application/palemoon/components/preferences/jar.mn index 47909ddc9..6e143dea3 100644 --- a/application/palemoon/components/preferences/jar.mn +++ b/application/palemoon/components/preferences/jar.mn @@ -3,42 +3,42 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/preferences/advanced.xul -* content/browser/preferences/advanced.js - content/browser/preferences/applications.xul -* content/browser/preferences/applications.js - content/browser/preferences/applicationManager.xul -* content/browser/preferences/applicationManager.js -* content/browser/preferences/colors.xul -* content/browser/preferences/cookies.xul -* content/browser/preferences/cookies.js - content/browser/preferences/content.xul - content/browser/preferences/content.js -* content/browser/preferences/connection.xul - content/browser/preferences/connection.js -* content/browser/preferences/fonts.xul - content/browser/preferences/fonts.js - content/browser/preferences/handlers.xml - content/browser/preferences/handlers.css -* content/browser/preferences/languages.xul - content/browser/preferences/languages.js -* content/browser/preferences/main.xul - content/browser/preferences/main.js - content/browser/preferences/newtaburl.js - content/browser/preferences/permissions.xul -* content/browser/preferences/permissions.js -* content/browser/preferences/preferences.xul - content/browser/preferences/privacy.xul - content/browser/preferences/privacy.js - content/browser/preferences/sanitize.xul - content/browser/preferences/sanitize.js - content/browser/preferences/security.xul - content/browser/preferences/security.js - content/browser/preferences/selectBookmark.xul - content/browser/preferences/selectBookmark.js +* content/browser/preferences/advanced.xul +* content/browser/preferences/advanced.js + content/browser/preferences/applications.xul +* content/browser/preferences/applications.js + content/browser/preferences/applicationManager.xul +* content/browser/preferences/applicationManager.js +* content/browser/preferences/colors.xul +* content/browser/preferences/cookies.xul +* content/browser/preferences/cookies.js + content/browser/preferences/content.xul + content/browser/preferences/content.js +* content/browser/preferences/connection.xul + content/browser/preferences/connection.js +* content/browser/preferences/fonts.xul + content/browser/preferences/fonts.js + content/browser/preferences/handlers.xml + content/browser/preferences/handlers.css +* content/browser/preferences/languages.xul + content/browser/preferences/languages.js +* content/browser/preferences/main.xul + content/browser/preferences/main.js + content/browser/preferences/newtaburl.js + content/browser/preferences/permissions.xul +* content/browser/preferences/permissions.js +* content/browser/preferences/preferences.xul + content/browser/preferences/privacy.xul + content/browser/preferences/privacy.js + content/browser/preferences/sanitize.xul + content/browser/preferences/sanitize.js + content/browser/preferences/security.xul + content/browser/preferences/security.js + content/browser/preferences/selectBookmark.xul + content/browser/preferences/selectBookmark.js #ifdef MOZ_SERVICES_SYNC - content/browser/preferences/sync.xul - content/browser/preferences/sync.js + content/browser/preferences/sync.xul + content/browser/preferences/sync.js #endif -* content/browser/preferences/tabs.xul -* content/browser/preferences/tabs.js +* content/browser/preferences/tabs.xul +* content/browser/preferences/tabs.js diff --git a/application/palemoon/components/privatebrowsing/jar.mn b/application/palemoon/components/privatebrowsing/jar.mn index a01b7f0d3..75e985c13 100644 --- a/application/palemoon/components/privatebrowsing/jar.mn +++ b/application/palemoon/components/privatebrowsing/jar.mn @@ -3,4 +3,4 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/aboutPrivateBrowsing.xhtml (content/aboutPrivateBrowsing.xhtml) +* content/browser/aboutPrivateBrowsing.xhtml (content/aboutPrivateBrowsing.xhtml) diff --git a/application/palemoon/components/search/jar.mn b/application/palemoon/components/search/jar.mn index 88a33a98c..e6c42f97d 100644 --- a/application/palemoon/components/search/jar.mn +++ b/application/palemoon/components/search/jar.mn @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/search/search.xml (content/search.xml) - content/browser/search/searchbarBindings.css (content/searchbarBindings.css) - content/browser/search/engineManager.xul (content/engineManager.xul) - content/browser/search/engineManager.js (content/engineManager.js) +* content/browser/search/search.xml (content/search.xml) + content/browser/search/searchbarBindings.css (content/searchbarBindings.css) + content/browser/search/engineManager.xul (content/engineManager.xul) + content/browser/search/engineManager.js (content/engineManager.js) diff --git a/application/palemoon/components/search/moz.build b/application/palemoon/components/search/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/components/search/moz.build +++ b/application/palemoon/components/search/moz.build @@ -4,5 +4,4 @@ # 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/. - JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file diff --git a/application/palemoon/components/sessionstore/jar.mn b/application/palemoon/components/sessionstore/jar.mn index 529692e7e..825b00fbb 100644 --- a/application/palemoon/components/sessionstore/jar.mn +++ b/application/palemoon/components/sessionstore/jar.mn @@ -3,6 +3,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/aboutSessionRestore.xhtml (content/aboutSessionRestore.xhtml) -* content/browser/aboutSessionRestore.js (content/aboutSessionRestore.js) - content/browser/content-sessionStore.js (content/content-sessionStore.js) +* content/browser/aboutSessionRestore.xhtml (content/aboutSessionRestore.xhtml) +* content/browser/aboutSessionRestore.js (content/aboutSessionRestore.js) + content/browser/content-sessionStore.js (content/content-sessionStore.js) diff --git a/application/palemoon/components/sessionstore/moz.build b/application/palemoon/components/sessionstore/moz.build index 8b38aeba5..84278dafa 100644 --- a/application/palemoon/components/sessionstore/moz.build +++ b/application/palemoon/components/sessionstore/moz.build @@ -26,6 +26,4 @@ EXTRA_JS_MODULES.sessionstore = [ 'XPathGenerator.jsm', ] -EXTRA_PP_JS_MODULES.sessionstore += [ - 'SessionStore.jsm', -]
\ No newline at end of file +EXTRA_PP_JS_MODULES.sessionstore += ['SessionStore.jsm']
\ No newline at end of file diff --git a/application/palemoon/components/shell/jar.mn b/application/palemoon/components/shell/jar.mn index 1f33b5d56..0864e1b30 100644 --- a/application/palemoon/components/shell/jar.mn +++ b/application/palemoon/components/shell/jar.mn @@ -3,5 +3,5 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/setDesktopBackground.xul (content/setDesktopBackground.xul) - content/browser/setDesktopBackground.js (content/setDesktopBackground.js) +* content/browser/setDesktopBackground.xul (content/setDesktopBackground.xul) + content/browser/setDesktopBackground.js (content/setDesktopBackground.js) diff --git a/application/palemoon/components/shell/moz.build b/application/palemoon/components/shell/moz.build index 94ec88571..16bffd7d9 100644 --- a/application/palemoon/components/shell/moz.build +++ b/application/palemoon/components/shell/moz.build @@ -6,37 +6,23 @@ JAR_MANIFESTS += ['jar.mn'] -XPIDL_SOURCES += [ - 'nsIShellService.idl', -] +XPIDL_SOURCES += ['nsIShellService.idl'] if CONFIG['OS_ARCH'] == 'WINNT': - XPIDL_SOURCES += [ - 'nsIWindowsShellService.idl', - ] + XPIDL_SOURCES += ['nsIWindowsShellService.idl'] elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': - XPIDL_SOURCES += [ - 'nsIMacShellService.idl', - ] + XPIDL_SOURCES += ['nsIMacShellService.idl'] elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: - XPIDL_SOURCES += [ - 'nsIGNOMEShellService.idl', - ] + XPIDL_SOURCES += ['nsIGNOMEShellService.idl'] XPIDL_MODULE = 'shellservice' if CONFIG['OS_ARCH'] == 'WINNT': - SOURCES += [ - 'nsWindowsShellService.cpp', - ] + SOURCES += ['nsWindowsShellService.cpp'] elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': - SOURCES += [ - 'nsMacShellService.cpp', - ] + SOURCES += ['nsMacShellService.cpp'] elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: - SOURCES += [ - 'nsGNOMEShellService.cpp', - ] + SOURCES += ['nsGNOMEShellService.cpp'] if SOURCES: FINAL_LIBRARY = 'browsercomps' @@ -46,9 +32,7 @@ EXTRA_COMPONENTS += [ 'nsSetDefaultBrowser.manifest', ] -EXTRA_JS_MODULES += [ - 'ShellService.jsm', -] +EXTRA_JS_MODULES += ['ShellService.jsm'] for var in ('MOZ_APP_NAME', 'MOZ_APP_VERSION'): DEFINES[var] = '"%s"' % CONFIG[var] diff --git a/application/palemoon/components/statusbar/jar.mn b/application/palemoon/components/statusbar/jar.mn index db7f278c7..b5a8d09b2 100644 --- a/application/palemoon/components/statusbar/jar.mn +++ b/application/palemoon/components/statusbar/jar.mn @@ -3,13 +3,13 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -% overlay chrome://browser/content/browser.xul chrome://browser/content/statusbar/overlay.xul -% style chrome://global/content/customizeToolbar.xul chrome://browser/skin/statusbar/overlay.css - content/browser/statusbar/overlay.js (content/overlay.js) - content/browser/statusbar/prefs.js (content/prefs.js) - content/browser/statusbar/prefs.xml (content/prefs.xml) - content/browser/statusbar/tabbrowser.xml (content/tabbrowser.xml) - content/browser/statusbar/overlay.xul (content/overlay.xul) - content/browser/statusbar/prefs.xul (content/prefs.xul) - content/browser/statusbar/overlay.css (content/overlay.css) - content/browser/statusbar/prefs.css (content/prefs.css)
\ No newline at end of file +% overlay chrome://browser/content/browser.xul chrome://browser/content/statusbar/overlay.xul +% style chrome://global/content/customizeToolbar.xul chrome://browser/skin/statusbar/overlay.css + content/browser/statusbar/overlay.js (content/overlay.js) + content/browser/statusbar/prefs.js (content/prefs.js) + content/browser/statusbar/prefs.xml (content/prefs.xml) + content/browser/statusbar/tabbrowser.xml (content/tabbrowser.xml) + content/browser/statusbar/overlay.xul (content/overlay.xul) + content/browser/statusbar/prefs.xul (content/prefs.xul) + content/browser/statusbar/overlay.css (content/overlay.css) + content/browser/statusbar/prefs.css (content/prefs.css)
\ No newline at end of file diff --git a/application/palemoon/base/content/sync/aboutSyncTabs-bindings.xml b/application/palemoon/components/sync/aboutSyncTabs-bindings.xml index e6108209a..e6108209a 100644 --- a/application/palemoon/base/content/sync/aboutSyncTabs-bindings.xml +++ b/application/palemoon/components/sync/aboutSyncTabs-bindings.xml diff --git a/application/palemoon/base/content/sync/aboutSyncTabs.css b/application/palemoon/components/sync/aboutSyncTabs.css index 5a353175b..5a353175b 100644 --- a/application/palemoon/base/content/sync/aboutSyncTabs.css +++ b/application/palemoon/components/sync/aboutSyncTabs.css diff --git a/application/palemoon/base/content/sync/aboutSyncTabs.js b/application/palemoon/components/sync/aboutSyncTabs.js index 410494b5b..410494b5b 100644 --- a/application/palemoon/base/content/sync/aboutSyncTabs.js +++ b/application/palemoon/components/sync/aboutSyncTabs.js diff --git a/application/palemoon/base/content/sync/aboutSyncTabs.xul b/application/palemoon/components/sync/aboutSyncTabs.xul index a4aa0032f..a4aa0032f 100644 --- a/application/palemoon/base/content/sync/aboutSyncTabs.xul +++ b/application/palemoon/components/sync/aboutSyncTabs.xul diff --git a/application/palemoon/base/content/sync/addDevice.js b/application/palemoon/components/sync/addDevice.js index 0390d4397..0390d4397 100644 --- a/application/palemoon/base/content/sync/addDevice.js +++ b/application/palemoon/components/sync/addDevice.js diff --git a/application/palemoon/base/content/sync/addDevice.xul b/application/palemoon/components/sync/addDevice.xul index f2371aad0..f2371aad0 100644 --- a/application/palemoon/base/content/sync/addDevice.xul +++ b/application/palemoon/components/sync/addDevice.xul diff --git a/application/palemoon/base/content/sync/genericChange.js b/application/palemoon/components/sync/genericChange.js index df6639178..df6639178 100644 --- a/application/palemoon/base/content/sync/genericChange.js +++ b/application/palemoon/components/sync/genericChange.js diff --git a/application/palemoon/base/content/sync/genericChange.xul b/application/palemoon/components/sync/genericChange.xul index 3c0b2cd6c..3c0b2cd6c 100644 --- a/application/palemoon/base/content/sync/genericChange.xul +++ b/application/palemoon/components/sync/genericChange.xul diff --git a/application/palemoon/components/sync/jar.mn b/application/palemoon/components/sync/jar.mn new file mode 100644 index 000000000..3782038cd --- /dev/null +++ b/application/palemoon/components/sync/jar.mn @@ -0,0 +1,22 @@ +# 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/. + +browser.jar: + content/browser/sync/aboutSyncTabs.xul + content/browser/sync/aboutSyncTabs.js + content/browser/sync/aboutSyncTabs.css + content/browser/sync/aboutSyncTabs-bindings.xml + content/browser/sync/setup.xul + content/browser/sync/addDevice.js + content/browser/sync/addDevice.xul + content/browser/sync/setup.js + content/browser/sync/genericChange.xul + content/browser/sync/genericChange.js + content/browser/sync/key.xhtml + content/browser/sync/notification.xml + content/browser/sync/quota.xul + content/browser/sync/quota.js + content/browser/sync/utils.js + content/browser/sync/progress.js + content/browser/sync/progress.xhtml
\ No newline at end of file diff --git a/application/palemoon/base/content/sync/key.xhtml b/application/palemoon/components/sync/key.xhtml index 92abf0ee6..92abf0ee6 100644 --- a/application/palemoon/base/content/sync/key.xhtml +++ b/application/palemoon/components/sync/key.xhtml diff --git a/application/palemoon/components/sync/moz.build b/application/palemoon/components/sync/moz.build new file mode 100644 index 000000000..2d64d506c --- /dev/null +++ b/application/palemoon/components/sync/moz.build @@ -0,0 +1,8 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +JAR_MANIFESTS += ['jar.mn'] + diff --git a/application/palemoon/base/content/sync/notification.xml b/application/palemoon/components/sync/notification.xml index 8ac881e08..8ac881e08 100644 --- a/application/palemoon/base/content/sync/notification.xml +++ b/application/palemoon/components/sync/notification.xml diff --git a/application/palemoon/base/content/sync/progress.js b/application/palemoon/components/sync/progress.js index 101160fa8..101160fa8 100644 --- a/application/palemoon/base/content/sync/progress.js +++ b/application/palemoon/components/sync/progress.js diff --git a/application/palemoon/base/content/sync/progress.xhtml b/application/palemoon/components/sync/progress.xhtml index d403cb20d..d403cb20d 100644 --- a/application/palemoon/base/content/sync/progress.xhtml +++ b/application/palemoon/components/sync/progress.xhtml diff --git a/application/palemoon/base/content/sync/quota.js b/application/palemoon/components/sync/quota.js index b416a44cc..b416a44cc 100644 --- a/application/palemoon/base/content/sync/quota.js +++ b/application/palemoon/components/sync/quota.js diff --git a/application/palemoon/base/content/sync/quota.xul b/application/palemoon/components/sync/quota.xul index 99e6ed78b..99e6ed78b 100644 --- a/application/palemoon/base/content/sync/quota.xul +++ b/application/palemoon/components/sync/quota.xul diff --git a/application/palemoon/base/content/sync/setup.js b/application/palemoon/components/sync/setup.js index e8d67a5f6..e8d67a5f6 100644 --- a/application/palemoon/base/content/sync/setup.js +++ b/application/palemoon/components/sync/setup.js diff --git a/application/palemoon/base/content/sync/setup.xul b/application/palemoon/components/sync/setup.xul index cf2cc77e4..cf2cc77e4 100644 --- a/application/palemoon/base/content/sync/setup.xul +++ b/application/palemoon/components/sync/setup.xul diff --git a/application/palemoon/base/content/sync/utils.js b/application/palemoon/components/sync/utils.js index d41ecf18a..d41ecf18a 100644 --- a/application/palemoon/base/content/sync/utils.js +++ b/application/palemoon/components/sync/utils.js diff --git a/application/palemoon/configure.in b/application/palemoon/configure.in index 0dbb0d8bc..96f63781e 100644 --- a/application/palemoon/configure.in +++ b/application/palemoon/configure.in @@ -27,3 +27,16 @@ if test -n "$MOZ_BROWSER_STATUSBAR"; then fi AC_SUBST(MOZ_BROWSER_STATUSBAR) + +dnl ======================================================== +dnl = Disable Sync +dnl ======================================================== +MOZ_ARG_DISABLE_BOOL(sync, +[ --disable-sync Disable Sync], + MOZ_SERVICES_SYNC=, + MOZ_SERVICES_SYNC=1) + +if test -z "$MOZ_SERVICES_SYNC"; then + MOZ_SERVICES_CLOUDSYNC= +fi + diff --git a/application/palemoon/fonts/moz.build b/application/palemoon/fonts/moz.build index 02c027c46..8840a87f8 100644 --- a/application/palemoon/fonts/moz.build +++ b/application/palemoon/fonts/moz.build @@ -6,6 +6,4 @@ if CONFIG['OS_ARCH'] in ('WINNT', 'Linux'): DIST_SUBDIR = '' - FINAL_TARGET_FILES.fonts += [ - 'TwemojiMozilla.ttf' - ] + FINAL_TARGET_FILES.fonts += ['TwemojiMozilla.ttf'] diff --git a/application/palemoon/installer/package-manifest.in b/application/palemoon/installer/package-manifest.in index e63af4013..656e60cb7 100644 --- a/application/palemoon/installer/package-manifest.in +++ b/application/palemoon/installer/package-manifest.in @@ -248,8 +248,10 @@ ; gre location for now. @RESPATH@/defaults/pref/channel-prefs.js +#ifdef MOZ_SERVICES_SYNC ; Services (gre) prefs @RESPATH@/defaults/pref/services-sync.js +#endif ; [Layout Engine Resources] ; Style Sheets, Graphics and other Resources used by the layout engine. diff --git a/application/palemoon/locales/Makefile.in b/application/palemoon/locales/Makefile.in index c81329a9a..38a867658 100644 --- a/application/palemoon/locales/Makefile.in +++ b/application/palemoon/locales/Makefile.in @@ -121,7 +121,9 @@ searchplugins: $(addprefix $(FINAL_TARGET)/searchplugins/,$(SEARCHPLUGINS)) libs-%: $(NSINSTALL) -D $(DIST)/install @$(MAKE) -C ../../../toolkit/locales libs-$* +ifdef MOZ_SERVICES_SYNC @$(MAKE) -C ../../../services/sync/locales AB_CD=$* XPI_NAME=locale-$* +endif @$(MAKE) -C ../../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$* @$(MAKE) -C ../../../intl/locales AB_CD=$* XPI_NAME=locale-$* ifdef MOZ_DEVTOOLS diff --git a/application/palemoon/locales/en-US/chrome/browser/aboutHome.dtd b/application/palemoon/locales/en-US/chrome/browser/aboutHome.dtd index 03ffe629d..d3bd85fc8 100644 --- a/application/palemoon/locales/en-US/chrome/browser/aboutHome.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/aboutHome.dtd @@ -4,8 +4,10 @@ <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> %brandDTD; +#ifdef MOZ_SERVICES_SYNC <!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd"> %syncBrandDTD; +#endif <!-- These strings are used in the about:home page --> @@ -19,4 +21,6 @@ <!ENTITY abouthome.addonsButton.label "Add-ons"> <!ENTITY abouthome.appsButton.label "Marketplace"> <!ENTITY abouthome.downloadsButton.label "Downloads"> +#ifdef MOZ_SERVICES_SYNC <!ENTITY abouthome.syncButton.label "&syncBrand.shortName.label;"> +#endif
\ No newline at end of file diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.dtd b/application/palemoon/locales/en-US/chrome/browser/browser.dtd index 8632b44b4..439057a84 100644 --- a/application/palemoon/locales/en-US/chrome/browser/browser.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/browser.dtd @@ -567,6 +567,7 @@ just addresses the organization to follow, e.g. "This site is run by " --> The word "toolbar" is appended automatically and should not be contained below! --> <!ENTITY tabsToolbar.label "Browser tabs"> +#ifdef MOZ_SERVICES_SYNC <!-- LOCALIZATION NOTE (syncTabsMenu2.label): This appears in the history menu --> <!ENTITY syncTabsMenu2.label "Tabs From Other Devices"> @@ -577,6 +578,7 @@ just addresses the organization to follow, e.g. "This site is run by " --> <!ENTITY syncSyncNowItem.label "Sync Now"> <!ENTITY syncSyncNowItem.accesskey "S"> <!ENTITY syncToolbarButton.label "Sync"> +#endif <!ENTITY addonBarCloseButton.tooltip "Close Add-on Bar"> <!ENTITY toggleAddonBarCmd.key "/"> diff --git a/application/palemoon/locales/jar.mn b/application/palemoon/locales/jar.mn index e3477c320..0fc7f2c9b 100644 --- a/application/palemoon/locales/jar.mn +++ b/application/palemoon/locales/jar.mn @@ -6,93 +6,93 @@ @AB_CD@.jar: % locale browser @AB_CD@ %locale/browser/ - locale/browser/aboutCertError.dtd (%chrome/browser/aboutCertError.dtd) - locale/browser/aboutDialog.dtd (%chrome/browser/aboutDialog.dtd) - locale/browser/aboutPrivateBrowsing.dtd (%chrome/browser/aboutPrivateBrowsing.dtd) - locale/browser/aboutRobots.dtd (%chrome/browser/aboutRobots.dtd) - locale/browser/aboutHome.dtd (%chrome/browser/aboutHome.dtd) - locale/browser/aboutSessionRestore.dtd (%chrome/browser/aboutSessionRestore.dtd) + locale/browser/aboutCertError.dtd (%chrome/browser/aboutCertError.dtd) + locale/browser/aboutDialog.dtd (%chrome/browser/aboutDialog.dtd) + locale/browser/aboutPrivateBrowsing.dtd (%chrome/browser/aboutPrivateBrowsing.dtd) + locale/browser/aboutRobots.dtd (%chrome/browser/aboutRobots.dtd) +* locale/browser/aboutHome.dtd (%chrome/browser/aboutHome.dtd) + locale/browser/aboutSessionRestore.dtd (%chrome/browser/aboutSessionRestore.dtd) #ifdef MOZ_SERVICES_SYNC - locale/browser/syncProgress.dtd (%chrome/browser/syncProgress.dtd) - locale/browser/aboutSyncTabs.dtd (%chrome/browser/aboutSyncTabs.dtd) + locale/browser/syncProgress.dtd (%chrome/browser/syncProgress.dtd) + locale/browser/aboutSyncTabs.dtd (%chrome/browser/aboutSyncTabs.dtd) #endif -* locale/browser/browser.dtd (%chrome/browser/browser.dtd) - locale/browser/baseMenuOverlay.dtd (%chrome/browser/baseMenuOverlay.dtd) - locale/browser/charsetOverlay.dtd (%chrome/browser/charsetOverlay.dtd) - locale/browser/browser.properties (%chrome/browser/browser.properties) - locale/browser/charsetMenu.properties (%chrome/browser/charsetMenu.properties) - locale/browser/charsetMenu.dtd (%chrome/browser/charsetMenu.dtd) - locale/browser/newTab.dtd (%chrome/browser/newTab.dtd) - locale/browser/newTab.properties (%chrome/browser/newTab.properties) - locale/browser/openLocation.dtd (%chrome/browser/openLocation.dtd) - locale/browser/openLocation.properties (%chrome/browser/openLocation.properties) - locale/browser/pageInfo.dtd (%chrome/browser/pageInfo.dtd) - locale/browser/pageInfo.properties (%chrome/browser/pageInfo.properties) - locale/browser/palemoon.dtd (%chrome/browser/palemoon.dtd) - locale/browser/quitDialog.properties (%chrome/browser/quitDialog.properties) - locale/browser/safeMode.dtd (%chrome/browser/safeMode.dtd) - locale/browser/sanitize.dtd (%chrome/browser/sanitize.dtd) - locale/browser/search.properties (%chrome/browser/search.properties) - locale/browser/searchbar.dtd (%chrome/browser/searchbar.dtd) - locale/browser/engineManager.dtd (%chrome/browser/engineManager.dtd) - locale/browser/engineManager.properties (%chrome/browser/engineManager.properties) - locale/browser/setDesktopBackground.dtd (%chrome/browser/setDesktopBackground.dtd) - locale/browser/shellservice.properties (%chrome/browser/shellservice.properties) - locale/browser/statusbar/statusbar-overlay.dtd (%chrome/browser/statusbar/statusbar-overlay.dtd) - locale/browser/statusbar/statusbar-prefs.dtd (%chrome/browser/statusbar/statusbar-prefs.dtd) - locale/browser/statusbar/meta.properties (%chrome/browser/statusbar/meta.properties) - locale/browser/statusbar/overlay.properties (%chrome/browser/statusbar/overlay.properties) - locale/browser/statusbar/prefs.properties (%chrome/browser/statusbar/prefs.properties) - locale/browser/tabbrowser.dtd (%chrome/browser/tabbrowser.dtd) - locale/browser/tabbrowser.properties (%chrome/browser/tabbrowser.properties) - locale/browser/taskbar.properties (%chrome/browser/taskbar.properties) - locale/browser/downloads/downloads.dtd (%chrome/browser/downloads/downloads.dtd) - locale/browser/downloads/downloads.properties (%chrome/browser/downloads/downloads.properties) - locale/browser/places/places.dtd (%chrome/browser/places/places.dtd) - locale/browser/places/places.properties (%chrome/browser/places/places.properties) - locale/browser/places/editBookmarkOverlay.dtd (%chrome/browser/places/editBookmarkOverlay.dtd) - locale/browser/places/bookmarkProperties.properties (%chrome/browser/places/bookmarkProperties.properties) - locale/browser/preferences/selectBookmark.dtd (%chrome/browser/preferences/selectBookmark.dtd) - locale/browser/places/moveBookmarks.dtd (%chrome/browser/places/moveBookmarks.dtd) - locale/browser/feeds/subscribe.dtd (%chrome/browser/feeds/subscribe.dtd) - locale/browser/feeds/subscribe.properties (%chrome/browser/feeds/subscribe.properties) - locale/browser/permissions/aboutPermissions.dtd (%chrome/browser/permissions/aboutPermissions.dtd) - locale/browser/permissions/aboutPermissions.properties (%chrome/browser/permissions/aboutPermissions.properties) - locale/browser/preferences/advanced.dtd (%chrome/browser/preferences/advanced.dtd) - locale/browser/preferences/applicationManager.dtd (%chrome/browser/preferences/applicationManager.dtd) - locale/browser/preferences/applicationManager.properties (%chrome/browser/preferences/applicationManager.properties) - locale/browser/preferences/colors.dtd (%chrome/browser/preferences/colors.dtd) - locale/browser/preferences/cookies.dtd (%chrome/browser/preferences/cookies.dtd) - locale/browser/preferences/content.dtd (%chrome/browser/preferences/content.dtd) - locale/browser/preferences/connection.dtd (%chrome/browser/preferences/connection.dtd) - locale/browser/preferences/applications.dtd (%chrome/browser/preferences/applications.dtd) - locale/browser/preferences/fonts.dtd (%chrome/browser/preferences/fonts.dtd) - locale/browser/preferences/main.dtd (%chrome/browser/preferences/main.dtd) - locale/browser/preferences/languages.dtd (%chrome/browser/preferences/languages.dtd) - locale/browser/preferences/permissions.dtd (%chrome/browser/preferences/permissions.dtd) - locale/browser/preferences/preferences.dtd (%chrome/browser/preferences/preferences.dtd) - locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties) - locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd) - locale/browser/preferences/security.dtd (%chrome/browser/preferences/security.dtd) +* locale/browser/browser.dtd (%chrome/browser/browser.dtd) + locale/browser/baseMenuOverlay.dtd (%chrome/browser/baseMenuOverlay.dtd) + locale/browser/charsetOverlay.dtd (%chrome/browser/charsetOverlay.dtd) + locale/browser/browser.properties (%chrome/browser/browser.properties) + locale/browser/charsetMenu.properties (%chrome/browser/charsetMenu.properties) + locale/browser/charsetMenu.dtd (%chrome/browser/charsetMenu.dtd) + locale/browser/newTab.dtd (%chrome/browser/newTab.dtd) + locale/browser/newTab.properties (%chrome/browser/newTab.properties) + locale/browser/openLocation.dtd (%chrome/browser/openLocation.dtd) + locale/browser/openLocation.properties (%chrome/browser/openLocation.properties) + locale/browser/pageInfo.dtd (%chrome/browser/pageInfo.dtd) + locale/browser/pageInfo.properties (%chrome/browser/pageInfo.properties) + locale/browser/palemoon.dtd (%chrome/browser/palemoon.dtd) + locale/browser/quitDialog.properties (%chrome/browser/quitDialog.properties) + locale/browser/safeMode.dtd (%chrome/browser/safeMode.dtd) + locale/browser/sanitize.dtd (%chrome/browser/sanitize.dtd) + locale/browser/search.properties (%chrome/browser/search.properties) + locale/browser/searchbar.dtd (%chrome/browser/searchbar.dtd) + locale/browser/engineManager.dtd (%chrome/browser/engineManager.dtd) + locale/browser/engineManager.properties (%chrome/browser/engineManager.properties) + locale/browser/setDesktopBackground.dtd (%chrome/browser/setDesktopBackground.dtd) + locale/browser/shellservice.properties (%chrome/browser/shellservice.properties) + locale/browser/statusbar/statusbar-overlay.dtd (%chrome/browser/statusbar/statusbar-overlay.dtd) + locale/browser/statusbar/statusbar-prefs.dtd (%chrome/browser/statusbar/statusbar-prefs.dtd) + locale/browser/statusbar/meta.properties (%chrome/browser/statusbar/meta.properties) + locale/browser/statusbar/overlay.properties (%chrome/browser/statusbar/overlay.properties) + locale/browser/statusbar/prefs.properties (%chrome/browser/statusbar/prefs.properties) + locale/browser/tabbrowser.dtd (%chrome/browser/tabbrowser.dtd) + locale/browser/tabbrowser.properties (%chrome/browser/tabbrowser.properties) + locale/browser/taskbar.properties (%chrome/browser/taskbar.properties) + locale/browser/downloads/downloads.dtd (%chrome/browser/downloads/downloads.dtd) + locale/browser/downloads/downloads.properties (%chrome/browser/downloads/downloads.properties) + locale/browser/places/places.dtd (%chrome/browser/places/places.dtd) + locale/browser/places/places.properties (%chrome/browser/places/places.properties) + locale/browser/places/editBookmarkOverlay.dtd (%chrome/browser/places/editBookmarkOverlay.dtd) + locale/browser/places/bookmarkProperties.properties (%chrome/browser/places/bookmarkProperties.properties) + locale/browser/preferences/selectBookmark.dtd (%chrome/browser/preferences/selectBookmark.dtd) + locale/browser/places/moveBookmarks.dtd (%chrome/browser/places/moveBookmarks.dtd) + locale/browser/feeds/subscribe.dtd (%chrome/browser/feeds/subscribe.dtd) + locale/browser/feeds/subscribe.properties (%chrome/browser/feeds/subscribe.properties) + locale/browser/permissions/aboutPermissions.dtd (%chrome/browser/permissions/aboutPermissions.dtd) + locale/browser/permissions/aboutPermissions.properties (%chrome/browser/permissions/aboutPermissions.properties) + locale/browser/preferences/advanced.dtd (%chrome/browser/preferences/advanced.dtd) + locale/browser/preferences/applicationManager.dtd (%chrome/browser/preferences/applicationManager.dtd) + locale/browser/preferences/applicationManager.properties (%chrome/browser/preferences/applicationManager.properties) + locale/browser/preferences/colors.dtd (%chrome/browser/preferences/colors.dtd) + locale/browser/preferences/cookies.dtd (%chrome/browser/preferences/cookies.dtd) + locale/browser/preferences/content.dtd (%chrome/browser/preferences/content.dtd) + locale/browser/preferences/connection.dtd (%chrome/browser/preferences/connection.dtd) + locale/browser/preferences/applications.dtd (%chrome/browser/preferences/applications.dtd) + locale/browser/preferences/fonts.dtd (%chrome/browser/preferences/fonts.dtd) + locale/browser/preferences/main.dtd (%chrome/browser/preferences/main.dtd) + locale/browser/preferences/languages.dtd (%chrome/browser/preferences/languages.dtd) + locale/browser/preferences/permissions.dtd (%chrome/browser/preferences/permissions.dtd) + locale/browser/preferences/preferences.dtd (%chrome/browser/preferences/preferences.dtd) + locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties) + locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd) + locale/browser/preferences/security.dtd (%chrome/browser/preferences/security.dtd) #ifdef MOZ_SERVICES_SYNC - locale/browser/preferences/sync.dtd (%chrome/browser/preferences/sync.dtd) + locale/browser/preferences/sync.dtd (%chrome/browser/preferences/sync.dtd) #endif - locale/browser/preferences/tabs.dtd (%chrome/browser/preferences/tabs.dtd) + locale/browser/preferences/tabs.dtd (%chrome/browser/preferences/tabs.dtd) #ifdef MOZ_SERVICES_SYNC - locale/browser/syncBrand.dtd (%chrome/browser/syncBrand.dtd) - locale/browser/syncSetup.dtd (%chrome/browser/syncSetup.dtd) - locale/browser/syncSetup.properties (%chrome/browser/syncSetup.properties) - locale/browser/syncGenericChange.properties (%chrome/browser/syncGenericChange.properties) - locale/browser/syncKey.dtd (%chrome/browser/syncKey.dtd) - locale/browser/syncQuota.dtd (%chrome/browser/syncQuota.dtd) - locale/browser/syncQuota.properties (%chrome/browser/syncQuota.properties) + locale/browser/syncBrand.dtd (%chrome/browser/syncBrand.dtd) + locale/browser/syncSetup.dtd (%chrome/browser/syncSetup.dtd) + locale/browser/syncSetup.properties (%chrome/browser/syncSetup.properties) + locale/browser/syncGenericChange.properties (%chrome/browser/syncGenericChange.properties) + locale/browser/syncKey.dtd (%chrome/browser/syncKey.dtd) + locale/browser/syncQuota.dtd (%chrome/browser/syncQuota.dtd) + locale/browser/syncQuota.properties (%chrome/browser/syncQuota.properties) #endif % locale browser-region @AB_CD@ %locale/browser-region/ - locale/browser-region/region.properties (%chrome/browser-region/region.properties) + locale/browser-region/region.properties (%chrome/browser-region/region.properties) # the following files are browser-specific overrides - locale/browser/netError.dtd (%chrome/overrides/netError.dtd) - locale/browser/appstrings.properties (%chrome/overrides/appstrings.properties) - locale/browser/downloads/settingsChange.dtd (%chrome/overrides/settingsChange.dtd) + locale/browser/netError.dtd (%chrome/overrides/netError.dtd) + locale/browser/appstrings.properties (%chrome/overrides/appstrings.properties) + locale/browser/downloads/settingsChange.dtd (%chrome/overrides/settingsChange.dtd) % override chrome://global/locale/netError.dtd chrome://browser/locale/netError.dtd % override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties % override chrome://mozapps/locale/downloads/settingsChange.dtd chrome://browser/locale/downloads/settingsChange.dtd diff --git a/application/palemoon/modules/moz.build b/application/palemoon/modules/moz.build index 8032930b2..12a3ece2e 100644 --- a/application/palemoon/modules/moz.build +++ b/application/palemoon/modules/moz.build @@ -4,7 +4,6 @@ # 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/. - EXTRA_JS_MODULES += [ 'AutoCompletePopup.jsm', 'BrowserNewTabPreloader.jsm', @@ -38,5 +37,6 @@ EXTRA_PP_JS_MODULES += [ # Pass down 'official build' flags if CONFIG['MC_OFFICIAL']: DEFINES['MC_OFFICIAL'] = 1 + if CONFIG['MOZILLA_OFFICIAL']: DEFINES['MOZILLA_OFFICIAL'] = 1 diff --git a/application/palemoon/moz.build b/application/palemoon/moz.build index 2b9d8f09b..72e37673c 100644 --- a/application/palemoon/moz.build +++ b/application/palemoon/moz.build @@ -15,9 +15,7 @@ DIRS += [ 'themes', ] -DIRS += [ - 'app', -] +DIRS += ['app'] if CONFIG['MAKENSISU']: DIRS += ['installer/windows'] diff --git a/application/palemoon/themes/linux/communicator/jar.mn b/application/palemoon/themes/linux/communicator/jar.mn index dfd20c523..612d13335 100644 --- a/application/palemoon/themes/linux/communicator/jar.mn +++ b/application/palemoon/themes/linux/communicator/jar.mn @@ -4,4 +4,4 @@ browser.jar: % skin communicator classic/1.0 %skin/classic/communicator/ - skin/classic/communicator/communicator.css + skin/classic/communicator/communicator.css diff --git a/application/palemoon/themes/linux/jar.mn b/application/palemoon/themes/linux/jar.mn index 8cb6878e8..a79487c7f 100644 --- a/application/palemoon/themes/linux/jar.mn +++ b/application/palemoon/themes/linux/jar.mn @@ -59,72 +59,72 @@ browser.jar: skin/classic/browser/webRTC-shareDevice-64.png skin/classic/browser/webRTC-sharingDevice-16.png #endif - skin/classic/browser/downloads/buttons.png (downloads/buttons.png) - skin/classic/browser/downloads/download-glow.png (downloads/download-glow.png) - skin/classic/browser/downloads/download-glow-small.png (downloads/download-glow-small.png) - skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) - skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) - skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) - skin/classic/browser/downloads/downloads.css (downloads/downloads.css) - skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) - skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) - skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css) - skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css) -* skin/classic/browser/newtab/newTab.css (newtab/newTab.css) - skin/classic/browser/newtab/controls.png (../shared/newtab/controls.png) - skin/classic/browser/newtab/noise.png (../shared/newtab/noise.png) - skin/classic/browser/newtab/pinned.png (../shared/newtab/pinned.png) - skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png) - skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png) - skin/classic/browser/places/calendar.png (places/calendar.png) -* skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) - skin/classic/browser/places/livemark-item.png (places/livemark-item.png) - skin/classic/browser/places/pageStarred.png (places/pageStarred.png) - skin/classic/browser/places/star-icons.png (places/star-icons.png) - skin/classic/browser/places/starred48.png (places/starred48.png) - skin/classic/browser/places/unstarred48.png (places/unstarred48.png) - skin/classic/browser/places/places.css (places/places.css) - skin/classic/browser/places/organizer.css (places/organizer.css) - skin/classic/browser/places/organizer.xml (places/organizer.xml) - skin/classic/browser/places/query.png (places/query.png) - skin/classic/browser/places/starPage.png (places/starPage.png) - skin/classic/browser/places/tag.png (places/tag.png) - skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) - skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png) - skin/classic/browser/places/downloads.png (places/downloads.png) - skin/classic/browser/permissions/aboutPermissions.css (permissions/aboutPermissions.css) - skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) - skin/classic/browser/preferences/mail.png (preferences/mail.png) - skin/classic/browser/preferences/Options.png (preferences/Options.png) + skin/classic/browser/downloads/buttons.png (downloads/buttons.png) + skin/classic/browser/downloads/download-glow.png (downloads/download-glow.png) + skin/classic/browser/downloads/download-glow-small.png (downloads/download-glow-small.png) + skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) + skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) + skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) + skin/classic/browser/downloads/downloads.css (downloads/downloads.css) + skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) + skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) + skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css) + skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css) +* skin/classic/browser/newtab/newTab.css (newtab/newTab.css) + skin/classic/browser/newtab/controls.png (../shared/newtab/controls.png) + skin/classic/browser/newtab/noise.png (../shared/newtab/noise.png) + skin/classic/browser/newtab/pinned.png (../shared/newtab/pinned.png) + skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png) + skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png) + skin/classic/browser/places/calendar.png (places/calendar.png) +* skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) + skin/classic/browser/places/livemark-item.png (places/livemark-item.png) + skin/classic/browser/places/pageStarred.png (places/pageStarred.png) + skin/classic/browser/places/star-icons.png (places/star-icons.png) + skin/classic/browser/places/starred48.png (places/starred48.png) + skin/classic/browser/places/unstarred48.png (places/unstarred48.png) + skin/classic/browser/places/places.css (places/places.css) + skin/classic/browser/places/organizer.css (places/organizer.css) + skin/classic/browser/places/organizer.xml (places/organizer.xml) + skin/classic/browser/places/query.png (places/query.png) + skin/classic/browser/places/starPage.png (places/starPage.png) + skin/classic/browser/places/tag.png (places/tag.png) + skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) + skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png) + skin/classic/browser/places/downloads.png (places/downloads.png) + skin/classic/browser/permissions/aboutPermissions.css (permissions/aboutPermissions.css) + skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) + skin/classic/browser/preferences/mail.png (preferences/mail.png) + skin/classic/browser/preferences/Options.png (preferences/Options.png) #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) + skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) #endif -* skin/classic/browser/preferences/preferences.css (preferences/preferences.css) - skin/classic/browser/preferences/applications.css (preferences/applications.css) +* skin/classic/browser/preferences/preferences.css (preferences/preferences.css) + skin/classic/browser/preferences/applications.css (preferences/applications.css) #ifdef MOZ_BROWSER_STATUSBAR - skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) -* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) -* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) - skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) - skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) - skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) - skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) - skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) + skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) +* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) +* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) + skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) + skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) + skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) + skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) + skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) #endif - skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) - skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) - skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) - skin/classic/browser/tabbrowser/tab.png (tabbrowser/tab.png) - skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) - skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) - skin/classic/browser/tabbrowser/tab-audio.svg (../shared/tabbrowser/tab-audio.svg) - skin/classic/browser/tabbrowser/tab-audio-small.svg (../shared/tabbrowser/tab-audio-small.svg) + skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) + skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) + skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) + skin/classic/browser/tabbrowser/tab.png (tabbrowser/tab.png) + skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) + skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) + skin/classic/browser/tabbrowser/tab-audio.svg (../shared/tabbrowser/tab-audio.svg) + skin/classic/browser/tabbrowser/tab-audio-small.svg (../shared/tabbrowser/tab-audio-small.svg) #ifdef MOZ_SERVICES_SYNC skin/classic/browser/sync-16-throbber.png skin/classic/browser/sync-16.png @@ -139,6 +139,6 @@ browser.jar: skin/classic/browser/syncQuota.css skin/classic/browser/syncProgress.css #endif - skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) - skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) - skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) + skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) + skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) + skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) diff --git a/application/palemoon/themes/moz.build b/application/palemoon/themes/moz.build index d82bda3ef..5040c10c1 100644 --- a/application/palemoon/themes/moz.build +++ b/application/palemoon/themes/moz.build @@ -12,4 +12,3 @@ elif toolkit in ('gtk2', 'gtk3', 'qt'): DIRS += ['linux'] else: DIRS += ['windows'] - diff --git a/application/palemoon/themes/osx/communicator/jar.mn b/application/palemoon/themes/osx/communicator/jar.mn index dfd20c523..612d13335 100644 --- a/application/palemoon/themes/osx/communicator/jar.mn +++ b/application/palemoon/themes/osx/communicator/jar.mn @@ -4,4 +4,4 @@ browser.jar: % skin communicator classic/1.0 %skin/classic/communicator/ - skin/classic/communicator/communicator.css + skin/classic/communicator/communicator.css diff --git a/application/palemoon/themes/osx/jar.mn b/application/palemoon/themes/osx/jar.mn index 1a11d0a30..c59fb1c72 100644 --- a/application/palemoon/themes/osx/jar.mn +++ b/application/palemoon/themes/osx/jar.mn @@ -4,180 +4,180 @@ browser.jar: % skin browser classic/1.0 %skin/classic/browser/ - skin/classic/browser/sanitizeDialog.css -* skin/classic/browser/aboutPrivateBrowsing.css -* skin/classic/browser/aboutSessionRestore.css - skin/classic/browser/aboutSessionRestore-window-icon.png (preferences/application.png) - skin/classic/browser/aboutCertError.css - skin/classic/browser/aboutCertError_sectionCollapsed.png - skin/classic/browser/aboutCertError_sectionCollapsed-rtl.png - skin/classic/browser/aboutCertError_sectionExpanded.png + skin/classic/browser/sanitizeDialog.css +* skin/classic/browser/aboutPrivateBrowsing.css +* skin/classic/browser/aboutSessionRestore.css + skin/classic/browser/aboutSessionRestore-window-icon.png (preferences/application.png) + skin/classic/browser/aboutCertError.css + skin/classic/browser/aboutCertError_sectionCollapsed.png + skin/classic/browser/aboutCertError_sectionCollapsed-rtl.png + skin/classic/browser/aboutCertError_sectionExpanded.png #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/aboutSyncTabs.css + skin/classic/browser/aboutSyncTabs.css #endif -* skin/classic/browser/autocomplete.css - skin/classic/browser/actionicon-tab.png - skin/classic/browser/appmenu-icons.png - skin/classic/browser/appmenu-dropmarker.png -* skin/classic/browser/browser.css - skin/classic/browser/click-to-play-warning-stripes.png -* skin/classic/browser/engineManager.css - skin/classic/browser/Geolocation-16.png - skin/classic/browser/Geolocation-64.png - skin/classic/browser/Info.png - skin/classic/browser/identity.png - skin/classic/browser/imagedocument.png - skin/classic/browser/identity-icons-generic.png - skin/classic/browser/identity-icons-https.png - skin/classic/browser/identity-icons-https-ev.png - skin/classic/browser/identity-icons-https-mixed-active.png - skin/classic/browser/keyhole-forward-mask.svg - skin/classic/browser/KUI-background.png - skin/classic/browser/KUI-close.png - skin/classic/browser/livemark-folder.png - skin/classic/browser/menu-back.png - skin/classic/browser/menu-forward.png - skin/classic/browser/mixed-content-blocked-16.png - skin/classic/browser/mixed-content-blocked-64.png - skin/classic/browser/monitor.png - skin/classic/browser/monitor_16-10.png +* skin/classic/browser/autocomplete.css + skin/classic/browser/actionicon-tab.png + skin/classic/browser/appmenu-icons.png + skin/classic/browser/appmenu-dropmarker.png +* skin/classic/browser/browser.css + skin/classic/browser/click-to-play-warning-stripes.png +* skin/classic/browser/engineManager.css + skin/classic/browser/Geolocation-16.png + skin/classic/browser/Geolocation-64.png + skin/classic/browser/Info.png + skin/classic/browser/identity.png + skin/classic/browser/imagedocument.png + skin/classic/browser/identity-icons-generic.png + skin/classic/browser/identity-icons-https.png + skin/classic/browser/identity-icons-https-ev.png + skin/classic/browser/identity-icons-https-mixed-active.png + skin/classic/browser/keyhole-forward-mask.svg + skin/classic/browser/KUI-background.png + skin/classic/browser/KUI-close.png + skin/classic/browser/livemark-folder.png + skin/classic/browser/menu-back.png + skin/classic/browser/menu-forward.png + skin/classic/browser/mixed-content-blocked-16.png + skin/classic/browser/mixed-content-blocked-64.png + skin/classic/browser/monitor.png + skin/classic/browser/monitor_16-10.png skin/classic/browser/panel-expander-closed.png skin/classic/browser/panel-expander-closed@2x.png skin/classic/browser/panel-expander-open.png skin/classic/browser/panel-expander-open@2x.png skin/classic/browser/panel-plus-sign.png - skin/classic/browser/pageInfo.css - skin/classic/browser/pageInfo.png - skin/classic/browser/page-livemarks.png - skin/classic/browser/page-livemarks@2x.png - skin/classic/browser/pointerLock-16.png - skin/classic/browser/pointerLock-64.png - skin/classic/browser/Privacy-16.png - skin/classic/browser/Privacy-32.png - skin/classic/browser/Privacy-48.png + skin/classic/browser/pageInfo.css + skin/classic/browser/pageInfo.png + skin/classic/browser/page-livemarks.png + skin/classic/browser/page-livemarks@2x.png + skin/classic/browser/pointerLock-16.png + skin/classic/browser/pointerLock-64.png + skin/classic/browser/Privacy-16.png + skin/classic/browser/Privacy-32.png + skin/classic/browser/Privacy-48.png skin/classic/browser/privatebrowsing-mask.png skin/classic/browser/privatebrowsing-mask@2x.png - skin/classic/browser/privatebrowsing-light.png - skin/classic/browser/privatebrowsing-dark.png - skin/classic/browser/reload-stop-go.png - skin/classic/browser/Search-glass.png - skin/classic/browser/searchbar.css - skin/classic/browser/searchbar-dropdown-arrow.png - skin/classic/browser/Secure24.png - skin/classic/browser/setDesktopBackground.css - skin/classic/browser/slowStartup-16.png - skin/classic/browser/Toolbar.png - skin/classic/browser/Toolbar-inverted.png - skin/classic/browser/toolbarbutton-dropdown-arrow.png - skin/classic/browser/toolbarbutton-dropdown-arrow-inverted.png - skin/classic/browser/urlbar-arrow.png - skin/classic/browser/urlbar-popup-blocked.png - skin/classic/browser/urlbar-history-dropmarker.png - skin/classic/browser/web-notifications-icon.svg - skin/classic/browser/web-notifications-tray.svg - skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) - skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) - skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) + skin/classic/browser/privatebrowsing-light.png + skin/classic/browser/privatebrowsing-dark.png + skin/classic/browser/reload-stop-go.png + skin/classic/browser/Search-glass.png + skin/classic/browser/searchbar.css + skin/classic/browser/searchbar-dropdown-arrow.png + skin/classic/browser/Secure24.png + skin/classic/browser/setDesktopBackground.css + skin/classic/browser/slowStartup-16.png + skin/classic/browser/Toolbar.png + skin/classic/browser/Toolbar-inverted.png + skin/classic/browser/toolbarbutton-dropdown-arrow.png + skin/classic/browser/toolbarbutton-dropdown-arrow-inverted.png + skin/classic/browser/urlbar-arrow.png + skin/classic/browser/urlbar-popup-blocked.png + skin/classic/browser/urlbar-history-dropmarker.png + skin/classic/browser/web-notifications-icon.svg + skin/classic/browser/web-notifications-tray.svg + skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) + skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) + skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) #ifdef MOZ_WEBRTC - skin/classic/browser/webRTC-shareDevice-16.png - skin/classic/browser/webRTC-shareDevice-64.png - skin/classic/browser/webRTC-sharingDevice-16.png + skin/classic/browser/webRTC-shareDevice-16.png + skin/classic/browser/webRTC-shareDevice-64.png + skin/classic/browser/webRTC-sharingDevice-16.png #endif - skin/classic/browser/downloads/buttons.png (downloads/buttons.png) - skin/classic/browser/downloads/download-glow.png (downloads/download-glow.png) - skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) - skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) - skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) -* skin/classic/browser/downloads/downloads.css (downloads/downloads.css) -* skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) - skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) - skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/feed-icons-16.png (feeds/feed-icons-16.png) - skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css) - skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css) -* skin/classic/browser/newtab/newTab.css (newtab/newTab.css) - skin/classic/browser/newtab/controls.png (../shared/newtab/controls.png) - skin/classic/browser/newtab/noise.png (../shared/newtab/noise.png) - skin/classic/browser/newtab/pinned.png (../shared/newtab/pinned.png) - skin/classic/browser/places/places.css (places/places.css) -* skin/classic/browser/places/organizer.css (places/organizer.css) - skin/classic/browser/places/editBookmark.png (places/editBookmark.png) - skin/classic/browser/places/bookmark.png (places/bookmark.png) - skin/classic/browser/places/query.png (places/query.png) - skin/classic/browser/places/query@2x.png (places/query@2x.png) - skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png) - skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png) - skin/classic/browser/places/bookmarksToolbar@2x.png (places/bookmarksToolbar@2x.png) - skin/classic/browser/places/calendar.png (places/calendar.png) - skin/classic/browser/places/folderDropArrow.png (places/folderDropArrow.png) - skin/classic/browser/places/folderDropArrow@2x.png (places/folderDropArrow@2x.png) - skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) - skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) - skin/classic/browser/places/libraryToolbar.png (places/libraryToolbar.png) - skin/classic/browser/places/starred48.png (places/starred48.png) - skin/classic/browser/places/unstarred48.png (places/unstarred48.png) - skin/classic/browser/places/unfiledBookmarks.png (places/unfiledBookmarks.png) - skin/classic/browser/places/unfiledBookmarks@2x.png (places/unfiledBookmarks@2x.png) - skin/classic/browser/places/tag.png (places/tag.png) - skin/classic/browser/places/tag@2x.png (places/tag@2x.png) - skin/classic/browser/places/history.png (places/history.png) - skin/classic/browser/places/history@2x.png (places/history@2x.png) - skin/classic/browser/places/allBookmarks.png (places/allBookmarks.png) - skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png) - skin/classic/browser/places/downloads.png (places/downloads.png) - skin/classic/browser/places/expander-closed-active.png (places/expander-closed-active.png) - skin/classic/browser/places/expander-open-active.png (places/expander-open-active.png) - skin/classic/browser/places/livemark-item.png (places/livemark-item.png) - skin/classic/browser/places/expander-closed.png (places/expander-closed.png) - skin/classic/browser/places/expander-open.png (places/expander-open.png) - skin/classic/browser/permissions/aboutPermissions.css (permissions/aboutPermissions.css) - skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) - skin/classic/browser/preferences/application.png (preferences/application.png) - skin/classic/browser/preferences/mail.png (preferences/mail.png) - skin/classic/browser/preferences/Options.png (preferences/Options.png) + skin/classic/browser/downloads/buttons.png (downloads/buttons.png) + skin/classic/browser/downloads/download-glow.png (downloads/download-glow.png) + skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) + skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) + skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) +* skin/classic/browser/downloads/downloads.css (downloads/downloads.css) +* skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) + skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) + skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/feed-icons-16.png (feeds/feed-icons-16.png) + skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css) + skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css) +* skin/classic/browser/newtab/newTab.css (newtab/newTab.css) + skin/classic/browser/newtab/controls.png (../shared/newtab/controls.png) + skin/classic/browser/newtab/noise.png (../shared/newtab/noise.png) + skin/classic/browser/newtab/pinned.png (../shared/newtab/pinned.png) + skin/classic/browser/places/places.css (places/places.css) +* skin/classic/browser/places/organizer.css (places/organizer.css) + skin/classic/browser/places/editBookmark.png (places/editBookmark.png) + skin/classic/browser/places/bookmark.png (places/bookmark.png) + skin/classic/browser/places/query.png (places/query.png) + skin/classic/browser/places/query@2x.png (places/query@2x.png) + skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png) + skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png) + skin/classic/browser/places/bookmarksToolbar@2x.png (places/bookmarksToolbar@2x.png) + skin/classic/browser/places/calendar.png (places/calendar.png) + skin/classic/browser/places/folderDropArrow.png (places/folderDropArrow.png) + skin/classic/browser/places/folderDropArrow@2x.png (places/folderDropArrow@2x.png) + skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) + skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) + skin/classic/browser/places/libraryToolbar.png (places/libraryToolbar.png) + skin/classic/browser/places/starred48.png (places/starred48.png) + skin/classic/browser/places/unstarred48.png (places/unstarred48.png) + skin/classic/browser/places/unfiledBookmarks.png (places/unfiledBookmarks.png) + skin/classic/browser/places/unfiledBookmarks@2x.png (places/unfiledBookmarks@2x.png) + skin/classic/browser/places/tag.png (places/tag.png) + skin/classic/browser/places/tag@2x.png (places/tag@2x.png) + skin/classic/browser/places/history.png (places/history.png) + skin/classic/browser/places/history@2x.png (places/history@2x.png) + skin/classic/browser/places/allBookmarks.png (places/allBookmarks.png) + skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png) + skin/classic/browser/places/downloads.png (places/downloads.png) + skin/classic/browser/places/expander-closed-active.png (places/expander-closed-active.png) + skin/classic/browser/places/expander-open-active.png (places/expander-open-active.png) + skin/classic/browser/places/livemark-item.png (places/livemark-item.png) + skin/classic/browser/places/expander-closed.png (places/expander-closed.png) + skin/classic/browser/places/expander-open.png (places/expander-open.png) + skin/classic/browser/permissions/aboutPermissions.css (permissions/aboutPermissions.css) + skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) + skin/classic/browser/preferences/application.png (preferences/application.png) + skin/classic/browser/preferences/mail.png (preferences/mail.png) + skin/classic/browser/preferences/Options.png (preferences/Options.png) #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) + skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) #endif - skin/classic/browser/preferences/saveFile.png (preferences/saveFile.png) -* skin/classic/browser/preferences/preferences.css (preferences/preferences.css) - skin/classic/browser/preferences/applications.css (preferences/applications.css) + skin/classic/browser/preferences/saveFile.png (preferences/saveFile.png) +* skin/classic/browser/preferences/preferences.css (preferences/preferences.css) + skin/classic/browser/preferences/applications.css (preferences/applications.css) #ifdef MOZ_BROWSER_STATUSBAR - skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) -* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) -* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) - skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) - skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) - skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) - skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) - skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) + skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) +* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) +* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) + skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) + skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) + skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) + skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) + skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) #endif - skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) - skin/classic/browser/tabbrowser/alltabs-inverted.png (tabbrowser/alltabs-inverted.png) - skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png) - skin/classic/browser/tabbrowser/newtab-inverted.png (tabbrowser/newtab-inverted.png) - skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) - skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) - skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png) - skin/classic/browser/tabbrowser/tab-arrow-left-inverted.png (tabbrowser/tab-arrow-left-inverted.png) - skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) - skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) - skin/classic/browser/tabbrowser/tab-audio.svg (../shared/tabbrowser/tab-audio.svg) - skin/classic/browser/tabbrowser/tab-audio-small.svg (../shared/tabbrowser/tab-audio-small.svg) + skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) + skin/classic/browser/tabbrowser/alltabs-inverted.png (tabbrowser/alltabs-inverted.png) + skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png) + skin/classic/browser/tabbrowser/newtab-inverted.png (tabbrowser/newtab-inverted.png) + skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) + skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) + skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png) + skin/classic/browser/tabbrowser/tab-arrow-left-inverted.png (tabbrowser/tab-arrow-left-inverted.png) + skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) + skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) + skin/classic/browser/tabbrowser/tab-audio.svg (../shared/tabbrowser/tab-audio.svg) + skin/classic/browser/tabbrowser/tab-audio-small.svg (../shared/tabbrowser/tab-audio-small.svg) #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/sync-throbber.png - skin/classic/browser/sync-16.png - skin/classic/browser/sync-32.png - skin/classic/browser/sync-128.png - skin/classic/browser/sync-bg.png - skin/classic/browser/sync-desktopIcon.png - skin/classic/browser/sync-mobileIcon.png - skin/classic/browser/syncSetup.css - skin/classic/browser/syncCommon.css - skin/classic/browser/syncQuota.css - skin/classic/browser/syncProgress.css + skin/classic/browser/sync-throbber.png + skin/classic/browser/sync-16.png + skin/classic/browser/sync-32.png + skin/classic/browser/sync-128.png + skin/classic/browser/sync-bg.png + skin/classic/browser/sync-desktopIcon.png + skin/classic/browser/sync-mobileIcon.png + skin/classic/browser/syncSetup.css + skin/classic/browser/syncCommon.css + skin/classic/browser/syncQuota.css + skin/classic/browser/syncProgress.css #endif diff --git a/application/palemoon/themes/windows/communicator/jar.mn b/application/palemoon/themes/windows/communicator/jar.mn index dfd20c523..612d13335 100644 --- a/application/palemoon/themes/windows/communicator/jar.mn +++ b/application/palemoon/themes/windows/communicator/jar.mn @@ -4,4 +4,4 @@ browser.jar: % skin communicator classic/1.0 %skin/classic/communicator/ - skin/classic/communicator/communicator.css + skin/classic/communicator/communicator.css diff --git a/application/palemoon/themes/windows/jar.mn b/application/palemoon/themes/windows/jar.mn index 724bac689..8a00d8b70 100644 --- a/application/palemoon/themes/windows/jar.mn +++ b/application/palemoon/themes/windows/jar.mn @@ -4,164 +4,164 @@ browser.jar: % skin browser classic/1.0 %skin/classic/browser/ - skin/classic/browser/sanitizeDialog.css -* skin/classic/browser/aboutPrivateBrowsing.css -* skin/classic/browser/aboutSessionRestore.css - skin/classic/browser/aboutSessionRestore-window-icon.png - skin/classic/browser/aboutCertError.css - skin/classic/browser/aboutCertError_sectionCollapsed.png - skin/classic/browser/aboutCertError_sectionCollapsed-rtl.png - skin/classic/browser/aboutCertError_sectionExpanded.png + skin/classic/browser/sanitizeDialog.css +* skin/classic/browser/aboutPrivateBrowsing.css +* skin/classic/browser/aboutSessionRestore.css + skin/classic/browser/aboutSessionRestore-window-icon.png + skin/classic/browser/aboutCertError.css + skin/classic/browser/aboutCertError_sectionCollapsed.png + skin/classic/browser/aboutCertError_sectionCollapsed-rtl.png + skin/classic/browser/aboutCertError_sectionExpanded.png #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/aboutSyncTabs.css + skin/classic/browser/aboutSyncTabs.css #endif -* skin/classic/browser/autocomplete.css - skin/classic/browser/actionicon-tab.png - skin/classic/browser/appmenu-icons.png - skin/classic/browser/appmenu-dropmarker.png -* skin/classic/browser/browser.css - skin/classic/browser/caption-buttons.svg - skin/classic/browser/click-to-play-warning-stripes.png -* skin/classic/browser/engineManager.css - skin/classic/browser/Geolocation-16.png - skin/classic/browser/Geolocation-64.png - skin/classic/browser/Info.png - skin/classic/browser/identity.png - skin/classic/browser/imagedocument.png - skin/classic/browser/identity-icons-generic.png - skin/classic/browser/identity-icons-https.png - skin/classic/browser/identity-icons-https-ev.png - skin/classic/browser/identity-icons-https-mixed-active.png - skin/classic/browser/keyhole-forward-mask.svg - skin/classic/browser/KUI-background.png - skin/classic/browser/KUI-close.png - skin/classic/browser/livemark-folder.png - skin/classic/browser/menu-back.png - skin/classic/browser/menu-forward.png - skin/classic/browser/mixed-content-blocked-16.png - skin/classic/browser/mixed-content-blocked-64.png - skin/classic/browser/monitor.png - skin/classic/browser/monitor_16-10.png - skin/classic/browser/pageInfo.css - skin/classic/browser/pageInfo.png - skin/classic/browser/page-livemarks.png (feeds/feedIcon16.png) - skin/classic/browser/pointerLock-16.png - skin/classic/browser/pointerLock-64.png - skin/classic/browser/Privacy-16.png - skin/classic/browser/Privacy-32.png - skin/classic/browser/Privacy-48.png - skin/classic/browser/Privacy-64.png - skin/classic/browser/privatebrowsing-light.png - skin/classic/browser/privatebrowsing-dark.png - skin/classic/browser/reload-stop-go.png - skin/classic/browser/sanitize.png - skin/classic/browser/searchbar.css - skin/classic/browser/searchbar-dropdown-arrow.png - skin/classic/browser/Secure24.png - skin/classic/browser/setDesktopBackground.css - skin/classic/browser/slowStartup-16.png - skin/classic/browser/Toolbar.svg - skin/classic/browser/Toolbar-glass.svg - skin/classic/browser/Toolbar-inverted.svg - skin/classic/browser/toolbarbutton-dropdown-arrow.png - skin/classic/browser/toolbarbutton-dropdown-arrow-inverted.png - skin/classic/browser/urlbar-arrow.png - skin/classic/browser/urlbar-popup-blocked.png - skin/classic/browser/urlbar-history-dropmarker.png - skin/classic/browser/web-notifications-icon.svg - skin/classic/browser/web-notifications-tray.svg - skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) - skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) - skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) +* skin/classic/browser/autocomplete.css + skin/classic/browser/actionicon-tab.png + skin/classic/browser/appmenu-icons.png + skin/classic/browser/appmenu-dropmarker.png +* skin/classic/browser/browser.css + skin/classic/browser/caption-buttons.svg + skin/classic/browser/click-to-play-warning-stripes.png +* skin/classic/browser/engineManager.css + skin/classic/browser/Geolocation-16.png + skin/classic/browser/Geolocation-64.png + skin/classic/browser/Info.png + skin/classic/browser/identity.png + skin/classic/browser/imagedocument.png + skin/classic/browser/identity-icons-generic.png + skin/classic/browser/identity-icons-https.png + skin/classic/browser/identity-icons-https-ev.png + skin/classic/browser/identity-icons-https-mixed-active.png + skin/classic/browser/keyhole-forward-mask.svg + skin/classic/browser/KUI-background.png + skin/classic/browser/KUI-close.png + skin/classic/browser/livemark-folder.png + skin/classic/browser/menu-back.png + skin/classic/browser/menu-forward.png + skin/classic/browser/mixed-content-blocked-16.png + skin/classic/browser/mixed-content-blocked-64.png + skin/classic/browser/monitor.png + skin/classic/browser/monitor_16-10.png + skin/classic/browser/pageInfo.css + skin/classic/browser/pageInfo.png + skin/classic/browser/page-livemarks.png (feeds/feedIcon16.png) + skin/classic/browser/pointerLock-16.png + skin/classic/browser/pointerLock-64.png + skin/classic/browser/Privacy-16.png + skin/classic/browser/Privacy-32.png + skin/classic/browser/Privacy-48.png + skin/classic/browser/Privacy-64.png + skin/classic/browser/privatebrowsing-light.png + skin/classic/browser/privatebrowsing-dark.png + skin/classic/browser/reload-stop-go.png + skin/classic/browser/sanitize.png + skin/classic/browser/searchbar.css + skin/classic/browser/searchbar-dropdown-arrow.png + skin/classic/browser/Secure24.png + skin/classic/browser/setDesktopBackground.css + skin/classic/browser/slowStartup-16.png + skin/classic/browser/Toolbar.svg + skin/classic/browser/Toolbar-glass.svg + skin/classic/browser/Toolbar-inverted.svg + skin/classic/browser/toolbarbutton-dropdown-arrow.png + skin/classic/browser/toolbarbutton-dropdown-arrow-inverted.png + skin/classic/browser/urlbar-arrow.png + skin/classic/browser/urlbar-popup-blocked.png + skin/classic/browser/urlbar-history-dropmarker.png + skin/classic/browser/web-notifications-icon.svg + skin/classic/browser/web-notifications-tray.svg + skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) + skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) + skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) #ifdef MOZ_WEBRTC - skin/classic/browser/webRTC-shareDevice-16.png - skin/classic/browser/webRTC-shareDevice-64.png - skin/classic/browser/webRTC-sharingDevice-16.png + skin/classic/browser/webRTC-shareDevice-16.png + skin/classic/browser/webRTC-shareDevice-64.png + skin/classic/browser/webRTC-sharingDevice-16.png #endif - skin/classic/browser/downloads/buttons.png (downloads/buttons.png) - skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) - skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) - skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) - skin/classic/browser/downloads/downloads.css (downloads/downloads.css) - skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) - skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) - skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/feed-icons-16.png (feeds/feed-icons-16.png) - skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css) - skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css) -* skin/classic/browser/newtab/newTab.css (newtab/newTab.css) - skin/classic/browser/newtab/controls.png (../shared/newtab/controls.png) - skin/classic/browser/newtab/noise.png (../shared/newtab/noise.png) - skin/classic/browser/newtab/pinned.png (../shared/newtab/pinned.png) - skin/classic/browser/places/places.css (places/places.css) -* skin/classic/browser/places/organizer.css (places/organizer.css) - skin/classic/browser/places/editBookmark.png (places/editBookmark.png) - skin/classic/browser/places/bookmark.png (places/bookmark.png) - skin/classic/browser/places/query.png (places/query.png) - skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png) - skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png) - skin/classic/browser/places/calendar.png (places/calendar.png) - skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) - skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) - skin/classic/browser/places/libraryToolbar.png (places/libraryToolbar.png) - skin/classic/browser/places/starred48.png (places/starred48.png) - skin/classic/browser/places/unstarred48.png (places/unstarred48.png) - skin/classic/browser/places/tag.png (places/tag.png) - skin/classic/browser/places/history.png (places/history.png) - skin/classic/browser/places/allBookmarks.png (places/allBookmarks.png) - skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png) - skin/classic/browser/places/downloads.png (places/downloads.png) - skin/classic/browser/places/livemark-item.png (places/livemark-item.png) - skin/classic/browser/permissions/aboutPermissions.css (permissions/aboutPermissions.css) - skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) - skin/classic/browser/preferences/application.png (preferences/application.png) - skin/classic/browser/preferences/mail.png (preferences/mail.png) - skin/classic/browser/preferences/Options.png (preferences/Options.png) + skin/classic/browser/downloads/buttons.png (downloads/buttons.png) + skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) + skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) + skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) + skin/classic/browser/downloads/downloads.css (downloads/downloads.css) + skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) + skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) + skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/feed-icons-16.png (feeds/feed-icons-16.png) + skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css) + skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css) +* skin/classic/browser/newtab/newTab.css (newtab/newTab.css) + skin/classic/browser/newtab/controls.png (../shared/newtab/controls.png) + skin/classic/browser/newtab/noise.png (../shared/newtab/noise.png) + skin/classic/browser/newtab/pinned.png (../shared/newtab/pinned.png) + skin/classic/browser/places/places.css (places/places.css) +* skin/classic/browser/places/organizer.css (places/organizer.css) + skin/classic/browser/places/editBookmark.png (places/editBookmark.png) + skin/classic/browser/places/bookmark.png (places/bookmark.png) + skin/classic/browser/places/query.png (places/query.png) + skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png) + skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png) + skin/classic/browser/places/calendar.png (places/calendar.png) + skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) + skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) + skin/classic/browser/places/libraryToolbar.png (places/libraryToolbar.png) + skin/classic/browser/places/starred48.png (places/starred48.png) + skin/classic/browser/places/unstarred48.png (places/unstarred48.png) + skin/classic/browser/places/tag.png (places/tag.png) + skin/classic/browser/places/history.png (places/history.png) + skin/classic/browser/places/allBookmarks.png (places/allBookmarks.png) + skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png) + skin/classic/browser/places/downloads.png (places/downloads.png) + skin/classic/browser/places/livemark-item.png (places/livemark-item.png) + skin/classic/browser/permissions/aboutPermissions.css (permissions/aboutPermissions.css) + skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) + skin/classic/browser/preferences/application.png (preferences/application.png) + skin/classic/browser/preferences/mail.png (preferences/mail.png) + skin/classic/browser/preferences/Options.png (preferences/Options.png) #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) + skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) #endif - skin/classic/browser/preferences/saveFile.png (preferences/saveFile.png) -* skin/classic/browser/preferences/preferences.css (preferences/preferences.css) - skin/classic/browser/preferences/applications.css (preferences/applications.css) + skin/classic/browser/preferences/saveFile.png (preferences/saveFile.png) +* skin/classic/browser/preferences/preferences.css (preferences/preferences.css) + skin/classic/browser/preferences/applications.css (preferences/applications.css) #ifdef MOZ_BROWSER_STATUSBAR - skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) -* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) -* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) - skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) - skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) - skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) - skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) - skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) + skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) +* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) +* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) + skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) + skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) + skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) + skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) + skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) #endif - skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) - skin/classic/browser/tabbrowser/alltabs-inverted.png (tabbrowser/alltabs-inverted.png) - skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png) - skin/classic/browser/tabbrowser/newtab-glass.png (tabbrowser/newtab-glass.png) - skin/classic/browser/tabbrowser/newtab-inverted.png (tabbrowser/newtab-inverted.png) - skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) - skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) - skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png) - skin/classic/browser/tabbrowser/tab-arrow-left-glass.png (tabbrowser/tab-arrow-left-glass.png) - skin/classic/browser/tabbrowser/tab-arrow-left-inverted.png (tabbrowser/tab-arrow-left-inverted.png) - skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) - skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) - skin/classic/browser/tabbrowser/tab-audio.svg (../shared/tabbrowser/tab-audio.svg) - skin/classic/browser/tabbrowser/tab-audio-small.svg (../shared/tabbrowser/tab-audio-small.svg) + skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) + skin/classic/browser/tabbrowser/alltabs-inverted.png (tabbrowser/alltabs-inverted.png) + skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png) + skin/classic/browser/tabbrowser/newtab-glass.png (tabbrowser/newtab-glass.png) + skin/classic/browser/tabbrowser/newtab-inverted.png (tabbrowser/newtab-inverted.png) + skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) + skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) + skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png) + skin/classic/browser/tabbrowser/tab-arrow-left-glass.png (tabbrowser/tab-arrow-left-glass.png) + skin/classic/browser/tabbrowser/tab-arrow-left-inverted.png (tabbrowser/tab-arrow-left-inverted.png) + skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) + skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) + skin/classic/browser/tabbrowser/tab-audio.svg (../shared/tabbrowser/tab-audio.svg) + skin/classic/browser/tabbrowser/tab-audio-small.svg (../shared/tabbrowser/tab-audio-small.svg) #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/sync-throbber.png - skin/classic/browser/sync-16.png - skin/classic/browser/sync-32.png - skin/classic/browser/sync-128.png - skin/classic/browser/sync-bg.png - skin/classic/browser/sync-desktopIcon.png - skin/classic/browser/sync-mobileIcon.png - skin/classic/browser/syncSetup.css - skin/classic/browser/syncCommon.css - skin/classic/browser/syncQuota.css - skin/classic/browser/syncProgress.css + skin/classic/browser/sync-throbber.png + skin/classic/browser/sync-16.png + skin/classic/browser/sync-32.png + skin/classic/browser/sync-128.png + skin/classic/browser/sync-bg.png + skin/classic/browser/sync-desktopIcon.png + skin/classic/browser/sync-mobileIcon.png + skin/classic/browser/syncSetup.css + skin/classic/browser/syncCommon.css + skin/classic/browser/syncQuota.css + skin/classic/browser/syncProgress.css #endif diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index e6eaa8228..f112e6bdf 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -309,6 +309,10 @@ def old_configure_options(*options): '--enable-calendar', '--enable-incomplete-external-linkage', + # Below are configure flags used by Pale Moon + '--disable-browser-statusbar', + '--disable-sync', + # Below are configure flags used by Basilisk '--disable-webextensions', ) diff --git a/dom/media/DecoderTraits.cpp b/dom/media/DecoderTraits.cpp index 56ebd9ce9..477ecf358 100644 --- a/dom/media/DecoderTraits.cpp +++ b/dom/media/DecoderTraits.cpp @@ -23,10 +23,6 @@ #include "AndroidMediaReader.h" #include "AndroidMediaPluginHost.h" #endif -#ifdef MOZ_DIRECTSHOW -#include "DirectShowDecoder.h" -#include "DirectShowReader.h" -#endif #ifdef MOZ_FMP4 #include "MP4Decoder.h" #include "MP4Demuxer.h" @@ -125,14 +121,6 @@ IsAndroidMediaType(const nsACString& aType) } #endif -#ifdef MOZ_DIRECTSHOW -static bool -IsDirectShowSupportedType(const nsACString& aType) -{ - return DirectShowDecoder::GetSupportedCodecs(aType, nullptr); -} -#endif - #ifdef MOZ_FMP4 static bool IsMP4SupportedType(const MediaContentType& aParsedType, @@ -247,9 +235,6 @@ CanHandleCodecsType(const MediaContentType& aType, if (IsFlacSupportedType(aType.GetMIMEType(), aType.GetCodecs())) { return CANPLAY_YES; } -#ifdef MOZ_DIRECTSHOW - DirectShowDecoder::GetSupportedCodecs(aType.GetMIMEType(), &codecList); -#endif #ifdef MOZ_ANDROID_OMX if (MediaDecoder::IsAndroidMediaPluginEnabled()) { EnsureAndroidMediaPluginHost()->FindDecoder(aType.GetMIMEType(), &codecList); @@ -320,11 +305,6 @@ CanHandleMediaType(const MediaContentType& aType, if (IsFlacSupportedType(aType.GetMIMEType())) { return CANPLAY_MAYBE; } -#ifdef MOZ_DIRECTSHOW - if (DirectShowDecoder::GetSupportedCodecs(aType.GetMIMEType(), nullptr)) { - return CANPLAY_MAYBE; - } -#endif #ifdef MOZ_ANDROID_OMX if (MediaDecoder::IsAndroidMediaPluginEnabled() && EnsureAndroidMediaPluginHost()->FindDecoder(aType.GetMIMEType(), nullptr)) { @@ -424,15 +404,6 @@ InstantiateDecoder(const nsACString& aType, return decoder.forget(); } -#ifdef MOZ_DIRECTSHOW - // Note: DirectShow should come before WMF, so that we prefer DirectShow's - // MP3 support over WMF's. - if (IsDirectShowSupportedType(aType)) { - decoder = new DirectShowDecoder(aOwner); - return decoder.forget(); - } -#endif - return nullptr; } @@ -461,7 +432,7 @@ MediaDecoderReader* DecoderTraits::CreateReader(const nsACString& aType, Abstrac } else #endif if (IsMP3SupportedType(aType)) { - decoderReader = new MediaFormatReader(aDecoder, new mp3::MP3Demuxer(aDecoder->GetResource())); + decoderReader = new MediaFormatReader(aDecoder, new MP3Demuxer(aDecoder->GetResource())); } else if (IsAACSupportedType(aType)) { decoderReader = new MediaFormatReader(aDecoder, new ADTSDemuxer(aDecoder->GetResource())); @@ -484,13 +455,7 @@ MediaDecoderReader* DecoderTraits::CreateReader(const nsACString& aType, Abstrac if (IsWebMSupportedType(aType)) { decoderReader = new MediaFormatReader(aDecoder, new WebMDemuxer(aDecoder->GetResource())); - } else -#ifdef MOZ_DIRECTSHOW - if (IsDirectShowSupportedType(aType)) { - decoderReader = new DirectShowReader(aDecoder); - } else -#endif - if (false) {} // dummy if to take care of the dangling else + } return decoderReader; } @@ -518,9 +483,6 @@ bool DecoderTraits::IsSupportedInVideoDocument(const nsACString& aType) IsMP3SupportedType(aType) || IsAACSupportedType(aType) || IsFlacSupportedType(aType) || -#ifdef MOZ_DIRECTSHOW - IsDirectShowSupportedType(aType) || -#endif false; } diff --git a/dom/media/MP3FrameParser.cpp b/dom/media/MP3FrameParser.cpp deleted file mode 100644 index 242e3df00..000000000 --- a/dom/media/MP3FrameParser.cpp +++ /dev/null @@ -1,591 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#include <algorithm> - -#include "nsMemory.h" -#include "MP3FrameParser.h" -#include "VideoUtils.h" - - -#define FROM_BIG_ENDIAN(X) ((uint32_t)((uint8_t)(X)[0] << 24 | (uint8_t)(X)[1] << 16 | \ - (uint8_t)(X)[2] << 8 | (uint8_t)(X)[3])) - - -namespace mozilla { - -/* - * Following code taken from http://www.hydrogenaudio.org/forums/index.php?showtopic=85125 - * with permission from the author, Nick Wallette <sirnickity@gmail.com>. - */ - -/* BEGIN shameless copy and paste */ - -// Bitrates - use [version][layer][bitrate] -const uint16_t mpeg_bitrates[4][4][16] = { - { // Version 2.5 - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Reserved - { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0 }, // Layer 3 - { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0 }, // Layer 2 - { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 0 } // Layer 1 - }, - { // Reserved - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Invalid - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Invalid - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Invalid - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } // Invalid - }, - { // Version 2 - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Reserved - { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0 }, // Layer 3 - { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0 }, // Layer 2 - { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 0 } // Layer 1 - }, - { // Version 1 - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Reserved - { 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 0 }, // Layer 3 - { 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 0 }, // Layer 2 - { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 0 }, // Layer 1 - } -}; - -// Sample rates - use [version][srate] -const uint16_t mpeg_srates[4][4] = { - { 11025, 12000, 8000, 0 }, // MPEG 2.5 - { 0, 0, 0, 0 }, // Reserved - { 22050, 24000, 16000, 0 }, // MPEG 2 - { 44100, 48000, 32000, 0 } // MPEG 1 -}; - -// Samples per frame - use [version][layer] -const uint16_t mpeg_frame_samples[4][4] = { -// Rsvd 3 2 1 < Layer v Version - { 0, 576, 1152, 384 }, // 2.5 - { 0, 0, 0, 0 }, // Reserved - { 0, 576, 1152, 384 }, // 2 - { 0, 1152, 1152, 384 } // 1 -}; - -// Slot size (MPEG unit of measurement) - use [layer] -const uint8_t mpeg_slot_size[4] = { 0, 1, 1, 4 }; // Rsvd, 3, 2, 1 - -uint16_t -MP3Frame::CalculateLength() -{ - // Lookup real values of these fields - uint32_t bitrate = mpeg_bitrates[mVersion][mLayer][mBitrate] * 1000; - uint32_t samprate = mpeg_srates[mVersion][mSampleRate]; - uint16_t samples = mpeg_frame_samples[mVersion][mLayer]; - uint8_t slot_size = mpeg_slot_size[mLayer]; - - // In-between calculations - float bps = (float)samples / 8.0; - float fsize = ( (bps * (float)bitrate) / (float)samprate ) - + ( (mPad) ? slot_size : 0 ); - - // Frame sizes are truncated integers - return (uint16_t)fsize; -} - -/* END shameless copy and paste */ - - -/** MP3Parser methods **/ - -MP3Parser::MP3Parser() - : mCurrentChar(0) -{ } - -void -MP3Parser::Reset() -{ - mCurrentChar = 0; -} - -uint16_t -MP3Parser::ParseFrameLength(uint8_t ch) -{ - mData.mRaw[mCurrentChar] = ch; - - MP3Frame &frame = mData.mFrame; - - // Validate MP3 header as we read. We can't mistake the start of an MP3 frame - // for the middle of another frame due to the sync byte at the beginning - // of the frame. - - // The only valid position for an all-high byte is the sync byte at the - // beginning of the frame. - if (ch == 0xff) { - mCurrentChar = 0; - } - - // Make sure the current byte is valid in context. If not, reset the parser. - if (mCurrentChar == 2) { - if (frame.mBitrate == 0x0f) { - goto fail; - } - } else if (mCurrentChar == 1) { - if (frame.mSync2 != 0x07 - || frame.mVersion == 0x01 - || frame.mLayer == 0x00) { - goto fail; - } - } - - // The only valid character at the beginning of the header is 0xff. Fail if - // it's different. - if (mCurrentChar == 0 && frame.mSync1 != 0xff) { - // Couldn't find the sync byte. Fail. - return 0; - } - - mCurrentChar++; - MOZ_ASSERT(mCurrentChar <= sizeof(MP3Frame)); - - // Don't have a full header yet. - if (mCurrentChar < sizeof(MP3Frame)) { - return 0; - } - - // Woo, valid header. Return the length. - mCurrentChar = 0; - return frame.CalculateLength(); - -fail: - Reset(); - return 0; -} - -uint32_t -MP3Parser::GetSampleRate() -{ - MP3Frame &frame = mData.mFrame; - return mpeg_srates[frame.mVersion][frame.mSampleRate]; -} - -uint32_t -MP3Parser::GetSamplesPerFrame() -{ - MP3Frame &frame = mData.mFrame; - return mpeg_frame_samples[frame.mVersion][frame.mLayer]; -} - - -/** ID3Parser methods **/ - -const char sID3Head[3] = { 'I', 'D', '3' }; -const uint32_t ID3_HEADER_LENGTH = 10; -const uint32_t ID3_FOOTER_LENGTH = 10; -const uint8_t ID3_FOOTER_PRESENT = 0x10; - -ID3Parser::ID3Parser() - : mCurrentChar(0) - , mVersion(0) - , mFlags(0) - , mHeaderLength(0) -{ } - -void -ID3Parser::Reset() -{ - mCurrentChar = mVersion = mFlags = mHeaderLength = 0; -} - -bool -ID3Parser::ParseChar(char ch) -{ - switch (mCurrentChar) { - // The first three bytes of an ID3v2 header must match the string "ID3". - case 0: case 1: case 2: - if (ch != sID3Head[mCurrentChar]) { - goto fail; - } - break; - // The fourth and fifth bytes give the version, between 2 and 4. - case 3: - if (ch < '\2' || ch > '\4') { - goto fail; - } - mVersion = uint8_t(ch); - break; - case 4: - if (ch != '\0') { - goto fail; - } - break; - // The sixth byte gives the flags; valid flags depend on the version. - case 5: - if ((ch & (0xff >> mVersion)) != '\0') { - goto fail; - } - mFlags = uint8_t(ch); - break; - // Bytes seven through ten give the sum of the byte length of the extended - // header, the padding and the frames after unsynchronisation. - // These bytes form a 28-bit integer, with the high bit of each byte unset. - case 6: case 7: case 8: case 9: - if (ch & 0x80) { - goto fail; - } - mHeaderLength <<= 7; - mHeaderLength |= ch; - if (mCurrentChar == 9) { - mHeaderLength += ID3_HEADER_LENGTH; - mHeaderLength += (mFlags & ID3_FOOTER_PRESENT) ? ID3_FOOTER_LENGTH : 0; - } - break; - default: - MOZ_CRASH("Header already fully parsed!"); - } - - mCurrentChar++; - - return IsParsed(); - -fail: - if (mCurrentChar) { - Reset(); - return ParseChar(ch); - } - Reset(); - return false; -} - -bool -ID3Parser::IsParsed() const -{ - return mCurrentChar >= ID3_HEADER_LENGTH; -} - -uint32_t -ID3Parser::GetHeaderLength() const -{ - MOZ_ASSERT(IsParsed(), - "Queried length of ID3 header before parsing finished."); - return mHeaderLength; -} - - -/** VBR header helper stuff **/ - -// Helper function to find a VBR header in an MP3 frame. -// Based on information from -// http://www.codeproject.com/Articles/8295/MPEG-Audio-Frame-Header - -const uint32_t VBRI_TAG = FROM_BIG_ENDIAN("VBRI"); -const uint32_t VBRI_OFFSET = 32 - sizeof(MP3Frame); -const uint32_t VBRI_FRAME_COUNT_OFFSET = VBRI_OFFSET + 14; -const uint32_t VBRI_MIN_FRAME_SIZE = VBRI_OFFSET + 26; - -const uint32_t XING_TAG = FROM_BIG_ENDIAN("Xing"); -enum XingFlags { - XING_HAS_NUM_FRAMES = 0x01, - XING_HAS_NUM_BYTES = 0x02, - XING_HAS_TOC = 0x04, - XING_HAS_VBR_SCALE = 0x08 -}; - -static int64_t -ParseXing(const char *aBuffer) -{ - uint32_t flags = FROM_BIG_ENDIAN(aBuffer + 4); - - if (!(flags & XING_HAS_NUM_FRAMES)) { - NS_WARNING("VBR file without frame count. Duration estimation likely to " - "be totally wrong."); - return -1; - } - - int64_t numFrames = -1; - if (flags & XING_HAS_NUM_FRAMES) { - numFrames = FROM_BIG_ENDIAN(aBuffer + 8); - } - - return numFrames; -} - -static int64_t -FindNumVBRFrames(const nsCString& aFrame) -{ - const char *buffer = aFrame.get(); - const char *bufferEnd = aFrame.get() + aFrame.Length(); - - // VBRI header is nice and well-defined; let's try to find that first. - if (aFrame.Length() > VBRI_MIN_FRAME_SIZE && - FROM_BIG_ENDIAN(buffer + VBRI_OFFSET) == VBRI_TAG) { - return FROM_BIG_ENDIAN(buffer + VBRI_FRAME_COUNT_OFFSET); - } - - // We have to search for the Xing header as its position can change. - for (; buffer + sizeof(XING_TAG) < bufferEnd; buffer++) { - if (FROM_BIG_ENDIAN(buffer) == XING_TAG) { - return ParseXing(buffer); - } - } - - return -1; -} - - -/** MP3FrameParser methods **/ - -// Some MP3's have large ID3v2 tags, up to 150KB, so we allow lots of -// skipped bytes to be read, just in case, before we give up and assume -// we're not parsing an MP3 stream. -static const uint32_t MAX_SKIPPED_BYTES = 4096; - -enum { - MP3_HEADER_LENGTH = 4, -}; - -MP3FrameParser::MP3FrameParser(int64_t aLength) -: mLock("MP3FrameParser.mLock"), - mTotalID3Size(0), - mTotalFrameSize(0), - mFrameCount(0), - mOffset(0), - mLength(aLength), - mMP3Offset(-1), - mSamplesPerSecond(0), - mFirstFrameEnd(-1), - mIsMP3(MAYBE_MP3) -{ } - -nsresult MP3FrameParser::ParseBuffer(const uint8_t* aBuffer, - uint32_t aLength, - int64_t aStreamOffset, - uint32_t* aOutBytesRead) -{ - // Iterate forwards over the buffer, looking for ID3 tag, or MP3 - // Frame headers. - const uint8_t *buffer = aBuffer; - const uint8_t *bufferEnd = aBuffer + aLength; - - // If we haven't found any MP3 frame data yet, there might be ID3 headers - // we can skip over. - if (mMP3Offset < 0) { - for (const uint8_t *ch = buffer; ch < bufferEnd; ch++) { - if (mID3Parser.ParseChar(*ch)) { - // Found an ID3 header. We don't care about the body of the header, so - // just skip past. - buffer = ch + mID3Parser.GetHeaderLength() - (ID3_HEADER_LENGTH - 1); - - if (buffer <= ch) { - return NS_ERROR_FAILURE; - } - - ch = buffer; - - mTotalID3Size += mID3Parser.GetHeaderLength(); - - // Yes, this is an MP3! - mIsMP3 = DEFINITELY_MP3; - - mID3Parser.Reset(); - } - } - } - - // The first MP3 frame in a variable bitrate stream can contain metadata - // for duration estimation and seeking, so we buffer that first frame here. - if (aStreamOffset < mFirstFrameEnd) { - uint64_t copyLen = std::min((int64_t)aLength, mFirstFrameEnd - aStreamOffset); - mFirstFrame.Append((const char *)buffer, copyLen); - buffer += copyLen; - } - - while (buffer < bufferEnd) { - uint16_t frameLen = mMP3Parser.ParseFrameLength(*buffer); - - if (frameLen) { - // We've found an MP3 frame! - // This is the first frame (and the only one we'll bother parsing), so: - // * Mark this stream as MP3; - // * Store the offset at which the MP3 data started; and - // * Start buffering the frame, as it might contain handy metadata. - - // We're now sure this is an MP3 stream. - mIsMP3 = DEFINITELY_MP3; - - // We need to know these to convert the number of frames in the stream - // to the length of the stream in seconds. - mSamplesPerSecond = mMP3Parser.GetSampleRate(); - mSamplesPerFrame = mMP3Parser.GetSamplesPerFrame(); - - // If the stream has a constant bitrate, we should only need the length - // of the first frame and the length (in bytes) of the stream to - // estimate the length (in seconds). - mTotalFrameSize += frameLen; - mFrameCount++; - - // If |mMP3Offset| isn't set then this is the first MP3 frame we have - // seen in the stream, which is useful for duration estimation. - if (mMP3Offset > -1) { - uint16_t skip = frameLen - sizeof(MP3Frame); - buffer += skip ? skip : 1; - continue; - } - - // Remember the offset of the MP3 stream. - // We're at the last byte of an MP3Frame, so MP3 data started - // sizeof(MP3Frame) - 1 bytes ago. - mMP3Offset = aStreamOffset - + (buffer - aBuffer) - - (sizeof(MP3Frame) - 1); - - buffer++; - - // If the stream has a variable bitrate, the first frame has metadata - // we need for duration estimation and seeking. Start buffering it so we - // can parse it later. - mFirstFrameEnd = mMP3Offset + frameLen; - uint64_t currOffset = buffer - aBuffer + aStreamOffset; - uint64_t copyLen = std::min(mFirstFrameEnd - currOffset, - (uint64_t)(bufferEnd - buffer)); - mFirstFrame.Append((const char *)buffer, copyLen); - - buffer += copyLen; - - } else { - // Nothing to see here. Move along. - buffer++; - } - } - - *aOutBytesRead = buffer - aBuffer; - - if (mFirstFrameEnd > -1 && mFirstFrameEnd <= aStreamOffset + buffer - aBuffer) { - // We have our whole first frame. Try to find a VBR header. - mNumFrames = FindNumVBRFrames(mFirstFrame); - mFirstFrameEnd = -1; - } - - return NS_OK; -} - -void MP3FrameParser::Parse(const uint8_t* aBuffer, uint32_t aLength, uint64_t aOffset) -{ - MutexAutoLock mon(mLock); - - if (HasExactDuration()) { - // We know the duration; nothing to do here. - return; - } - - const uint8_t* buffer = aBuffer; - int32_t length = aLength; - uint64_t offset = aOffset; - - // Got some data we have seen already. Skip forward to what we need. - if (aOffset < mOffset) { - buffer += mOffset - aOffset; - length -= mOffset - aOffset; - offset = mOffset; - - if (length <= 0) { - return; - } - } - - // If there is a discontinuity in the input stream, reset the state of the - // parsers so we don't get any partial headers. - if (mOffset < aOffset) { - if (!mID3Parser.IsParsed()) { - // Only reset this if it hasn't finished yet. - mID3Parser.Reset(); - } - - if (mFirstFrameEnd > -1) { - NS_WARNING("Discontinuity in input while buffering first frame."); - mFirstFrameEnd = -1; - } - - mMP3Parser.Reset(); - } - - uint32_t bytesRead = 0; - if (NS_FAILED(ParseBuffer(buffer, - length, - offset, - &bytesRead))) { - return; - } - - MOZ_ASSERT(length <= (int)bytesRead, "All bytes should have been consumed"); - - // Update next data offset - mOffset = offset + bytesRead; - - // If we've parsed lots of data and we still have nothing, just give up. - // We don't count ID3 headers towards the skipped bytes count, as MP3 files - // can have massive ID3 sections. - if (!mID3Parser.IsParsed() && mMP3Offset < 0 && - mOffset - mTotalID3Size > MAX_SKIPPED_BYTES) { - mIsMP3 = NOT_MP3; - } -} - -int64_t MP3FrameParser::GetDuration() -{ - MutexAutoLock mon(mLock); - - if (!ParsedHeaders() || !mSamplesPerSecond) { - // Not a single frame decoded yet. - return -1; - } - - MOZ_ASSERT(mFrameCount > 0 && mTotalFrameSize > 0, - "Frame parser should have seen at least one MP3 frame of positive length."); - - if (!mFrameCount || !mTotalFrameSize) { - // This should never happen. - return -1; - } - - double frames; - if (mNumFrames < 0) { - // Estimate the number of frames in the stream based on the average frame - // size and the length of the MP3 file. - double frameSize = (double)mTotalFrameSize / mFrameCount; - frames = (double)(mLength - mMP3Offset) / frameSize; - } else { - // We know the exact number of frames from the VBR header. - frames = mNumFrames; - } - - // The duration of each frame is constant over a given stream. - double usPerFrame = USECS_PER_S * mSamplesPerFrame / mSamplesPerSecond; - - return frames * usPerFrame; -} - -int64_t MP3FrameParser::GetMP3Offset() -{ - MutexAutoLock mon(mLock); - return mMP3Offset; -} - -bool MP3FrameParser::ParsedHeaders() -{ - // We have seen both the beginning and the end of the first MP3 frame in the - // stream. - return mMP3Offset > -1 && mFirstFrameEnd < 0; -} - -bool MP3FrameParser::HasExactDuration() -{ - return ParsedHeaders() && mNumFrames > -1; -} - -bool MP3FrameParser::NeedsData() -{ - // If we don't know the duration exactly then either: - // - we're still waiting for a VBR header; or - // - we look at all frames to constantly update our duration estimate. - return IsMP3() && !HasExactDuration(); -} - -} // namespace mozilla diff --git a/dom/media/MP3FrameParser.h b/dom/media/MP3FrameParser.h deleted file mode 100644 index d2ba791fd..000000000 --- a/dom/media/MP3FrameParser.h +++ /dev/null @@ -1,219 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#ifndef MP3FrameParser_h -#define MP3FrameParser_h - -#include <stdint.h> - -#include "mozilla/Mutex.h" -#include "nsString.h" -#include "Intervals.h" - -namespace mozilla { - -// Simple parser to tell whether we've found an ID3 header and how long it is, -// so that we can skip it. -// XXX maybe actually parse this stuff? -class ID3Parser -{ -public: - ID3Parser(); - - void Reset(); - bool ParseChar(char ch); - bool IsParsed() const; - uint32_t GetHeaderLength() const; - -private: - uint32_t mCurrentChar; - uint8_t mVersion; - uint8_t mFlags; - uint32_t mHeaderLength; -}; - -struct MP3Frame { - uint16_t mSync1 : 8; // Always all set - uint16_t mProtected : 1; // Ignored - uint16_t mLayer : 2; - uint16_t mVersion : 2; - uint16_t mSync2 : 3; // Always all set - uint16_t mPrivate : 1; // Ignored - uint16_t mPad : 1; - uint16_t mSampleRate : 2; // Index into mpeg_srates above - uint16_t mBitrate : 4; // Index into mpeg_bitrates above - - uint16_t CalculateLength(); -}; - -// Buffering parser for MP3 frames. -class MP3Parser -{ -public: - MP3Parser(); - - // Forget all data the parser has seen so far. - void Reset(); - - // Parse the given byte. If we have found a frame header, return the length of - // the frame. - uint16_t ParseFrameLength(uint8_t ch); - - // Get the sample rate from the current header. - uint32_t GetSampleRate(); - - // Get the number of samples per frame. - uint32_t GetSamplesPerFrame(); - -private: - uint32_t mCurrentChar; - union { - uint8_t mRaw[3]; - MP3Frame mFrame; - } mData; -}; - - -// A description of the MP3 format and its extensions is available at -// -// http://www.codeproject.com/Articles/8295/MPEG-Audio-Frame-Header -// -// The data in MP3 streams is split into small frames, with each frame -// containing a fixed number of samples. The duration of a frame depends -// on the frame's bit rate and sample rate. Both values can vary among -// frames, so it is necessary to examine each individual frame of an MP3 -// stream to calculate the stream's overall duration. -// -// The MP3 frame parser extracts information from an MP3 data stream. It -// accepts a range of frames of an MP3 stream as input, and parses all -// frames for their duration. Callers can query the stream's overall -// duration from the parser. -// -// Call the methods NotifyDataArrived or Parse to add new data. If you added -// information for a certain stream position, you cannot go back to previous -// positions. The parser will simply ignore the input. If you skip stream -// positions, the duration of the related MP3 frames will be estimated from -// the stream's average. -// -// The method GetDuration returns calculated duration of the stream, including -// estimates for skipped ranges. -// -// All public methods are thread-safe. - -class MP3FrameParser -{ -public: - explicit MP3FrameParser(int64_t aLength=-1); - - bool IsMP3() { - MutexAutoLock mon(mLock); - return mIsMP3 != NOT_MP3; - } - - void Parse(const uint8_t* aBuffer, uint32_t aLength, uint64_t aStreamOffset); - - // Returns the duration, in microseconds. If the entire stream has not - // been parsed yet, this is an estimate based on the bitrate of the - // frames parsed so far. - int64_t GetDuration(); - - // Returns the offset of the first MP3 frame in the stream, or -1 of - // no MP3 frame has been detected yet. - int64_t GetMP3Offset(); - - // Returns true if we've seen the whole first frame of the MP3 stream, and - // therefore can make an estimate on the stream duration. - // Otherwise, returns false. - bool ParsedHeaders(); - - // Returns true if we know the exact duration of the MP3 stream; - // false otherwise. - bool HasExactDuration(); - - // Returns true if the parser needs more data for duration estimation. - bool NeedsData(); - // Assign the total lenght of this mp3 stream - void SetLength(int64_t aLength) { - MutexAutoLock mon(mLock); - mLength = aLength; - } -private: - - // Parses aBuffer, starting at offset 0. Returns the number of bytes - // parsed, relative to the start of the buffer. Note this may be - // greater than aLength if the headers in the buffer indicate that - // the frame or ID3 tag extends outside of aBuffer. Returns failure - // if too many non-MP3 bytes are parsed. - nsresult ParseBuffer(const uint8_t* aBuffer, - uint32_t aLength, - int64_t aStreamOffset, - uint32_t* aOutBytesRead); - - // A low-contention lock for protecting the parser results - Mutex mLock; - - // ID3 header parser. Keeps state between reads in case the header falls - // in between. - ID3Parser mID3Parser; - - // MP3 frame header parser. - MP3Parser mMP3Parser; - - // If we read |MAX_SKIPPED_BYTES| from the stream without finding any MP3 - // frames, we give up and report |NOT_MP3|. Here we track the cumulative size - // of any ID3 headers we've seen so big ID3 sections aren't counted towards - // skipped bytes. - uint32_t mTotalID3Size; - - // All fields below are protected by mLock - - // We keep stats on the size of all the frames we've seen, as well as how many - // so that we can estimate the duration of the rest of the stream. - uint64_t mTotalFrameSize; - uint64_t mFrameCount; - - // Offset of the last data parsed. This is the end offset of the last data - // block parsed, so it's the start offset we expect to get on the next - // call to Parse(). - uint64_t mOffset; - - // Total length of the stream in bytes. - int64_t mLength; - - // Offset of first MP3 frame in the bitstream. Has value -1 until the - // first MP3 frame is found. - int64_t mMP3Offset; - - // The exact number of frames in this stream, if we know it. -1 otherwise. - int64_t mNumFrames; - - // Number of audio samples per second and per frame. Fixed through the whole - // file. If we know these variables as well as the number of frames in the - // file, we can get an exact duration for the stream. - uint16_t mSamplesPerSecond; - uint16_t mSamplesPerFrame; - - // If the MP3 has a variable bitrate, then there *should* be metadata about - // the encoding in the first frame. We buffer the first frame here. - nsCString mFirstFrame; - - // While we are reading the first frame, this is the stream offset of the - // last byte of that frame. -1 at all other times. - int64_t mFirstFrameEnd; - - enum eIsMP3 { - MAYBE_MP3, // We're giving the stream the benefit of the doubt... - DEFINITELY_MP3, // We've hit at least one ID3 tag or MP3 frame. - NOT_MP3 // Not found any evidence of the stream being MP3. - }; - - eIsMP3 mIsMP3; - -}; - -} // namespace mozilla - -#endif diff --git a/dom/media/ThreadPoolCOMListener.h b/dom/media/ThreadPoolCOMListener.h index 881013a78..424ca65d2 100644 --- a/dom/media/ThreadPoolCOMListener.h +++ b/dom/media/ThreadPoolCOMListener.h @@ -13,8 +13,8 @@ namespace mozilla { // Thread pool listener which ensures that MSCOM is initialized and -// deinitialized on the thread pool thread. We may call into WMF or -// DirectShow on this thread, so we need MSCOM working. +// deinitialized on the thread pool thread. We may call into WMF on +// this thread, so we need MSCOM working. class MSCOMInitThreadPoolListener final : public nsIThreadPoolListener { ~MSCOMInitThreadPoolListener() {} public: diff --git a/dom/media/WebVTTListener.h b/dom/media/WebVTTListener.h index 67271664a..461d7f00d 100644 --- a/dom/media/WebVTTListener.h +++ b/dom/media/WebVTTListener.h @@ -10,6 +10,7 @@ #include "nsIStreamListener.h" #include "nsIChannelEventSink.h" #include "nsIInterfaceRequestor.h" +#include "nsCOMPtr.h" #include "nsCycleCollectionParticipant.h" class nsIWebVTTParserWrapper; diff --git a/dom/media/directshow/AudioSinkFilter.cpp b/dom/media/directshow/AudioSinkFilter.cpp deleted file mode 100644 index 9f23c0e00..000000000 --- a/dom/media/directshow/AudioSinkFilter.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#include "SampleSink.h" -#include "AudioSinkFilter.h" -#include "AudioSinkInputPin.h" -#include "VideoUtils.h" -#include "mozilla/Logging.h" - - -#include <initguid.h> -#include <wmsdkidl.h> - -#define DELETE_RESET(p) { delete (p) ; (p) = nullptr ;} - -DEFINE_GUID(CLSID_MozAudioSinkFilter, 0x1872d8c8, 0xea8d, 0x4c34, 0xae, 0x96, 0x69, 0xde, - 0xf1, 0x33, 0x7b, 0x33); - -using namespace mozilla::media; - -namespace mozilla { - -static LazyLogModule gDirectShowLog("DirectShowDecoder"); -#define LOG(...) MOZ_LOG(gDirectShowLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) - -AudioSinkFilter::AudioSinkFilter(const wchar_t* aObjectName, HRESULT* aOutResult) - : BaseFilter(aObjectName, CLSID_MozAudioSinkFilter), - mFilterCritSec("AudioSinkFilter::mFilterCritSec") -{ - (*aOutResult) = S_OK; - mInputPin = new AudioSinkInputPin(L"AudioSinkInputPin", - this, - &mFilterCritSec, - aOutResult); -} - -AudioSinkFilter::~AudioSinkFilter() -{ -} - -int -AudioSinkFilter::GetPinCount() -{ - return 1; -} - -BasePin* -AudioSinkFilter::GetPin(int aIndex) -{ - CriticalSectionAutoEnter lockFilter(mFilterCritSec); - return (aIndex == 0) ? static_cast<BasePin*>(mInputPin) : nullptr; -} - -HRESULT -AudioSinkFilter::Pause() -{ - CriticalSectionAutoEnter lockFilter(mFilterCritSec); - if (mState == State_Stopped) { - // Change the state, THEN activate the input pin. - mState = State_Paused; - if (mInputPin && mInputPin->IsConnected()) { - mInputPin->Active(); - } - } else if (mState == State_Running) { - mState = State_Paused; - } - return S_OK; -} - -HRESULT -AudioSinkFilter::Stop() -{ - CriticalSectionAutoEnter lockFilter(mFilterCritSec); - mState = State_Stopped; - if (mInputPin) { - mInputPin->Inactive(); - } - - GetSampleSink()->Flush(); - - return S_OK; -} - -HRESULT -AudioSinkFilter::Run(REFERENCE_TIME tStart) -{ - LOG("AudioSinkFilter::Run(%lld) [%4.2lf]", - RefTimeToUsecs(tStart), - double(RefTimeToUsecs(tStart)) / USECS_PER_S); - return media::BaseFilter::Run(tStart); -} - -HRESULT -AudioSinkFilter::GetClassID( OUT CLSID * pCLSID ) -{ - (* pCLSID) = CLSID_MozAudioSinkFilter; - return S_OK; -} - -HRESULT -AudioSinkFilter::QueryInterface(REFIID aIId, void **aInterface) -{ - if (aIId == IID_IMediaSeeking) { - *aInterface = static_cast<IMediaSeeking*>(this); - AddRef(); - return S_OK; - } - return mozilla::media::BaseFilter::QueryInterface(aIId, aInterface); -} - -ULONG -AudioSinkFilter::AddRef() -{ - return ::InterlockedIncrement(&mRefCnt); -} - -ULONG -AudioSinkFilter::Release() -{ - unsigned long newRefCnt = ::InterlockedDecrement(&mRefCnt); - if (!newRefCnt) { - delete this; - } - return newRefCnt; -} - -SampleSink* -AudioSinkFilter::GetSampleSink() -{ - return mInputPin->GetSampleSink(); -} - - -// IMediaSeeking implementation. -// -// Calls to IMediaSeeking are forwarded to the output pin that the -// AudioSinkInputPin is connected to, i.e. upstream towards the parser and -// source filters, which actually implement seeking. -#define ENSURE_CONNECTED_PIN_SEEKING \ - if (!mInputPin) { \ - return E_NOTIMPL; \ - } \ - RefPtr<IMediaSeeking> pinSeeking = mInputPin->GetConnectedPinSeeking(); \ - if (!pinSeeking) { \ - return E_NOTIMPL; \ - } - -HRESULT -AudioSinkFilter::GetCapabilities(DWORD* aCapabilities) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->GetCapabilities(aCapabilities); -} - -HRESULT -AudioSinkFilter::CheckCapabilities(DWORD* aCapabilities) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->CheckCapabilities(aCapabilities); -} - -HRESULT -AudioSinkFilter::IsFormatSupported(const GUID* aFormat) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->IsFormatSupported(aFormat); -} - -HRESULT -AudioSinkFilter::QueryPreferredFormat(GUID* aFormat) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->QueryPreferredFormat(aFormat); -} - -HRESULT -AudioSinkFilter::GetTimeFormat(GUID* aFormat) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->GetTimeFormat(aFormat); -} - -HRESULT -AudioSinkFilter::IsUsingTimeFormat(const GUID* aFormat) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->IsUsingTimeFormat(aFormat); -} - -HRESULT -AudioSinkFilter::SetTimeFormat(const GUID* aFormat) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->SetTimeFormat(aFormat); -} - -HRESULT -AudioSinkFilter::GetDuration(LONGLONG* aDuration) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->GetDuration(aDuration); -} - -HRESULT -AudioSinkFilter::GetStopPosition(LONGLONG* aStop) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->GetStopPosition(aStop); -} - -HRESULT -AudioSinkFilter::GetCurrentPosition(LONGLONG* aCurrent) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->GetCurrentPosition(aCurrent); -} - -HRESULT -AudioSinkFilter::ConvertTimeFormat(LONGLONG* aTarget, - const GUID* aTargetFormat, - LONGLONG aSource, - const GUID* aSourceFormat) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->ConvertTimeFormat(aTarget, - aTargetFormat, - aSource, - aSourceFormat); -} - -HRESULT -AudioSinkFilter::SetPositions(LONGLONG* aCurrent, - DWORD aCurrentFlags, - LONGLONG* aStop, - DWORD aStopFlags) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->SetPositions(aCurrent, - aCurrentFlags, - aStop, - aStopFlags); -} - -HRESULT -AudioSinkFilter::GetPositions(LONGLONG* aCurrent, - LONGLONG* aStop) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->GetPositions(aCurrent, aStop); -} - -HRESULT -AudioSinkFilter::GetAvailable(LONGLONG* aEarliest, - LONGLONG* aLatest) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->GetAvailable(aEarliest, aLatest); -} - -HRESULT -AudioSinkFilter::SetRate(double aRate) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->SetRate(aRate); -} - -HRESULT -AudioSinkFilter::GetRate(double* aRate) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->GetRate(aRate); -} - -HRESULT -AudioSinkFilter::GetPreroll(LONGLONG* aPreroll) -{ - ENSURE_CONNECTED_PIN_SEEKING - return pinSeeking->GetPreroll(aPreroll); -} - -} // namespace mozilla - diff --git a/dom/media/directshow/AudioSinkFilter.h b/dom/media/directshow/AudioSinkFilter.h deleted file mode 100644 index 85abdfccf..000000000 --- a/dom/media/directshow/AudioSinkFilter.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#if !defined(AudioSinkFilter_h_) -#define AudioSinkFilter_h_ - -#include "BaseFilter.h" -#include "DirectShowUtils.h" -#include "nsAutoPtr.h" -#include "mozilla/RefPtr.h" - -namespace mozilla { - -class AudioSinkInputPin; -class SampleSink; - -// Filter that acts as the end of the graph. Audio samples input into -// this filter block the calling thread, and the calling thread is -// unblocked when the decode thread extracts the sample. The samples -// input into this filter are stored in the SampleSink, where the blocking -// is implemented. The input pin owns the SampleSink. -class AudioSinkFilter: public mozilla::media::BaseFilter, - public IMediaSeeking -{ - -public: - AudioSinkFilter(const wchar_t* aObjectName, HRESULT* aOutResult); - virtual ~AudioSinkFilter(); - - // Gets the input pin's sample sink. - SampleSink* GetSampleSink(); - - // IUnknown implementation. - STDMETHODIMP QueryInterface(REFIID aIId, void **aInterface); - STDMETHODIMP_(ULONG) AddRef(); - STDMETHODIMP_(ULONG) Release(); - - // -------------------------------------------------------------------- - // CBaseFilter methods - int GetPinCount (); - mozilla::media::BasePin* GetPin ( IN int Index); - STDMETHODIMP Pause (); - STDMETHODIMP Stop (); - STDMETHODIMP GetClassID ( OUT CLSID * pCLSID); - STDMETHODIMP Run(REFERENCE_TIME tStart); - // IMediaSeeking Methods... - - // We defer to SourceFilter, but we must expose the interface on - // the output pins. Seeking commands come upstream from the renderers, - // but they must be actioned at the source filters. - STDMETHODIMP GetCapabilities(DWORD* aCapabilities); - STDMETHODIMP CheckCapabilities(DWORD* aCapabilities); - STDMETHODIMP IsFormatSupported(const GUID* aFormat); - STDMETHODIMP QueryPreferredFormat(GUID* aFormat); - STDMETHODIMP GetTimeFormat(GUID* aFormat); - STDMETHODIMP IsUsingTimeFormat(const GUID* aFormat); - STDMETHODIMP SetTimeFormat(const GUID* aFormat); - STDMETHODIMP GetDuration(LONGLONG* pDuration); - STDMETHODIMP GetStopPosition(LONGLONG* pStop); - STDMETHODIMP GetCurrentPosition(LONGLONG* aCurrent); - STDMETHODIMP ConvertTimeFormat(LONGLONG* aTarget, - const GUID* aTargetFormat, - LONGLONG aSource, - const GUID* aSourceFormat); - STDMETHODIMP SetPositions(LONGLONG* aCurrent, - DWORD aCurrentFlags, - LONGLONG* aStop, - DWORD aStopFlags); - STDMETHODIMP GetPositions(LONGLONG* aCurrent, - LONGLONG* aStop); - STDMETHODIMP GetAvailable(LONGLONG* aEarliest, - LONGLONG* aLatest); - STDMETHODIMP SetRate(double aRate); - STDMETHODIMP GetRate(double* aRate); - STDMETHODIMP GetPreroll(LONGLONG* aPreroll); - - // -------------------------------------------------------------------- - // class factory calls this - static IUnknown * CreateInstance (IN LPUNKNOWN punk, OUT HRESULT * phr); - -private: - CriticalSection mFilterCritSec; - - // Note: The input pin defers its refcounting to the sink filter, so when - // the input pin is addrefed, what actually happens is the sink filter is - // addrefed. - nsAutoPtr<AudioSinkInputPin> mInputPin; -}; - -} // namespace mozilla - -#endif // AudioSinkFilter_h_ diff --git a/dom/media/directshow/AudioSinkInputPin.cpp b/dom/media/directshow/AudioSinkInputPin.cpp deleted file mode 100644 index 85a6e3da3..000000000 --- a/dom/media/directshow/AudioSinkInputPin.cpp +++ /dev/null @@ -1,195 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#include "AudioSinkInputPin.h" -#include "AudioSinkFilter.h" -#include "SampleSink.h" -#include "mozilla/Logging.h" - -#include <wmsdkidl.h> - -using namespace mozilla::media; - -namespace mozilla { - -static LazyLogModule gDirectShowLog("DirectShowDecoder"); -#define LOG(...) MOZ_LOG(gDirectShowLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) - -AudioSinkInputPin::AudioSinkInputPin(wchar_t* aObjectName, - AudioSinkFilter* aFilter, - mozilla::CriticalSection* aLock, - HRESULT* aOutResult) - : BaseInputPin(aObjectName, aFilter, aLock, aOutResult, aObjectName), - mSegmentStartTime(0) -{ - MOZ_COUNT_CTOR(AudioSinkInputPin); - mSampleSink = new SampleSink(); -} - -AudioSinkInputPin::~AudioSinkInputPin() -{ - MOZ_COUNT_DTOR(AudioSinkInputPin); -} - -HRESULT -AudioSinkInputPin::GetMediaType(int aPosition, MediaType* aOutMediaType) -{ - NS_ENSURE_TRUE(aPosition >= 0, E_INVALIDARG); - NS_ENSURE_TRUE(aOutMediaType, E_POINTER); - - if (aPosition > 0) { - return S_FALSE; - } - - // Note: We set output as PCM, as IEEE_FLOAT only works when using the - // MP3 decoder as an MFT, and we can't do that while using DirectShow. - aOutMediaType->SetType(&MEDIATYPE_Audio); - aOutMediaType->SetSubtype(&MEDIASUBTYPE_PCM); - aOutMediaType->SetType(&FORMAT_WaveFormatEx); - aOutMediaType->SetTemporalCompression(FALSE); - - return S_OK; -} - -HRESULT -AudioSinkInputPin::CheckMediaType(const MediaType* aMediaType) -{ - if (!aMediaType) { - return E_INVALIDARG; - } - - GUID majorType = *aMediaType->Type(); - if (majorType != MEDIATYPE_Audio && majorType != WMMEDIATYPE_Audio) { - return E_INVALIDARG; - } - - if (*aMediaType->Subtype() != MEDIASUBTYPE_PCM) { - return E_INVALIDARG; - } - - if (*aMediaType->FormatType() != FORMAT_WaveFormatEx) { - return E_INVALIDARG; - } - - // We accept the media type, stash its layout format! - WAVEFORMATEX* wfx = (WAVEFORMATEX*)(aMediaType->pbFormat); - GetSampleSink()->SetAudioFormat(wfx); - - return S_OK; -} - -AudioSinkFilter* -AudioSinkInputPin::GetAudioSinkFilter() -{ - return reinterpret_cast<AudioSinkFilter*>(mFilter); -} - -SampleSink* -AudioSinkInputPin::GetSampleSink() -{ - return mSampleSink; -} - -HRESULT -AudioSinkInputPin::SetAbsoluteMediaTime(IMediaSample* aSample) -{ - HRESULT hr; - REFERENCE_TIME start = 0, end = 0; - hr = aSample->GetTime(&start, &end); - NS_ENSURE_TRUE(SUCCEEDED(hr), E_FAIL); - { - CriticalSectionAutoEnter lock(*mLock); - start += mSegmentStartTime; - end += mSegmentStartTime; - } - hr = aSample->SetMediaTime(&start, &end); - NS_ENSURE_TRUE(SUCCEEDED(hr), E_FAIL); - return S_OK; -} - -HRESULT -AudioSinkInputPin::Receive(IMediaSample* aSample ) -{ - HRESULT hr; - NS_ENSURE_TRUE(aSample, E_POINTER); - - hr = BaseInputPin::Receive(aSample); - if (SUCCEEDED(hr) && hr != S_FALSE) { // S_FALSE == flushing - // Set the timestamp of the sample after being adjusted for - // seeking/segments in the "media time" attribute. When we seek, - // DirectShow starts a new "segment", and starts labeling samples - // from time=0 again, so we need to correct for this to get the - // actual timestamps after seeking. - hr = SetAbsoluteMediaTime(aSample); - NS_ENSURE_TRUE(SUCCEEDED(hr), hr); - hr = GetSampleSink()->Receive(aSample); - NS_ENSURE_TRUE(SUCCEEDED(hr), hr); - } - return S_OK; -} - -already_AddRefed<IMediaSeeking> -AudioSinkInputPin::GetConnectedPinSeeking() -{ - RefPtr<IPin> peer = GetConnected(); - if (!peer) - return nullptr; - RefPtr<IMediaSeeking> seeking; - peer->QueryInterface(static_cast<IMediaSeeking**>(getter_AddRefs(seeking))); - return seeking.forget(); -} - -HRESULT -AudioSinkInputPin::BeginFlush() -{ - HRESULT hr = media::BaseInputPin::BeginFlush(); - NS_ENSURE_TRUE(SUCCEEDED(hr), hr); - - GetSampleSink()->Flush(); - - return S_OK; -} - -HRESULT -AudioSinkInputPin::EndFlush() -{ - HRESULT hr = media::BaseInputPin::EndFlush(); - NS_ENSURE_TRUE(SUCCEEDED(hr), hr); - - // Reset the EOS flag, so that if we're called after a seek we still work. - GetSampleSink()->Reset(); - - return S_OK; -} - -HRESULT -AudioSinkInputPin::EndOfStream(void) -{ - HRESULT hr = media::BaseInputPin::EndOfStream(); - if (FAILED(hr) || hr == S_FALSE) { - // Pin is stil flushing. - return hr; - } - GetSampleSink()->SetEOS(); - - return S_OK; -} - - -HRESULT -AudioSinkInputPin::NewSegment(REFERENCE_TIME tStart, - REFERENCE_TIME tStop, - double dRate) -{ - CriticalSectionAutoEnter lock(*mLock); - // Record the start time of the new segment, so that we can store the - // correct absolute timestamp in the "media time" each incoming sample. - mSegmentStartTime = tStart; - return S_OK; -} - -} // namespace mozilla - diff --git a/dom/media/directshow/AudioSinkInputPin.h b/dom/media/directshow/AudioSinkInputPin.h deleted file mode 100644 index 80503c641..000000000 --- a/dom/media/directshow/AudioSinkInputPin.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#if !defined(AudioSinkInputPin_h_) -#define AudioSinkInputPin_h_ - -#include "BaseInputPin.h" -#include "DirectShowUtils.h" -#include "mozilla/RefPtr.h" -#include "nsAutoPtr.h" - -namespace mozilla { - -namespace media { - class MediaType; -} - -class AudioSinkFilter; -class SampleSink; - - -// Input pin for capturing audio output of a DirectShow filter graph. -// This is the input pin for the AudioSinkFilter. -class AudioSinkInputPin: public mozilla::media::BaseInputPin -{ -public: - AudioSinkInputPin(wchar_t* aObjectName, - AudioSinkFilter* aFilter, - mozilla::CriticalSection* aLock, - HRESULT* aOutResult); - virtual ~AudioSinkInputPin(); - - HRESULT GetMediaType (IN int iPos, OUT mozilla::media::MediaType * pmt); - HRESULT CheckMediaType (IN const mozilla::media::MediaType * pmt); - STDMETHODIMP Receive (IN IMediaSample *); - STDMETHODIMP BeginFlush() override; - STDMETHODIMP EndFlush() override; - - // Called when we start decoding a new segment, that happens directly after - // a seek. This captures the segment's start time. Samples decoded by the - // MP3 decoder have their timestamps offset from the segment start time. - // Storing the segment start time enables us to set each sample's MediaTime - // as an offset in the stream relative to the start of the stream, rather - // than the start of the segment, i.e. its absolute time in the stream. - STDMETHODIMP NewSegment(REFERENCE_TIME tStart, - REFERENCE_TIME tStop, - double dRate) override; - - STDMETHODIMP EndOfStream() override; - - // Returns the IMediaSeeking interface of the connected output pin. - // We forward seeking requests upstream from the sink to the source - // filters. - already_AddRefed<IMediaSeeking> GetConnectedPinSeeking(); - - SampleSink* GetSampleSink(); - -private: - AudioSinkFilter* GetAudioSinkFilter(); - - // Sets the media time on the media sample, relative to the segment - // start time. - HRESULT SetAbsoluteMediaTime(IMediaSample* aSample); - - nsAutoPtr<SampleSink> mSampleSink; - - // Synchronized by the filter lock; BaseInputPin::mLock. - REFERENCE_TIME mSegmentStartTime; -}; - -} // namespace mozilla - -#endif // AudioSinkInputPin_h_ diff --git a/dom/media/directshow/DirectShowDecoder.cpp b/dom/media/directshow/DirectShowDecoder.cpp deleted file mode 100644 index da68b4daa..000000000 --- a/dom/media/directshow/DirectShowDecoder.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#include "DirectShowDecoder.h" -#include "DirectShowReader.h" -#include "DirectShowUtils.h" -#include "MediaDecoderStateMachine.h" -#include "mozilla/Preferences.h" -#include "mozilla/WindowsVersion.h" - -namespace mozilla { - -MediaDecoderStateMachine* DirectShowDecoder::CreateStateMachine() -{ - return new MediaDecoderStateMachine(this, new DirectShowReader(this)); -} - -/* static */ -bool -DirectShowDecoder::GetSupportedCodecs(const nsACString& aType, - char const *const ** aCodecList) -{ - if (!IsEnabled()) { - return false; - } - - static char const *const mp3AudioCodecs[] = { - "mp3", - nullptr - }; - if (aType.EqualsASCII("audio/mpeg") || - aType.EqualsASCII("audio/mp3")) { - if (aCodecList) { - *aCodecList = mp3AudioCodecs; - } - return true; - } - - return false; -} - -/* static */ -bool -DirectShowDecoder::IsEnabled() -{ - return CanDecodeMP3UsingDirectShow() && - Preferences::GetBool("media.directshow.enabled"); -} - -DirectShowDecoder::DirectShowDecoder(MediaDecoderOwner* aOwner) - : MediaDecoder(aOwner) -{ - MOZ_COUNT_CTOR(DirectShowDecoder); -} - -DirectShowDecoder::~DirectShowDecoder() -{ - MOZ_COUNT_DTOR(DirectShowDecoder); -} - -} // namespace mozilla - diff --git a/dom/media/directshow/DirectShowDecoder.h b/dom/media/directshow/DirectShowDecoder.h deleted file mode 100644 index c4d371fbf..000000000 --- a/dom/media/directshow/DirectShowDecoder.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#if !defined(DirectShowDecoder_h_) -#define DirectShowDecoder_h_ - -#include "MediaDecoder.h" - -namespace mozilla { - -// Decoder that uses DirectShow to playback MP3 files only. -class DirectShowDecoder : public MediaDecoder -{ -public: - - explicit DirectShowDecoder(MediaDecoderOwner* aOwner); - virtual ~DirectShowDecoder(); - - MediaDecoder* Clone(MediaDecoderOwner* aOwner) override { - if (!IsEnabled()) { - return nullptr; - } - return new DirectShowDecoder(aOwner); - } - - MediaDecoderStateMachine* CreateStateMachine() override; - - // Returns true if aType is a MIME type that we render with the - // DirectShow backend. If aCodecList is non null, - // it is filled with a (static const) null-terminated list of strings - // denoting the codecs we'll playback. Note that playback is strictly - // limited to MP3 only. - static bool GetSupportedCodecs(const nsACString& aType, - char const *const ** aCodecList); - - // Returns true if the DirectShow backend is preffed on. - static bool IsEnabled(); -}; - -} // namespace mozilla - -#endif diff --git a/dom/media/directshow/DirectShowReader.cpp b/dom/media/directshow/DirectShowReader.cpp deleted file mode 100644 index cacf6f8de..000000000 --- a/dom/media/directshow/DirectShowReader.cpp +++ /dev/null @@ -1,360 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* 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/. */ - -#include "DirectShowReader.h" -#include "MediaDecoderReader.h" -#include "mozilla/RefPtr.h" -#include "DirectShowUtils.h" -#include "AudioSinkFilter.h" -#include "SourceFilter.h" -#include "SampleSink.h" -#include "VideoUtils.h" - -using namespace mozilla::media; - -namespace mozilla { - -// Windows XP's MP3 decoder filter. This is available on XP only, on Vista -// and later we can use the DMO Wrapper filter and MP3 decoder DMO. -const GUID DirectShowReader::CLSID_MPEG_LAYER_3_DECODER_FILTER = -{ 0x38BE3000, 0xDBF4, 0x11D0, {0x86, 0x0E, 0x00, 0xA0, 0x24, 0xCF, 0xEF, 0x6D} }; - - -static LazyLogModule gDirectShowLog("DirectShowDecoder"); -#define LOG(...) MOZ_LOG(gDirectShowLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) - -DirectShowReader::DirectShowReader(AbstractMediaDecoder* aDecoder) - : MediaDecoderReader(aDecoder), - mMP3FrameParser(aDecoder->GetResource()->GetLength()), -#ifdef DIRECTSHOW_REGISTER_GRAPH - mRotRegister(0), -#endif - mNumChannels(0), - mAudioRate(0), - mBytesPerSample(0) -{ - MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread."); - MOZ_COUNT_CTOR(DirectShowReader); -} - -DirectShowReader::~DirectShowReader() -{ - MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread."); - MOZ_COUNT_DTOR(DirectShowReader); -#ifdef DIRECTSHOW_REGISTER_GRAPH - if (mRotRegister) { - RemoveGraphFromRunningObjectTable(mRotRegister); - } -#endif -} - -// Try to parse the MP3 stream to make sure this is indeed an MP3, get the -// estimated duration of the stream, and find the offset of the actual MP3 -// frames in the stream, as DirectShow doesn't like large ID3 sections. -static nsresult -ParseMP3Headers(MP3FrameParser *aParser, MediaResource *aResource) -{ - const uint32_t MAX_READ_SIZE = 4096; - - uint64_t offset = 0; - while (aParser->NeedsData() && !aParser->ParsedHeaders()) { - uint32_t bytesRead; - char buffer[MAX_READ_SIZE]; - nsresult rv = aResource->ReadAt(offset, buffer, - MAX_READ_SIZE, &bytesRead); - NS_ENSURE_SUCCESS(rv, rv); - - if (!bytesRead) { - // End of stream. - return NS_ERROR_FAILURE; - } - - aParser->Parse(reinterpret_cast<uint8_t*>(buffer), bytesRead, offset); - offset += bytesRead; - } - - return aParser->IsMP3() ? NS_OK : NS_ERROR_FAILURE; -} - -nsresult -DirectShowReader::ReadMetadata(MediaInfo* aInfo, - MetadataTags** aTags) -{ - MOZ_ASSERT(OnTaskQueue()); - HRESULT hr; - nsresult rv; - - // Create the filter graph, reference it by the GraphBuilder interface, - // to make graph building more convenient. - hr = CoCreateInstance(CLSID_FilterGraph, - nullptr, - CLSCTX_INPROC_SERVER, - IID_IGraphBuilder, - reinterpret_cast<void**>(static_cast<IGraphBuilder**>(getter_AddRefs(mGraph)))); - NS_ENSURE_TRUE(SUCCEEDED(hr) && mGraph, NS_ERROR_FAILURE); - - rv = ParseMP3Headers(&mMP3FrameParser, mDecoder->GetResource()); - NS_ENSURE_SUCCESS(rv, rv); - - #ifdef DIRECTSHOW_REGISTER_GRAPH - hr = AddGraphToRunningObjectTable(mGraph, &mRotRegister); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - #endif - - // Extract the interface pointers we'll need from the filter graph. - hr = mGraph->QueryInterface(static_cast<IMediaControl**>(getter_AddRefs(mControl))); - NS_ENSURE_TRUE(SUCCEEDED(hr) && mControl, NS_ERROR_FAILURE); - - hr = mGraph->QueryInterface(static_cast<IMediaSeeking**>(getter_AddRefs(mMediaSeeking))); - NS_ENSURE_TRUE(SUCCEEDED(hr) && mMediaSeeking, NS_ERROR_FAILURE); - - // Build the graph. Create the filters we need, and connect them. We - // build the entire graph ourselves to prevent other decoders installed - // on the system being created and used. - - // Our source filters, wraps the MediaResource. - mSourceFilter = new SourceFilter(MEDIATYPE_Stream, MEDIASUBTYPE_MPEG1Audio); - NS_ENSURE_TRUE(mSourceFilter, NS_ERROR_FAILURE); - - rv = mSourceFilter->Init(mDecoder->GetResource(), mMP3FrameParser.GetMP3Offset()); - NS_ENSURE_SUCCESS(rv, rv); - - hr = mGraph->AddFilter(mSourceFilter, L"MozillaDirectShowSource"); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - - // The MPEG demuxer. - RefPtr<IBaseFilter> demuxer; - hr = CreateAndAddFilter(mGraph, - CLSID_MPEG1Splitter, - L"MPEG1Splitter", - getter_AddRefs(demuxer)); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - - // Platform MP3 decoder. - RefPtr<IBaseFilter> decoder; - // Firstly try to create the MP3 decoder filter that ships with WinXP - // directly. This filter doesn't normally exist on later versions of - // Windows. - hr = CreateAndAddFilter(mGraph, - CLSID_MPEG_LAYER_3_DECODER_FILTER, - L"MPEG Layer 3 Decoder", - getter_AddRefs(decoder)); - if (FAILED(hr)) { - // Failed to create MP3 decoder filter. Try to instantiate - // the MP3 decoder DMO. - hr = AddMP3DMOWrapperFilter(mGraph, getter_AddRefs(decoder)); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - } - - // Sink, captures audio samples and inserts them into our pipeline. - static const wchar_t* AudioSinkFilterName = L"MozAudioSinkFilter"; - mAudioSinkFilter = new AudioSinkFilter(AudioSinkFilterName, &hr); - NS_ENSURE_TRUE(mAudioSinkFilter && SUCCEEDED(hr), NS_ERROR_FAILURE); - hr = mGraph->AddFilter(mAudioSinkFilter, AudioSinkFilterName); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - - // Join the filters. - hr = ConnectFilters(mGraph, mSourceFilter, demuxer); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - - hr = ConnectFilters(mGraph, demuxer, decoder); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - - hr = ConnectFilters(mGraph, decoder, mAudioSinkFilter); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - - WAVEFORMATEX format; - mAudioSinkFilter->GetSampleSink()->GetAudioFormat(&format); - NS_ENSURE_TRUE(format.wFormatTag == WAVE_FORMAT_PCM, NS_ERROR_FAILURE); - - mInfo.mAudio.mChannels = mNumChannels = format.nChannels; - mInfo.mAudio.mRate = mAudioRate = format.nSamplesPerSec; - mInfo.mAudio.mBitDepth = format.wBitsPerSample; - mBytesPerSample = format.wBitsPerSample / 8; - - // Begin decoding! - hr = mControl->Run(); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - - DWORD seekCaps = 0; - hr = mMediaSeeking->GetCapabilities(&seekCaps); - mInfo.mMediaSeekable = SUCCEEDED(hr) && (AM_SEEKING_CanSeekAbsolute & seekCaps); - - int64_t duration = mMP3FrameParser.GetDuration(); - if (SUCCEEDED(hr)) { - mInfo.mMetadataDuration.emplace(TimeUnit::FromMicroseconds(duration)); - } - - LOG("Successfully initialized DirectShow MP3 decoder."); - LOG("Channels=%u Hz=%u duration=%lld bytesPerSample=%d", - mInfo.mAudio.mChannels, - mInfo.mAudio.mRate, - RefTimeToUsecs(duration), - mBytesPerSample); - - *aInfo = mInfo; - // Note: The SourceFilter strips ID3v2 tags out of the stream. - *aTags = nullptr; - - return NS_OK; -} - -inline float -UnsignedByteToAudioSample(uint8_t aValue) -{ - return aValue * (2.0f / UINT8_MAX) - 1.0f; -} - -bool -DirectShowReader::Finish(HRESULT aStatus) -{ - MOZ_ASSERT(OnTaskQueue()); - - LOG("DirectShowReader::Finish(0x%x)", aStatus); - // Notify the filter graph of end of stream. - RefPtr<IMediaEventSink> eventSink; - HRESULT hr = mGraph->QueryInterface(static_cast<IMediaEventSink**>(getter_AddRefs(eventSink))); - if (SUCCEEDED(hr) && eventSink) { - eventSink->Notify(EC_COMPLETE, aStatus, 0); - } - return false; -} - -class DirectShowCopy -{ -public: - DirectShowCopy(uint8_t *aSource, uint32_t aBytesPerSample, - uint32_t aSamples, uint32_t aChannels) - : mSource(aSource) - , mBytesPerSample(aBytesPerSample) - , mSamples(aSamples) - , mChannels(aChannels) - , mNextSample(0) - { } - - uint32_t operator()(AudioDataValue *aBuffer, uint32_t aSamples) - { - uint32_t maxSamples = std::min(aSamples, mSamples - mNextSample); - uint32_t frames = maxSamples / mChannels; - size_t byteOffset = mNextSample * mBytesPerSample; - if (mBytesPerSample == 1) { - for (uint32_t i = 0; i < maxSamples; ++i) { - uint8_t *sample = mSource + byteOffset; - aBuffer[i] = UnsignedByteToAudioSample(*sample); - byteOffset += mBytesPerSample; - } - } else if (mBytesPerSample == 2) { - for (uint32_t i = 0; i < maxSamples; ++i) { - int16_t *sample = reinterpret_cast<int16_t *>(mSource + byteOffset); - aBuffer[i] = AudioSampleToFloat(*sample); - byteOffset += mBytesPerSample; - } - } - mNextSample += maxSamples; - return frames; - } - -private: - uint8_t * const mSource; - const uint32_t mBytesPerSample; - const uint32_t mSamples; - const uint32_t mChannels; - uint32_t mNextSample; -}; - -bool -DirectShowReader::DecodeAudioData() -{ - MOZ_ASSERT(OnTaskQueue()); - HRESULT hr; - - SampleSink* sink = mAudioSinkFilter->GetSampleSink(); - if (sink->AtEOS()) { - // End of stream. - return Finish(S_OK); - } - - // Get the next chunk of audio samples. This blocks until the sample - // arrives, or an error occurs (like the stream is shutdown). - RefPtr<IMediaSample> sample; - hr = sink->Extract(sample); - if (FAILED(hr) || hr == S_FALSE) { - return Finish(hr); - } - - int64_t start = 0, end = 0; - sample->GetMediaTime(&start, &end); - LOG("DirectShowReader::DecodeAudioData [%4.2lf-%4.2lf]", - RefTimeToSeconds(start), - RefTimeToSeconds(end)); - - LONG length = sample->GetActualDataLength(); - LONG numSamples = length / mBytesPerSample; - LONG numFrames = length / mBytesPerSample / mNumChannels; - - BYTE* data = nullptr; - hr = sample->GetPointer(&data); - NS_ENSURE_TRUE(SUCCEEDED(hr), Finish(hr)); - - mAudioCompactor.Push(mDecoder->GetResource()->Tell(), - RefTimeToUsecs(start), - mInfo.mAudio.mRate, - numFrames, - mNumChannels, - DirectShowCopy(reinterpret_cast<uint8_t *>(data), - mBytesPerSample, - numSamples, - mNumChannels)); - return true; -} - -bool -DirectShowReader::DecodeVideoFrame(bool &aKeyframeSkip, - int64_t aTimeThreshold) -{ - MOZ_ASSERT(OnTaskQueue()); - return false; -} - -RefPtr<MediaDecoderReader::SeekPromise> -DirectShowReader::Seek(SeekTarget aTarget, int64_t aEndTime) -{ - nsresult res = SeekInternal(aTarget.GetTime().ToMicroseconds()); - if (NS_FAILED(res)) { - return SeekPromise::CreateAndReject(res, __func__); - } else { - return SeekPromise::CreateAndResolve(aTarget.GetTime(), __func__); - } -} - -nsresult -DirectShowReader::SeekInternal(int64_t aTargetUs) -{ - HRESULT hr; - MOZ_ASSERT(OnTaskQueue()); - - LOG("DirectShowReader::Seek() target=%lld", aTargetUs); - - hr = mControl->Pause(); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - - nsresult rv = ResetDecode(); - NS_ENSURE_SUCCESS(rv, rv); - - LONGLONG seekPosition = UsecsToRefTime(aTargetUs); - hr = mMediaSeeking->SetPositions(&seekPosition, - AM_SEEKING_AbsolutePositioning, - nullptr, - AM_SEEKING_NoPositioning); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - - hr = mControl->Run(); - NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); - - return NS_OK; -} - -} // namespace mozilla diff --git a/dom/media/directshow/DirectShowReader.h b/dom/media/directshow/DirectShowReader.h deleted file mode 100644 index 881b27c28..000000000 --- a/dom/media/directshow/DirectShowReader.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#if !defined(DirectShowReader_h_) -#define DirectShowReader_h_ - -#include "windows.h" // HRESULT, DWORD -#include "MediaDecoderReader.h" -#include "MediaResource.h" -#include "mozilla/RefPtr.h" -#include "MP3FrameParser.h" - -// Add the graph to the Running Object Table so that we can connect -// to this graph with GraphEdit/GraphStudio. Note: you must -// also regsvr32 proppage.dll from the Windows SDK. -// See: http://msdn.microsoft.com/en-us/library/ms787252(VS.85).aspx -// #define DIRECTSHOW_REGISTER_GRAPH - -struct IGraphBuilder; -struct IMediaControl; -struct IMediaSeeking; - -namespace mozilla { - -class AudioSinkFilter; -class SourceFilter; - -// Decoder backend for decoding MP3 using DirectShow. DirectShow operates as -// a filter graph. The basic design of the DirectShowReader is that we have -// a SourceFilter that wraps the MediaResource that connects to the -// MP3 decoder filter. The MP3 decoder filter "pulls" data as it requires it -// downstream on its own thread. When the MP3 decoder has produced a block of -// decoded samples, its thread calls downstream into our AudioSinkFilter, -// passing the decoded buffer in. The AudioSinkFilter inserts the samples into -// a SampleSink object. The SampleSink blocks the MP3 decoder's thread until -// the decode thread calls DecodeAudioData(), whereupon the SampleSink -// releases the decoded samples to the decode thread, and unblocks the MP3 -// decoder's thread. The MP3 decoder can then request more data from the -// SourceFilter, and decode more data. If the decode thread calls -// DecodeAudioData() and there's no decoded samples waiting to be extracted -// in the SampleSink, the SampleSink blocks the decode thread until the MP3 -// decoder produces a decoded sample. -class DirectShowReader : public MediaDecoderReader -{ -public: - DirectShowReader(AbstractMediaDecoder* aDecoder); - - virtual ~DirectShowReader(); - - bool DecodeAudioData() override; - bool DecodeVideoFrame(bool &aKeyframeSkip, - int64_t aTimeThreshold) override; - - nsresult ReadMetadata(MediaInfo* aInfo, - MetadataTags** aTags) override; - - RefPtr<SeekPromise> - Seek(SeekTarget aTarget, int64_t aEndTime) override; - - static const GUID CLSID_MPEG_LAYER_3_DECODER_FILTER; - -private: - // Notifies the filter graph that playback is complete. aStatus is - // the code to send to the filter graph. Always returns false, so - // that we can just "return Finish()" from DecodeAudioData(). - bool Finish(HRESULT aStatus); - - nsresult SeekInternal(int64_t aTime); - - // DirectShow filter graph, and associated playback and seeking - // control interfaces. - RefPtr<IGraphBuilder> mGraph; - RefPtr<IMediaControl> mControl; - RefPtr<IMediaSeeking> mMediaSeeking; - - // Wraps the MediaResource, and feeds undecoded data into the filter graph. - RefPtr<SourceFilter> mSourceFilter; - - // Sits at the end of the graph, removing decoded samples from the graph. - // The graph will block while this is blocked, i.e. it will pause decoding. - RefPtr<AudioSinkFilter> mAudioSinkFilter; - - // Some MP3s are variable bitrate, so DirectShow's duration estimation - // can make its duration estimation based on the wrong bitrate. So we parse - // the MP3 frames to get a more accuate estimate of the duration. - MP3FrameParser mMP3FrameParser; - -#ifdef DIRECTSHOW_REGISTER_GRAPH - // Used to add/remove the filter graph to the Running Object Table. You can - // connect GraphEdit/GraphStudio to the graph to observe and/or debug its - // topology and state. - DWORD mRotRegister; -#endif - - // Number of channels in the audio stream. - uint32_t mNumChannels; - - // Samples per second in the audio stream. - uint32_t mAudioRate; - - // Number of bytes per sample. Can be either 1 or 2. - uint32_t mBytesPerSample; -}; - -} // namespace mozilla - -#endif diff --git a/dom/media/directshow/DirectShowUtils.cpp b/dom/media/directshow/DirectShowUtils.cpp deleted file mode 100644 index b2afa7528..000000000 --- a/dom/media/directshow/DirectShowUtils.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#include "DirectShowUtils.h" -#include "dmodshow.h" -#include "wmcodecdsp.h" -#include "dmoreg.h" -#include "mozilla/ArrayUtils.h" -#include "mozilla/RefPtr.h" -#include "nsPrintfCString.h" - -#define WARN(...) NS_WARNING(nsPrintfCString(__VA_ARGS__).get()) - -namespace mozilla { - -// Create a table which maps GUIDs to a string representation of the GUID. -// This is useful for debugging purposes, for logging the GUIDs of media types. -// This is only available when logging is enabled, i.e. not in release builds. -struct GuidToName { - const char* name; - const GUID guid; -}; - -#pragma push_macro("OUR_GUID_ENTRY") -#undef OUR_GUID_ENTRY -#define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - { #name, {l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}} }, - -static const GuidToName GuidToNameTable[] = { -#include <uuids.h> -}; - -#pragma pop_macro("OUR_GUID_ENTRY") - -const char* -GetDirectShowGuidName(const GUID& aGuid) -{ - const size_t len = ArrayLength(GuidToNameTable); - for (unsigned i = 0; i < len; i++) { - if (IsEqualGUID(aGuid, GuidToNameTable[i].guid)) { - return GuidToNameTable[i].name; - } - } - return "Unknown"; -} - -void -RemoveGraphFromRunningObjectTable(DWORD aRotRegister) -{ - RefPtr<IRunningObjectTable> runningObjectTable; - if (SUCCEEDED(GetRunningObjectTable(0, getter_AddRefs(runningObjectTable)))) { - runningObjectTable->Revoke(aRotRegister); - } -} - -HRESULT -AddGraphToRunningObjectTable(IUnknown *aUnkGraph, DWORD *aOutRotRegister) -{ - HRESULT hr; - - RefPtr<IMoniker> moniker; - RefPtr<IRunningObjectTable> runningObjectTable; - - hr = GetRunningObjectTable(0, getter_AddRefs(runningObjectTable)); - NS_ENSURE_TRUE(SUCCEEDED(hr), hr); - - const size_t STRING_LENGTH = 256; - WCHAR wsz[STRING_LENGTH]; - - StringCchPrintfW(wsz, - STRING_LENGTH, - L"FilterGraph %08x pid %08x", - (DWORD_PTR)aUnkGraph, - GetCurrentProcessId()); - - hr = CreateItemMoniker(L"!", wsz, getter_AddRefs(moniker)); - NS_ENSURE_TRUE(SUCCEEDED(hr), hr); - - hr = runningObjectTable->Register(ROTFLAGS_REGISTRATIONKEEPSALIVE, - aUnkGraph, - moniker, - aOutRotRegister); - NS_ENSURE_TRUE(SUCCEEDED(hr), hr); - - return S_OK; -} - -const char* -GetGraphNotifyString(long evCode) -{ -#define CASE(x) case x: return #x - switch(evCode) { - CASE(EC_ACTIVATE); // A video window is being activated or deactivated. - CASE(EC_BANDWIDTHCHANGE); // Not supported. - CASE(EC_BUFFERING_DATA); // The graph is buffering data, or has stopped buffering data. - CASE(EC_BUILT); // Send by the Video Control when a graph has been built. Not forwarded to applications. - CASE(EC_CLOCK_CHANGED); // The reference clock has changed. - CASE(EC_CLOCK_UNSET); // The clock provider was disconnected. - CASE(EC_CODECAPI_EVENT); // Sent by an encoder to signal an encoding event. - CASE(EC_COMPLETE); // All data from a particular stream has been rendered. - CASE(EC_CONTENTPROPERTY_CHANGED); // Not supported. - CASE(EC_DEVICE_LOST); // A Plug and Play device was removed or has become available again. - CASE(EC_DISPLAY_CHANGED); // The display mode has changed. - CASE(EC_END_OF_SEGMENT); // The end of a segment has been reached. - CASE(EC_EOS_SOON); // Not supported. - CASE(EC_ERROR_STILLPLAYING); // An asynchronous command to run the graph has failed. - CASE(EC_ERRORABORT); // An operation was aborted because of an error. - CASE(EC_ERRORABORTEX); // An operation was aborted because of an error. - CASE(EC_EXTDEVICE_MODE_CHANGE); // Not supported. - CASE(EC_FILE_CLOSED); // The source file was closed because of an unexpected event. - CASE(EC_FULLSCREEN_LOST); // The video renderer is switching out of full-screen mode. - CASE(EC_GRAPH_CHANGED); // The filter graph has changed. - CASE(EC_LENGTH_CHANGED); // The length of a source has changed. - CASE(EC_LOADSTATUS); // Notifies the application of progress when opening a network file. - CASE(EC_MARKER_HIT); // Not supported. - CASE(EC_NEED_RESTART); // A filter is requesting that the graph be restarted. - CASE(EC_NEW_PIN); // Not supported. - CASE(EC_NOTIFY_WINDOW); // Notifies a filter of the video renderer's window. - CASE(EC_OLE_EVENT); // A filter is passing a text string to the application. - CASE(EC_OPENING_FILE); // The graph is opening a file, or has finished opening a file. - CASE(EC_PALETTE_CHANGED); // The video palette has changed. - CASE(EC_PAUSED); // A pause request has completed. - CASE(EC_PLEASE_REOPEN); // The source file has changed. - CASE(EC_PREPROCESS_COMPLETE); // Sent by the WM ASF Writer filter when it completes the pre-processing for multipass encoding. - CASE(EC_PROCESSING_LATENCY); // Indicates the amount of time that a component is taking to process each sample. - CASE(EC_QUALITY_CHANGE); // The graph is dropping samples, for quality control. - //CASE(EC_RENDER_FINISHED); // Not supported. - CASE(EC_REPAINT); // A video renderer requires a repaint. - CASE(EC_SAMPLE_LATENCY); // Specifies how far behind schedule a component is for processing samples. - //CASE(EC_SAMPLE_NEEDED); // Requests a new input sample from the Enhanced Video Renderer (EVR) filter. - CASE(EC_SCRUB_TIME); // Specifies the time stamp for the most recent frame step. - CASE(EC_SEGMENT_STARTED); // A new segment has started. - CASE(EC_SHUTTING_DOWN); // The filter graph is shutting down, prior to being destroyed. - CASE(EC_SNDDEV_IN_ERROR); // A device error has occurred in an audio capture filter. - CASE(EC_SNDDEV_OUT_ERROR); // A device error has occurred in an audio renderer filter. - CASE(EC_STARVATION); // A filter is not receiving enough data. - CASE(EC_STATE_CHANGE); // The filter graph has changed state. - CASE(EC_STATUS); // Contains two arbitrary status strings. - CASE(EC_STEP_COMPLETE); // A filter performing frame stepping has stepped the specified number of frames. - CASE(EC_STREAM_CONTROL_STARTED); // A stream-control start command has taken effect. - CASE(EC_STREAM_CONTROL_STOPPED); // A stream-control stop command has taken effect. - CASE(EC_STREAM_ERROR_STILLPLAYING); // An error has occurred in a stream. The stream is still playing. - CASE(EC_STREAM_ERROR_STOPPED); // A stream has stopped because of an error. - CASE(EC_TIMECODE_AVAILABLE); // Not supported. - CASE(EC_UNBUILT); // Send by the Video Control when a graph has been torn down. Not forwarded to applications. - CASE(EC_USERABORT); // The user has terminated playback. - CASE(EC_VIDEO_SIZE_CHANGED); // The native video size has changed. - CASE(EC_VIDEOFRAMEREADY); // A video frame is ready for display. - CASE(EC_VMR_RECONNECTION_FAILED); // Sent by the VMR-7 and the VMR-9 when it was unable to accept a dynamic format change request from the upstream decoder. - CASE(EC_VMR_RENDERDEVICE_SET); // Sent when the VMR has selected its rendering mechanism. - CASE(EC_VMR_SURFACE_FLIPPED); // Sent when the VMR-7's allocator presenter has called the DirectDraw Flip method on the surface being presented. - CASE(EC_WINDOW_DESTROYED); // The video renderer was destroyed or removed from the graph. - CASE(EC_WMT_EVENT); // Sent by the WM ASF Reader filter when it reads ASF files protected by digital rights management (DRM). - CASE(EC_WMT_INDEX_EVENT); // Sent when an application uses the WM ASF Writer to index Windows Media Video files. - CASE(S_OK); // Success. - CASE(VFW_S_AUDIO_NOT_RENDERED); // Partial success; the audio was not rendered. - CASE(VFW_S_DUPLICATE_NAME); // Success; the Filter Graph Manager modified a filter name to avoid duplication. - CASE(VFW_S_PARTIAL_RENDER); // Partial success; some of the streams in this movie are in an unsupported format. - CASE(VFW_S_VIDEO_NOT_RENDERED); // Partial success; the video was not rendered. - CASE(E_ABORT); // Operation aborted. - CASE(E_OUTOFMEMORY); // Insufficient memory. - CASE(E_POINTER); // Null pointer argument. - CASE(VFW_E_CANNOT_CONNECT); // No combination of intermediate filters could be found to make the connection. - CASE(VFW_E_CANNOT_RENDER); // No combination of filters could be found to render the stream. - CASE(VFW_E_NO_ACCEPTABLE_TYPES); // There is no common media type between these pins. - CASE(VFW_E_NOT_IN_GRAPH); - - default: - return "Unknown Code"; - }; -#undef CASE -} - -HRESULT -CreateAndAddFilter(IGraphBuilder* aGraph, - REFGUID aFilterClsId, - LPCWSTR aFilterName, - IBaseFilter **aOutFilter) -{ - NS_ENSURE_TRUE(aGraph, E_POINTER); - NS_ENSURE_TRUE(aOutFilter, E_POINTER); - HRESULT hr; - - RefPtr<IBaseFilter> filter; - hr = CoCreateInstance(aFilterClsId, - nullptr, - CLSCTX_INPROC_SERVER, - IID_IBaseFilter, - getter_AddRefs(filter)); - if (FAILED(hr)) { - // Object probably not available on this system. - WARN("CoCreateInstance failed, hr=%x", hr); - return hr; - } - - hr = aGraph->AddFilter(filter, aFilterName); - if (FAILED(hr)) { - WARN("AddFilter failed, hr=%x", hr); - return hr; - } - - filter.forget(aOutFilter); - - return S_OK; -} - -HRESULT -CreateMP3DMOWrapperFilter(IBaseFilter **aOutFilter) -{ - NS_ENSURE_TRUE(aOutFilter, E_POINTER); - HRESULT hr; - - // Create the wrapper filter. - RefPtr<IBaseFilter> filter; - hr = CoCreateInstance(CLSID_DMOWrapperFilter, - nullptr, - CLSCTX_INPROC_SERVER, - IID_IBaseFilter, - getter_AddRefs(filter)); - if (FAILED(hr)) { - WARN("CoCreateInstance failed, hr=%x", hr); - return hr; - } - - // Query for IDMOWrapperFilter. - RefPtr<IDMOWrapperFilter> dmoWrapper; - hr = filter->QueryInterface(IID_IDMOWrapperFilter, - getter_AddRefs(dmoWrapper)); - if (FAILED(hr)) { - WARN("QueryInterface failed, hr=%x", hr); - return hr; - } - - hr = dmoWrapper->Init(CLSID_CMP3DecMediaObject, DMOCATEGORY_AUDIO_DECODER); - if (FAILED(hr)) { - // Can't instantiate MP3 DMO. It doesn't exist on Windows XP, we're - // probably hitting that. Don't log warning to console, this is an - // expected error. - WARN("dmoWrapper Init failed, hr=%x", hr); - return hr; - } - - filter.forget(aOutFilter); - - return S_OK; -} - -HRESULT -AddMP3DMOWrapperFilter(IGraphBuilder* aGraph, - IBaseFilter **aOutFilter) -{ - NS_ENSURE_TRUE(aGraph, E_POINTER); - NS_ENSURE_TRUE(aOutFilter, E_POINTER); - HRESULT hr; - - // Create the wrapper filter. - RefPtr<IBaseFilter> filter; - hr = CreateMP3DMOWrapperFilter(getter_AddRefs(filter)); - NS_ENSURE_TRUE(SUCCEEDED(hr), hr); - - // Add the wrapper filter to graph. - hr = aGraph->AddFilter(filter, L"MP3 Decoder DMO"); - if (FAILED(hr)) { - WARN("AddFilter failed, hr=%x", hr); - return hr; - } - - filter.forget(aOutFilter); - - return S_OK; -} - -bool -CanDecodeMP3UsingDirectShow() -{ - RefPtr<IBaseFilter> filter; - - // Can we create the MP3 demuxer filter? - if (FAILED(CoCreateInstance(CLSID_MPEG1Splitter, - nullptr, - CLSCTX_INPROC_SERVER, - IID_IBaseFilter, - getter_AddRefs(filter)))) { - return false; - } - - // Can we create either the WinXP MP3 decoder filter or the MP3 DMO decoder? - if (FAILED(CoCreateInstance(DirectShowReader::CLSID_MPEG_LAYER_3_DECODER_FILTER, - nullptr, - CLSCTX_INPROC_SERVER, - IID_IBaseFilter, - getter_AddRefs(filter))) && - FAILED(CreateMP3DMOWrapperFilter(getter_AddRefs(filter)))) { - return false; - } - - // Else, we can create all of the components we need. Assume - // DirectShow is going to work... - return true; -} - -// Match a pin by pin direction and connection state. -HRESULT -MatchUnconnectedPin(IPin* aPin, - PIN_DIRECTION aPinDir, - bool *aOutMatches) -{ - NS_ENSURE_TRUE(aPin, E_POINTER); - NS_ENSURE_TRUE(aOutMatches, E_POINTER); - - // Ensure the pin is unconnected. - RefPtr<IPin> peer; - HRESULT hr = aPin->ConnectedTo(getter_AddRefs(peer)); - if (hr != VFW_E_NOT_CONNECTED) { - *aOutMatches = false; - return hr; - } - - // Ensure the pin is of the specified direction. - PIN_DIRECTION pinDir; - hr = aPin->QueryDirection(&pinDir); - NS_ENSURE_TRUE(SUCCEEDED(hr), hr); - - *aOutMatches = (pinDir == aPinDir); - return S_OK; -} - -// Return the first unconnected input pin or output pin. -already_AddRefed<IPin> -GetUnconnectedPin(IBaseFilter* aFilter, PIN_DIRECTION aPinDir) -{ - RefPtr<IEnumPins> enumPins; - - HRESULT hr = aFilter->EnumPins(getter_AddRefs(enumPins)); - NS_ENSURE_TRUE(SUCCEEDED(hr), nullptr); - - // Test each pin to see if it matches the direction we're looking for. - RefPtr<IPin> pin; - while (S_OK == enumPins->Next(1, getter_AddRefs(pin), nullptr)) { - bool matches = FALSE; - if (SUCCEEDED(MatchUnconnectedPin(pin, aPinDir, &matches)) && - matches) { - return pin.forget(); - } - } - - return nullptr; -} - -HRESULT -ConnectFilters(IGraphBuilder* aGraph, - IBaseFilter* aOutputFilter, - IBaseFilter* aInputFilter) -{ - RefPtr<IPin> output = GetUnconnectedPin(aOutputFilter, PINDIR_OUTPUT); - NS_ENSURE_TRUE(output, E_FAIL); - - RefPtr<IPin> input = GetUnconnectedPin(aInputFilter, PINDIR_INPUT); - NS_ENSURE_TRUE(output, E_FAIL); - - return aGraph->Connect(output, input); -} - -} // namespace mozilla - -// avoid redefined macro in unified build -#undef WARN diff --git a/dom/media/directshow/DirectShowUtils.h b/dom/media/directshow/DirectShowUtils.h deleted file mode 100644 index 3bbc122fc..000000000 --- a/dom/media/directshow/DirectShowUtils.h +++ /dev/null @@ -1,125 +0,0 @@ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#ifndef _DirectShowUtils_h_ -#define _DirectShowUtils_h_ - -#include <stdint.h> -#include "dshow.h" - -// XXXbz windowsx.h defines GetFirstChild, GetNextSibling, -// GetPrevSibling are macros, apparently... Eeevil. We have functions -// called that on some classes, so undef them. -#undef GetFirstChild -#undef GetNextSibling -#undef GetPrevSibling - -#include "DShowTools.h" -#include "mozilla/Logging.h" - -namespace mozilla { - -// Win32 "Event" wrapper. Must be paired with a CriticalSection to create a -// Java-style "monitor". -class Signal { -public: - - Signal(CriticalSection* aLock) - : mLock(aLock) - { - CriticalSectionAutoEnter lock(*mLock); - mEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr); - } - - ~Signal() { - CriticalSectionAutoEnter lock(*mLock); - CloseHandle(mEvent); - } - - // Lock must be held. - void Notify() { - SetEvent(mEvent); - } - - // Lock must be held. Check the wait condition before waiting! - HRESULT Wait() { - mLock->Leave(); - DWORD result = WaitForSingleObject(mEvent, INFINITE); - mLock->Enter(); - return result == WAIT_OBJECT_0 ? S_OK : E_FAIL; - } - -private: - CriticalSection* mLock; - HANDLE mEvent; -}; - -HRESULT -AddGraphToRunningObjectTable(IUnknown *aUnkGraph, DWORD *aOutRotRegister); - -void -RemoveGraphFromRunningObjectTable(DWORD aRotRegister); - -const char* -GetGraphNotifyString(long evCode); - -// Creates a filter and adds it to a graph. -HRESULT -CreateAndAddFilter(IGraphBuilder* aGraph, - REFGUID aFilterClsId, - LPCWSTR aFilterName, - IBaseFilter **aOutFilter); - -HRESULT -AddMP3DMOWrapperFilter(IGraphBuilder* aGraph, - IBaseFilter **aOutFilter); - -// Connects the output pin on aOutputFilter to an input pin on -// aInputFilter, in aGraph. -HRESULT -ConnectFilters(IGraphBuilder* aGraph, - IBaseFilter* aOutputFilter, - IBaseFilter* aInputFilter); - -HRESULT -MatchUnconnectedPin(IPin* aPin, - PIN_DIRECTION aPinDir, - bool *aOutMatches); - -// Converts from microseconds to DirectShow "Reference Time" -// (hundreds of nanoseconds). -inline int64_t -UsecsToRefTime(const int64_t aUsecs) -{ - return aUsecs * 10; -} - -// Converts from DirectShow "Reference Time" (hundreds of nanoseconds) -// to microseconds. -inline int64_t -RefTimeToUsecs(const int64_t hRefTime) -{ - return hRefTime / 10; -} - -// Converts from DirectShow "Reference Time" (hundreds of nanoseconds) -// to seconds. -inline double -RefTimeToSeconds(const REFERENCE_TIME aRefTime) -{ - return double(aRefTime) / 10000000; -} - -const char* -GetDirectShowGuidName(const GUID& aGuid); - -// Returns true if we can instantiate an MP3 demuxer and decoder filters. -// Use this to detect whether MP3 support is installed. -bool -CanDecodeMP3UsingDirectShow(); - -} // namespace mozilla - -#endif diff --git a/dom/media/directshow/SampleSink.cpp b/dom/media/directshow/SampleSink.cpp deleted file mode 100644 index fa5dc8d19..000000000 --- a/dom/media/directshow/SampleSink.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#include "SampleSink.h" -#include "AudioSinkFilter.h" -#include "AudioSinkInputPin.h" -#include "VideoUtils.h" -#include "mozilla/Logging.h" - -using namespace mozilla::media; - -namespace mozilla { - -static LazyLogModule gDirectShowLog("DirectShowDecoder"); -#define LOG(...) MOZ_LOG(gDirectShowLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) - -SampleSink::SampleSink() - : mMonitor("SampleSink"), - mIsFlushing(false), - mAtEOS(false) -{ - MOZ_COUNT_CTOR(SampleSink); -} - -SampleSink::~SampleSink() -{ - MOZ_COUNT_DTOR(SampleSink); -} - -void -SampleSink::SetAudioFormat(const WAVEFORMATEX* aInFormat) -{ - NS_ENSURE_TRUE(aInFormat, ); - ReentrantMonitorAutoEnter mon(mMonitor); - memcpy(&mAudioFormat, aInFormat, sizeof(WAVEFORMATEX)); -} - -void -SampleSink::GetAudioFormat(WAVEFORMATEX* aOutFormat) -{ - MOZ_ASSERT(aOutFormat); - ReentrantMonitorAutoEnter mon(mMonitor); - memcpy(aOutFormat, &mAudioFormat, sizeof(WAVEFORMATEX)); -} - -HRESULT -SampleSink::Receive(IMediaSample* aSample) -{ - ReentrantMonitorAutoEnter mon(mMonitor); - - while (true) { - if (mIsFlushing) { - return S_FALSE; - } - if (!mSample) { - break; - } - if (mAtEOS) { - return E_UNEXPECTED; - } - // Wait until the consumer thread consumes the sample. - mon.Wait(); - } - - if (MOZ_LOG_TEST(gDirectShowLog, LogLevel::Debug)) { - REFERENCE_TIME start = 0, end = 0; - HRESULT hr = aSample->GetMediaTime(&start, &end); - LOG("SampleSink::Receive() [%4.2lf-%4.2lf]", - (double)RefTimeToUsecs(start) / USECS_PER_S, - (double)RefTimeToUsecs(end) / USECS_PER_S); - } - - mSample = aSample; - // Notify the signal, to awaken the consumer thread in WaitForSample() - // if necessary. - mon.NotifyAll(); - return S_OK; -} - -HRESULT -SampleSink::Extract(RefPtr<IMediaSample>& aOutSample) -{ - ReentrantMonitorAutoEnter mon(mMonitor); - // Loop until we have a sample, or we should abort. - while (true) { - if (mIsFlushing) { - return S_FALSE; - } - if (mSample) { - break; - } - if (mAtEOS) { - // Order is important here, if we have a sample, we should return it - // before reporting EOS. - return E_UNEXPECTED; - } - // Wait until the producer thread gives us a sample. - mon.Wait(); - } - aOutSample = mSample; - - if (MOZ_LOG_TEST(gDirectShowLog, LogLevel::Debug)) { - int64_t start = 0, end = 0; - mSample->GetMediaTime(&start, &end); - LOG("SampleSink::Extract() [%4.2lf-%4.2lf]", - (double)RefTimeToUsecs(start) / USECS_PER_S, - (double)RefTimeToUsecs(end) / USECS_PER_S); - } - - mSample = nullptr; - // Notify the signal, to awaken the producer thread in Receive() - // if necessary. - mon.NotifyAll(); - return S_OK; -} - -void -SampleSink::Flush() -{ - LOG("SampleSink::Flush()"); - ReentrantMonitorAutoEnter mon(mMonitor); - mIsFlushing = true; - mSample = nullptr; - mon.NotifyAll(); -} - -void -SampleSink::Reset() -{ - LOG("SampleSink::Reset()"); - ReentrantMonitorAutoEnter mon(mMonitor); - mIsFlushing = false; - mAtEOS = false; -} - -void -SampleSink::SetEOS() -{ - LOG("SampleSink::SetEOS()"); - ReentrantMonitorAutoEnter mon(mMonitor); - mAtEOS = true; - // Notify to unblock any threads waiting for samples in - // Extract() or Receive(). Now that we're at EOS, no more samples - // will come! - mon.NotifyAll(); -} - -bool -SampleSink::AtEOS() -{ - ReentrantMonitorAutoEnter mon(mMonitor); - return mAtEOS && !mSample; -} - -} // namespace mozilla - diff --git a/dom/media/directshow/SampleSink.h b/dom/media/directshow/SampleSink.h deleted file mode 100644 index 6a1af9fee..000000000 --- a/dom/media/directshow/SampleSink.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#if !defined(SampleSink_h_) -#define SampleSink_h_ - -#include "BaseFilter.h" -#include "DirectShowUtils.h" -#include "mozilla/RefPtr.h" -#include "mozilla/ReentrantMonitor.h" - -namespace mozilla { - -class SampleSink { -public: - SampleSink(); - virtual ~SampleSink(); - - // Sets the audio format of the incoming samples. The upstream filter - // calls this. This makes a copy. - void SetAudioFormat(const WAVEFORMATEX* aInFormat); - - // Copies the format of incoming audio samples into into *aOutFormat. - void GetAudioFormat(WAVEFORMATEX* aOutFormat); - - // Called when a sample is delivered by the DirectShow graph to the sink. - // The decode thread retrieves the sample by calling WaitForSample(). - // Blocks if there's already a sample waiting to be consumed by the decode - // thread. - HRESULT Receive(IMediaSample* aSample); - - // Retrieves a sample from the sample queue, blocking until one becomes - // available, or until an error occurs. Returns S_FALSE on EOS. - HRESULT Extract(RefPtr<IMediaSample>& aOutSample); - - // Unblocks any threads waiting in GetSample(). - // Clears mSample, which unblocks upstream stream. - void Flush(); - - // Opens up the sink to receive more samples in PutSample(). - // Clears EOS flag. - void Reset(); - - // Marks that we've reacehd the end of stream. - void SetEOS(); - - // Returns whether we're at end of stream. - bool AtEOS(); - -private: - // All data in this class is syncronized by mMonitor. - ReentrantMonitor mMonitor; - RefPtr<IMediaSample> mSample; - - // Format of the audio stream we're receiving. - WAVEFORMATEX mAudioFormat; - - bool mIsFlushing; - bool mAtEOS; -}; - -} // namespace mozilla - -#endif // SampleSink_h_ diff --git a/dom/media/directshow/SourceFilter.cpp b/dom/media/directshow/SourceFilter.cpp deleted file mode 100644 index 4c5a0882c..000000000 --- a/dom/media/directshow/SourceFilter.cpp +++ /dev/null @@ -1,683 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#include "SourceFilter.h" -#include "MediaResource.h" -#include "mozilla/RefPtr.h" -#include "DirectShowUtils.h" -#include "MP3FrameParser.h" -#include "mozilla/Logging.h" -#include <algorithm> - -using namespace mozilla::media; - -namespace mozilla { - -// Define to trace what's on... -//#define DEBUG_SOURCE_TRACE 1 - -#if defined (DEBUG_SOURCE_TRACE) -static LazyLogModule gDirectShowLog("DirectShowDecoder"); -#define DIRECTSHOW_LOG(...) MOZ_LOG(gDirectShowLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) -#else -#define DIRECTSHOW_LOG(...) -#endif - -static HRESULT -DoGetInterface(IUnknown* aUnknown, void** aInterface) -{ - if (!aInterface) - return E_POINTER; - *aInterface = aUnknown; - aUnknown->AddRef(); - return S_OK; -} - -// Stores details of IAsyncReader::Request(). -class ReadRequest { -public: - - ReadRequest(IMediaSample* aSample, - DWORD_PTR aDwUser, - uint32_t aOffset, - uint32_t aCount) - : mSample(aSample), - mDwUser(aDwUser), - mOffset(aOffset), - mCount(aCount) - { - MOZ_COUNT_CTOR(ReadRequest); - } - - ~ReadRequest() { - MOZ_COUNT_DTOR(ReadRequest); - } - - RefPtr<IMediaSample> mSample; - DWORD_PTR mDwUser; - uint32_t mOffset; - uint32_t mCount; -}; - -// A wrapper around media resource that presents only a partition of the -// underlying resource to the caller to use. The partition returned is from -// an offset to the end of stream, and this object deals with ensuring -// the offsets and lengths etc are translated from the reduced partition -// exposed to the caller, to the absolute offsets of the underlying stream. -class MediaResourcePartition { -public: - MediaResourcePartition(MediaResource* aResource, - int64_t aDataStart) - : mResource(aResource), - mDataOffset(aDataStart) - {} - - int64_t GetLength() { - int64_t len = mResource.GetLength(); - if (len == -1) { - return len; - } - return std::max<int64_t>(0, len - mDataOffset); - } - nsresult ReadAt(int64_t aOffset, char* aBuffer, - uint32_t aCount, uint32_t* aBytes) - { - return mResource.ReadAt(aOffset + mDataOffset, - aBuffer, - aCount, - aBytes); - } - int64_t GetCachedDataEnd() { - int64_t tell = mResource.GetResource()->Tell(); - int64_t dataEnd = - mResource.GetResource()->GetCachedDataEnd(tell) - mDataOffset; - return dataEnd; - } -private: - // MediaResource from which we read data. - MediaResourceIndex mResource; - int64_t mDataOffset; -}; - - -// Output pin for SourceFilter, which implements IAsyncReader, to -// allow downstream filters to pull/read data from it. Downstream pins -// register to read data using Request(), and asynchronously wait for the -// reads to complete using WaitForNext(). They may also synchronously read -// using SyncRead(). This class is a delegate (tear off) of -// SourceFilter. -// -// We can expose only a segment of the MediaResource to the filter graph. -// This is used to strip off the ID3v2 tags from the stream, as DirectShow -// has trouble parsing some headers. -// -// Implements: -// * IAsyncReader -// * IPin -// * IQualityControl -// * IUnknown -// -class DECLSPEC_UUID("18e5cfb2-1015-440c-a65c-e63853235894") -OutputPin : public IAsyncReader, - public BasePin -{ -public: - - OutputPin(MediaResource* aMediaResource, - SourceFilter* aParent, - CriticalSection& aFilterLock, - int64_t aMP3DataStart); - virtual ~OutputPin(); - - // IUnknown - // Defer to ref counting to BasePin, which defers to owning nsBaseFilter. - STDMETHODIMP_(ULONG) AddRef() override { return BasePin::AddRef(); } - STDMETHODIMP_(ULONG) Release() override { return BasePin::Release(); } - STDMETHODIMP QueryInterface(REFIID iid, void** ppv) override; - - // BasePin Overrides. - // Determines if the pin accepts a specific media type. - HRESULT CheckMediaType(const MediaType* aMediaType) override; - - // Retrieves a preferred media type, by index value. - HRESULT GetMediaType(int aPosition, MediaType* aMediaType) override; - - // Releases the pin from a connection. - HRESULT BreakConnect(void) override; - - // Determines whether a pin connection is suitable. - HRESULT CheckConnect(IPin* aPin) override; - - - // IAsyncReader overrides - - // The RequestAllocator method requests an allocator during the - // pin connection. - STDMETHODIMP RequestAllocator(IMemAllocator* aPreferred, - ALLOCATOR_PROPERTIES* aProps, - IMemAllocator** aActual) override; - - // The Request method queues an asynchronous request for data. Downstream - // will call WaitForNext() when they want to retrieve the result. - STDMETHODIMP Request(IMediaSample* aSample, DWORD_PTR aUserData) override; - - // The WaitForNext method waits for the next pending read request - // to complete. This method fails if the graph is flushing. - // Defers to SyncRead/5. - STDMETHODIMP WaitForNext(DWORD aTimeout, - IMediaSample** aSamples, - DWORD_PTR* aUserData) override; - - // The SyncReadAligned method performs a synchronous read. The method - // blocks until the request is completed. Defers to SyncRead/5. This - // method does not fail if the graph is flushing. - STDMETHODIMP SyncReadAligned(IMediaSample* aSample) override; - - // The SyncRead method performs a synchronous read. The method blocks - // until the request is completed. Defers to SyncRead/5. This - // method does not fail if the graph is flushing. - STDMETHODIMP SyncRead(LONGLONG aPosition, LONG aLength, BYTE* aBuffer) override; - - // The Length method retrieves the total length of the stream. - STDMETHODIMP Length(LONGLONG* aTotal, LONGLONG* aAvailable) override; - - // IPin Overrides - STDMETHODIMP BeginFlush(void) override; - STDMETHODIMP EndFlush(void) override; - - uint32_t GetAndResetBytesConsumedCount(); - -private: - - // Protects thread-shared data/structures (mFlushCount, mPendingReads). - // WaitForNext() also waits on this monitor - CriticalSection& mPinLock; - - // Signal used with mPinLock to implement WaitForNext(). - Signal mSignal; - - // The filter that owns us. Weak reference, as we're a delegate (tear off). - SourceFilter* mParentSource; - - MediaResourcePartition mResource; - - // Counter, inc'd in BeginFlush(), dec'd in EndFlush(). Calls to this can - // come from multiple threads and can interleave, hence the counter. - int32_t mFlushCount; - - // Number of bytes that have been read from the output pin since the last - // time GetAndResetBytesConsumedCount() was called. - uint32_t mBytesConsumed; - - // Deque of ReadRequest* for reads that are yet to be serviced. - // nsReadRequest's are stored on the heap, popper must delete them. - nsDeque mPendingReads; - - // Flags if the downstream pin has QI'd for IAsyncReader. We refuse - // connection if they don't query, as it means they're assuming that we're - // a push filter, and we're not. - bool mQueriedForAsyncReader; - -}; - -// For mingw __uuidof support -#ifdef __CRT_UUID_DECL -} -__CRT_UUID_DECL(mozilla::OutputPin, 0x18e5cfb2,0x1015,0x440c,0xa6,0x5c,0xe6,0x38,0x53,0x23,0x58,0x94); -namespace mozilla { -#endif - -OutputPin::OutputPin(MediaResource* aResource, - SourceFilter* aParent, - CriticalSection& aFilterLock, - int64_t aMP3DataStart) - : BasePin(static_cast<BaseFilter*>(aParent), - &aFilterLock, - L"MozillaOutputPin", - PINDIR_OUTPUT), - mPinLock(aFilterLock), - mSignal(&mPinLock), - mParentSource(aParent), - mResource(aResource, aMP3DataStart), - mFlushCount(0), - mBytesConsumed(0), - mQueriedForAsyncReader(false) -{ - MOZ_COUNT_CTOR(OutputPin); - DIRECTSHOW_LOG("OutputPin::OutputPin()"); -} - -OutputPin::~OutputPin() -{ - MOZ_COUNT_DTOR(OutputPin); - DIRECTSHOW_LOG("OutputPin::~OutputPin()"); -} - -HRESULT -OutputPin::BreakConnect() -{ - mQueriedForAsyncReader = false; - return BasePin::BreakConnect(); -} - -STDMETHODIMP -OutputPin::QueryInterface(REFIID aIId, void** aInterface) -{ - if (aIId == IID_IAsyncReader) { - mQueriedForAsyncReader = true; - return DoGetInterface(static_cast<IAsyncReader*>(this), aInterface); - } - - if (aIId == __uuidof(OutputPin)) { - AddRef(); - *aInterface = this; - return S_OK; - } - - return BasePin::QueryInterface(aIId, aInterface); -} - -HRESULT -OutputPin::CheckConnect(IPin* aPin) -{ - // Our connection is only suitable if the downstream pin knows - // that we're asynchronous (i.e. it queried for IAsyncReader). - return mQueriedForAsyncReader ? S_OK : S_FALSE; -} - -HRESULT -OutputPin::CheckMediaType(const MediaType* aMediaType) -{ - const MediaType *myMediaType = mParentSource->GetMediaType(); - - if (IsEqualGUID(aMediaType->majortype, myMediaType->majortype) && - IsEqualGUID(aMediaType->subtype, myMediaType->subtype) && - IsEqualGUID(aMediaType->formattype, myMediaType->formattype)) - { - DIRECTSHOW_LOG("OutputPin::CheckMediaType() Match: major=%s minor=%s TC=%d FSS=%d SS=%u", - GetDirectShowGuidName(aMediaType->majortype), - GetDirectShowGuidName(aMediaType->subtype), - aMediaType->TemporalCompression(), - aMediaType->bFixedSizeSamples, - aMediaType->SampleSize()); - return S_OK; - } - - DIRECTSHOW_LOG("OutputPin::CheckMediaType() Failed to match: major=%s minor=%s TC=%d FSS=%d SS=%u", - GetDirectShowGuidName(aMediaType->majortype), - GetDirectShowGuidName(aMediaType->subtype), - aMediaType->TemporalCompression(), - aMediaType->bFixedSizeSamples, - aMediaType->SampleSize()); - return S_FALSE; -} - -HRESULT -OutputPin::GetMediaType(int aPosition, MediaType* aMediaType) -{ - if (!aMediaType) - return E_POINTER; - - if (aPosition == 0) { - aMediaType->Assign(mParentSource->GetMediaType()); - return S_OK; - } - return VFW_S_NO_MORE_ITEMS; -} - -static inline bool -IsPowerOf2(int32_t x) { - return ((-x & x) != x); -} - -STDMETHODIMP -OutputPin::RequestAllocator(IMemAllocator* aPreferred, - ALLOCATOR_PROPERTIES* aProps, - IMemAllocator** aActual) -{ - // Require the downstream pin to suggest what they want... - if (!aPreferred) return E_POINTER; - if (!aProps) return E_POINTER; - if (!aActual) return E_POINTER; - - // We only care about alignment - our allocator will reject anything - // which isn't power-of-2 aligned, so so try a 4-byte aligned allocator. - ALLOCATOR_PROPERTIES props; - memcpy(&props, aProps, sizeof(ALLOCATOR_PROPERTIES)); - if (aProps->cbAlign == 0 || IsPowerOf2(aProps->cbAlign)) { - props.cbAlign = 4; - } - - // Limit allocator's number of buffers. We know that the media will most - // likely be bound by network speed, not by decoding speed. We also - // store the incoming data in a Gecko stream, if we don't limit buffers - // here we'll end up duplicating a lot of storage. We must have enough - // space for audio key frames to fit in the first batch of buffers however, - // else pausing may fail for some downstream decoders. - if (props.cBuffers > BaseFilter::sMaxNumBuffers) { - props.cBuffers = BaseFilter::sMaxNumBuffers; - } - - // The allocator properties that are actually used. We don't store - // this, we need it for SetProperties() below to succeed. - ALLOCATOR_PROPERTIES actualProps; - HRESULT hr; - - if (aPreferred) { - // Play nice and prefer the downstream pin's preferred allocator. - hr = aPreferred->SetProperties(&props, &actualProps); - if (SUCCEEDED(hr)) { - aPreferred->AddRef(); - *aActual = aPreferred; - return S_OK; - } - } - - // Else downstream hasn't requested a specific allocator, so create one... - - // Just create a default allocator. It's highly unlikely that we'll use - // this anyway, as most parsers insist on using their own allocators. - RefPtr<IMemAllocator> allocator; - hr = CoCreateInstance(CLSID_MemoryAllocator, - 0, - CLSCTX_INPROC_SERVER, - IID_IMemAllocator, - getter_AddRefs(allocator)); - if(FAILED(hr) || (allocator == nullptr)) { - NS_WARNING("Can't create our own DirectShow allocator."); - return hr; - } - - // See if we can make it suitable - hr = allocator->SetProperties(&props, &actualProps); - if (SUCCEEDED(hr)) { - // We need to release our refcount on pAlloc, and addref - // it to pass a refcount to the caller - this is a net nothing. - allocator.forget(aActual); - return S_OK; - } - - NS_WARNING("Failed to pick an allocator"); - return hr; -} - -STDMETHODIMP -OutputPin::Request(IMediaSample* aSample, DWORD_PTR aDwUser) -{ - if (!aSample) return E_FAIL; - - CriticalSectionAutoEnter lock(*mLock); - NS_ASSERTION(!mFlushCount, "Request() while flushing"); - - if (mFlushCount) - return VFW_E_WRONG_STATE; - - REFERENCE_TIME refStart = 0, refEnd = 0; - if (FAILED(aSample->GetTime(&refStart, &refEnd))) { - NS_WARNING("Sample incorrectly timestamped"); - return VFW_E_SAMPLE_TIME_NOT_SET; - } - - // Convert reference time to bytes. - uint32_t start = (uint32_t)(refStart / 10000000); - uint32_t end = (uint32_t)(refEnd / 10000000); - - uint32_t numBytes = end - start; - - ReadRequest* request = new ReadRequest(aSample, - aDwUser, - start, - numBytes); - // Memory for |request| is free when it's popped from the completed - // reads list. - - // Push this onto the queue of reads to be serviced. - mPendingReads.Push(request); - - // Notify any threads blocked in WaitForNext() which are waiting for mPendingReads - // to become non-empty. - mSignal.Notify(); - - return S_OK; -} - -STDMETHODIMP -OutputPin::WaitForNext(DWORD aTimeout, - IMediaSample** aOutSample, - DWORD_PTR* aOutDwUser) -{ - NS_ASSERTION(aTimeout == 0 || aTimeout == INFINITE, - "Oops, we don't handle this!"); - - *aOutSample = nullptr; - *aOutDwUser = 0; - - LONGLONG offset = 0; - LONG count = 0; - BYTE* buf = nullptr; - - { - CriticalSectionAutoEnter lock(*mLock); - - // Wait until there's a pending read to service. - while (aTimeout && mPendingReads.GetSize() == 0 && !mFlushCount) { - // Note: No need to guard against shutdown-during-wait here, as - // typically the thread doing the pull will have already called - // Request(), so we won't Wait() here anyway. SyncRead() will fail - // on shutdown. - mSignal.Wait(); - } - - nsAutoPtr<ReadRequest> request(reinterpret_cast<ReadRequest*>(mPendingReads.PopFront())); - if (!request) - return VFW_E_WRONG_STATE; - - *aOutSample = request->mSample; - *aOutDwUser = request->mDwUser; - - offset = request->mOffset; - count = request->mCount; - buf = nullptr; - request->mSample->GetPointer(&buf); - NS_ASSERTION(buf != nullptr, "Invalid buffer!"); - - if (mFlushCount) { - return VFW_E_TIMEOUT; - } - } - - return SyncRead(offset, count, buf); -} - -STDMETHODIMP -OutputPin::SyncReadAligned(IMediaSample* aSample) -{ - { - // Ignore reads while flushing. - CriticalSectionAutoEnter lock(*mLock); - if (mFlushCount) { - return S_FALSE; - } - } - - if (!aSample) - return E_FAIL; - - REFERENCE_TIME lStart = 0, lEnd = 0; - if (FAILED(aSample->GetTime(&lStart, &lEnd))) { - NS_WARNING("Sample incorrectly timestamped"); - return VFW_E_SAMPLE_TIME_NOT_SET; - } - - // Convert reference time to bytes. - int32_t start = (int32_t)(lStart / 10000000); - int32_t end = (int32_t)(lEnd / 10000000); - - int32_t numBytes = end - start; - - // If the range extends off the end of stream, truncate to the end of stream - // as per IAsyncReader specificiation. - int64_t streamLength = mResource.GetLength(); - if (streamLength != -1) { - // We know the exact length of the stream, fail if the requested offset - // is beyond it. - if (start > streamLength) { - return VFW_E_BADALIGN; - } - - // If the end of the chunk to read is off the end of the stream, - // truncate it to the end of the stream. - if ((start + numBytes) > streamLength) { - numBytes = (uint32_t)(streamLength - start); - } - } - - BYTE* buf=0; - aSample->GetPointer(&buf); - - return SyncRead(start, numBytes, buf); -} - -STDMETHODIMP -OutputPin::SyncRead(LONGLONG aPosition, - LONG aLength, - BYTE* aBuffer) -{ - MOZ_ASSERT(!NS_IsMainThread()); - NS_ENSURE_TRUE(aPosition >= 0, E_FAIL); - NS_ENSURE_TRUE(aLength > 0, E_FAIL); - NS_ENSURE_TRUE(aBuffer, E_POINTER); - - DIRECTSHOW_LOG("OutputPin::SyncRead(%lld, %d)", aPosition, aLength); - { - // Ignore reads while flushing. - CriticalSectionAutoEnter lock(*mLock); - if (mFlushCount) { - return S_FALSE; - } - } - - uint32_t totalBytesRead = 0; - nsresult rv = mResource.ReadAt(aPosition, - reinterpret_cast<char*>(aBuffer), - aLength, - &totalBytesRead); - if (NS_FAILED(rv)) { - return E_FAIL; - } - if (totalBytesRead > 0) { - CriticalSectionAutoEnter lock(*mLock); - mBytesConsumed += totalBytesRead; - } - return (totalBytesRead == aLength) ? S_OK : S_FALSE; -} - -STDMETHODIMP -OutputPin::Length(LONGLONG* aTotal, LONGLONG* aAvailable) -{ - HRESULT hr = S_OK; - int64_t length = mResource.GetLength(); - if (length == -1) { - hr = VFW_S_ESTIMATED; - // Don't have a length. Just lie, it seems to work... - *aTotal = INT32_MAX; - } else { - *aTotal = length; - } - if (aAvailable) { - *aAvailable = mResource.GetCachedDataEnd(); - } - - DIRECTSHOW_LOG("OutputPin::Length() len=%lld avail=%lld", *aTotal, *aAvailable); - - return hr; -} - -STDMETHODIMP -OutputPin::BeginFlush() -{ - CriticalSectionAutoEnter lock(*mLock); - mFlushCount++; - mSignal.Notify(); - return S_OK; -} - -STDMETHODIMP -OutputPin::EndFlush(void) -{ - CriticalSectionAutoEnter lock(*mLock); - mFlushCount--; - return S_OK; -} - -uint32_t -OutputPin::GetAndResetBytesConsumedCount() -{ - CriticalSectionAutoEnter lock(*mLock); - uint32_t bytesConsumed = mBytesConsumed; - mBytesConsumed = 0; - return bytesConsumed; -} - -SourceFilter::SourceFilter(const GUID& aMajorType, - const GUID& aSubType) - : BaseFilter(L"MozillaDirectShowSource", __uuidof(SourceFilter)) -{ - MOZ_COUNT_CTOR(SourceFilter); - mMediaType.majortype = aMajorType; - mMediaType.subtype = aSubType; - - DIRECTSHOW_LOG("SourceFilter Constructor(%s, %s)", - GetDirectShowGuidName(aMajorType), - GetDirectShowGuidName(aSubType)); -} - -SourceFilter::~SourceFilter() -{ - MOZ_COUNT_DTOR(SourceFilter); - DIRECTSHOW_LOG("SourceFilter Destructor()"); -} - -BasePin* -SourceFilter::GetPin(int n) -{ - if (n == 0) { - NS_ASSERTION(mOutputPin != 0, "GetPin with no pin!"); - return static_cast<BasePin*>(mOutputPin); - } else { - return nullptr; - } -} - -// Get's the media type we're supplying. -const MediaType* -SourceFilter::GetMediaType() const -{ - return &mMediaType; -} - -nsresult -SourceFilter::Init(MediaResource* aResource, int64_t aMP3Offset) -{ - DIRECTSHOW_LOG("SourceFilter::Init()"); - - mOutputPin = new OutputPin(aResource, - this, - mLock, - aMP3Offset); - NS_ENSURE_TRUE(mOutputPin != nullptr, NS_ERROR_FAILURE); - - return NS_OK; -} - -uint32_t -SourceFilter::GetAndResetBytesConsumedCount() -{ - return mOutputPin->GetAndResetBytesConsumedCount(); -} - - -} // namespace mozilla diff --git a/dom/media/directshow/SourceFilter.h b/dom/media/directshow/SourceFilter.h deleted file mode 100644 index d5ce2770e..000000000 --- a/dom/media/directshow/SourceFilter.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim:set ts=2 sw=2 sts=2 et cindent: */ -/* 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/. */ - -#if !defined(nsDirectShowSource_h___) -#define nsDirectShowSource_h___ - -#include "BaseFilter.h" -#include "BasePin.h" -#include "MediaType.h" - -#include "nsDeque.h" -#include "nsAutoPtr.h" -#include "DirectShowUtils.h" -#include "mozilla/RefPtr.h" - -namespace mozilla { - -class MediaResource; -class OutputPin; - - -// SourceFilter is an asynchronous DirectShow source filter which -// reads from an MediaResource, and supplies data via a pull model downstream -// using OutputPin. It us used to supply a generic byte stream into -// DirectShow. -// -// Implements: -// * IBaseFilter -// * IMediaFilter -// * IPersist -// * IUnknown -// -class DECLSPEC_UUID("5c2a7ad0-ba82-4659-9178-c4719a2765d6") -SourceFilter : public media::BaseFilter -{ -public: - - // Constructs source filter to deliver given media type. - SourceFilter(const GUID& aMajorType, const GUID& aSubType); - ~SourceFilter(); - - nsresult Init(MediaResource *aResource, int64_t aMP3Offset); - - // BaseFilter overrides. - // Only one output - the byte stream. - int GetPinCount() override { return 1; } - - media::BasePin* GetPin(int n) override; - - // Get's the media type we're supplying. - const media::MediaType* GetMediaType() const; - - uint32_t GetAndResetBytesConsumedCount(); - -protected: - - // Our async pull output pin. - nsAutoPtr<OutputPin> mOutputPin; - - // Type of byte stream we output. - media::MediaType mMediaType; - -}; - -} // namespace mozilla - -// For mingw __uuidof support -#ifdef __CRT_UUID_DECL -__CRT_UUID_DECL(mozilla::SourceFilter, 0x5c2a7ad0,0xba82,0x4659,0x91,0x78,0xc4,0x71,0x9a,0x27,0x65,0xd6); -#endif - -#endif diff --git a/dom/media/directshow/moz.build b/dom/media/directshow/moz.build deleted file mode 100644 index 8a9b76200..000000000 --- a/dom/media/directshow/moz.build +++ /dev/null @@ -1,41 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# 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/. - -EXPORTS += [ - 'AudioSinkFilter.h', - 'AudioSinkInputPin.h', - 'DirectShowDecoder.h', - 'DirectShowReader.h', - 'DirectShowUtils.h', -] - -UNIFIED_SOURCES += [ - 'DirectShowDecoder.cpp', - 'DirectShowUtils.cpp', - 'SourceFilter.cpp', -] - -SOURCES += [ - 'AudioSinkFilter.cpp', - 'AudioSinkInputPin.cpp', - 'DirectShowReader.cpp', - 'SampleSink.cpp', -] - -# If WebRTC isn't being built, we need to compile the DirectShow base classes so that -# they're available at link time. -if not CONFIG['MOZ_WEBRTC']: - SOURCES += [ - '/media/webrtc/trunk/webrtc/modules/video_capture/windows/BaseFilter.cpp', - '/media/webrtc/trunk/webrtc/modules/video_capture/windows/BaseInputPin.cpp', - '/media/webrtc/trunk/webrtc/modules/video_capture/windows/BasePin.cpp', - '/media/webrtc/trunk/webrtc/modules/video_capture/windows/MediaType.cpp', - ] - -FINAL_LIBRARY = 'xul' -LOCAL_INCLUDES += [ - '/media/webrtc/trunk/webrtc/modules/video_capture/windows', -] diff --git a/dom/media/fmp4/MP4Stream.cpp b/dom/media/fmp4/MP4Stream.cpp index 615a7dc01..9a79cac7a 100644 --- a/dom/media/fmp4/MP4Stream.cpp +++ b/dom/media/fmp4/MP4Stream.cpp @@ -48,9 +48,6 @@ MP4Stream::BlockingReadIntoCache(int64_t aOffset, size_t aCount, Monitor* aToUnl return true; } -// We surreptitiously reimplement the supposedly-blocking ReadAt as a non- -// blocking CachedReadAt, and record when it fails. This allows MP4Reader -// to retry the read as an actual blocking read without holding the lock. bool MP4Stream::ReadAt(int64_t aOffset, void* aBuffer, size_t aCount, size_t* aBytesRead) diff --git a/dom/media/gtest/Cargo.toml b/dom/media/gtest/Cargo.toml deleted file mode 100644 index a55f8fb68..000000000 --- a/dom/media/gtest/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "mp4parse-gtest" -version = "0.1.0" -authors = ["nobody@mozilla.org"] - -[lib] -path = "hello.rs" diff --git a/dom/media/gtest/TestMP3Demuxer.cpp b/dom/media/gtest/TestMP3Demuxer.cpp index 8d2109f00..934acb60e 100644 --- a/dom/media/gtest/TestMP3Demuxer.cpp +++ b/dom/media/gtest/TestMP3Demuxer.cpp @@ -11,7 +11,6 @@ #include "MockMediaResource.h" using namespace mozilla; -using namespace mozilla::mp3; using media::TimeUnit; diff --git a/dom/media/gtest/TestMP4Reader.cpp b/dom/media/gtest/TestMP4Reader.cpp deleted file mode 100644 index f08f7a40d..000000000 --- a/dom/media/gtest/TestMP4Reader.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. */ - -#include "gtest/gtest.h" -#include "MP4Reader.h" -#include "MP4Decoder.h" -#include "mozilla/SharedThreadPool.h" -#include "MockMediaResource.h" -#include "MockMediaDecoderOwner.h" -#include "mozilla/Preferences.h" -#include "TimeUnits.h" - -using namespace mozilla; -using namespace mozilla::dom; - -class TestBinding -{ -public: - NS_INLINE_DECL_THREADSAFE_REFCOUNTING(TestBinding); - - RefPtr<MP4Decoder> decoder; - RefPtr<MockMediaResource> resource; - RefPtr<MP4Reader> reader; - - explicit TestBinding(const char* aFileName = "gizmo.mp4") - : decoder(new MP4Decoder()) - , resource(new MockMediaResource(aFileName)) - , reader(new MP4Reader(decoder)) - { - EXPECT_EQ(NS_OK, Preferences::SetBool( - "media.use-blank-decoder", true)); - - EXPECT_EQ(NS_OK, resource->Open(nullptr)); - decoder->SetResource(resource); - - reader->Init(nullptr); - // This needs to be done before invoking GetBuffered. This is normally - // done by MediaDecoderStateMachine. - reader->DispatchSetStartTime(0); - } - - void Init() { - nsCOMPtr<nsIThread> thread; - nsCOMPtr<nsIRunnable> r = NewRunnableMethod(this, &TestBinding::ReadMetadata); - nsresult rv = NS_NewThread(getter_AddRefs(thread), r); - EXPECT_EQ(NS_OK, rv); - thread->Shutdown(); - } - -private: - virtual ~TestBinding() - { - { - RefPtr<TaskQueue> queue = reader->OwnerThread(); - nsCOMPtr<nsIRunnable> task = NewRunnableMethod(reader, &MP4Reader::Shutdown); - // Hackily bypass the tail dispatcher so that we can AwaitShutdownAndIdle. - // In production code we'd use BeginShutdown + promises. - queue->Dispatch(task.forget(), AbstractThread::AssertDispatchSuccess, - AbstractThread::TailDispatch); - queue->AwaitShutdownAndIdle(); - } - decoder = nullptr; - resource = nullptr; - reader = nullptr; - SharedThreadPool::SpinUntilEmpty(); - } - - void ReadMetadata() - { - MediaInfo info; - MetadataTags* tags; - EXPECT_EQ(NS_OK, reader->ReadMetadata(&info, &tags)); - } -}; - -TEST(MP4Reader, BufferedRange) -{ - RefPtr<TestBinding> b = new TestBinding(); - b->Init(); - - // Video 3-4 sec, audio 2.986666-4.010666 sec - b->resource->MockAddBufferedRange(248400, 327455); - - media::TimeIntervals ranges = b->reader->GetBuffered(); - EXPECT_EQ(1U, ranges.Length()); - EXPECT_NEAR(270000 / 90000.0, ranges.Start(0).ToSeconds(), 0.000001); - EXPECT_NEAR(360000 / 90000.0, ranges.End(0).ToSeconds(), 0.000001); -} - -TEST(MP4Reader, BufferedRangeMissingLastByte) -{ - RefPtr<TestBinding> b = new TestBinding(); - b->Init(); - - // Dropping the last byte of the video - b->resource->MockClearBufferedRanges(); - b->resource->MockAddBufferedRange(248400, 324912); - b->resource->MockAddBufferedRange(324913, 327455); - - media::TimeIntervals ranges = b->reader->GetBuffered(); - EXPECT_EQ(1U, ranges.Length()); - EXPECT_NEAR(270000.0 / 90000.0, ranges.Start(0).ToSeconds(), 0.000001); - EXPECT_NEAR(357000 / 90000.0, ranges.End(0).ToSeconds(), 0.000001); -} - -TEST(MP4Reader, BufferedRangeSyncFrame) -{ - RefPtr<TestBinding> b = new TestBinding(); - b->Init(); - - // Check that missing the first byte at 2 seconds skips right through to 3 - // seconds because of a missing sync frame - b->resource->MockClearBufferedRanges(); - b->resource->MockAddBufferedRange(146336, 327455); - - media::TimeIntervals ranges = b->reader->GetBuffered(); - EXPECT_EQ(1U, ranges.Length()); - EXPECT_NEAR(270000.0 / 90000.0, ranges.Start(0).ToSeconds(), 0.000001); - EXPECT_NEAR(360000 / 90000.0, ranges.End(0).ToSeconds(), 0.000001); -} - -TEST(MP4Reader, CompositionOrder) -{ - RefPtr<TestBinding> b = new TestBinding("mediasource_test.mp4"); - b->Init(); - - // The first 5 video samples of this file are: - // Video timescale=2500 - // Frame Start Size Time Duration Sync - // 1 48 5455 166 83 Yes - // 2 5503 145 249 83 - // 3 6228 575 581 83 - // 4 7383 235 415 83 - // 5 8779 183 332 83 - // 6 9543 191 498 83 - // - // Audio timescale=44100 - // 1 5648 580 0 1024 Yes - // 2 6803 580 1024 1058 Yes - // 3 7618 581 2082 1014 Yes - // 4 8199 580 3096 1015 Yes - // 5 8962 581 4111 1014 Yes - // 6 9734 580 5125 1014 Yes - // 7 10314 581 6139 1059 Yes - // 8 11207 580 7198 1014 Yes - // 9 12035 581 8212 1014 Yes - // 10 12616 580 9226 1015 Yes - // 11 13220 581 10241 1014 Yes - - b->resource->MockClearBufferedRanges(); - // First two frames in decoding + first audio frame - b->resource->MockAddBufferedRange(48, 5503); // Video 1 - b->resource->MockAddBufferedRange(5503, 5648); // Video 2 - b->resource->MockAddBufferedRange(6228, 6803); // Video 3 - - // Audio - 5 frames; 0 - 139206 us - b->resource->MockAddBufferedRange(5648, 6228); - b->resource->MockAddBufferedRange(6803, 7383); - b->resource->MockAddBufferedRange(7618, 8199); - b->resource->MockAddBufferedRange(8199, 8779); - b->resource->MockAddBufferedRange(8962, 9563); - b->resource->MockAddBufferedRange(9734, 10314); - b->resource->MockAddBufferedRange(10314, 10895); - b->resource->MockAddBufferedRange(11207, 11787); - b->resource->MockAddBufferedRange(12035, 12616); - b->resource->MockAddBufferedRange(12616, 13196); - b->resource->MockAddBufferedRange(13220, 13901); - - media::TimeIntervals ranges = b->reader->GetBuffered(); - EXPECT_EQ(2U, ranges.Length()); - - EXPECT_NEAR(166.0 / 2500.0, ranges.Start(0).ToSeconds(), 0.000001); - EXPECT_NEAR(332.0 / 2500.0, ranges.End(0).ToSeconds(), 0.000001); - - EXPECT_NEAR(581.0 / 2500.0, ranges.Start(1).ToSeconds(), 0.000001); - EXPECT_NEAR(11255.0 / 44100.0, ranges.End(1).ToSeconds(), 0.000001); -} - -TEST(MP4Reader, Normalised) -{ - RefPtr<TestBinding> b = new TestBinding("mediasource_test.mp4"); - b->Init(); - - // The first 5 video samples of this file are: - // Video timescale=2500 - // Frame Start Size Time Duration Sync - // 1 48 5455 166 83 Yes - // 2 5503 145 249 83 - // 3 6228 575 581 83 - // 4 7383 235 415 83 - // 5 8779 183 332 83 - // 6 9543 191 498 83 - // - // Audio timescale=44100 - // 1 5648 580 0 1024 Yes - // 2 6803 580 1024 1058 Yes - // 3 7618 581 2082 1014 Yes - // 4 8199 580 3096 1015 Yes - // 5 8962 581 4111 1014 Yes - // 6 9734 580 5125 1014 Yes - // 7 10314 581 6139 1059 Yes - // 8 11207 580 7198 1014 Yes - // 9 12035 581 8212 1014 Yes - // 10 12616 580 9226 1015 Yes - // 11 13220 581 10241 1014 Yes - - b->resource->MockClearBufferedRanges(); - b->resource->MockAddBufferedRange(48, 13901); - - media::TimeIntervals ranges = b->reader->GetBuffered(); - EXPECT_EQ(1U, ranges.Length()); - - EXPECT_NEAR(166.0 / 2500.0, ranges.Start(0).ToSeconds(), 0.000001); - EXPECT_NEAR(11255.0 / 44100.0, ranges.End(0).ToSeconds(), 0.000001); -} diff --git a/dom/media/gtest/TestRust.cpp b/dom/media/gtest/TestRust.cpp deleted file mode 100644 index 86d0e99b8..000000000 --- a/dom/media/gtest/TestRust.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include <stdint.h> -#include "gtest/gtest.h" - -extern "C" uint8_t* test_rust(); - -TEST(rust, CallFromCpp) { - auto greeting = test_rust(); - EXPECT_STREQ(reinterpret_cast<char*>(greeting), "hello from rust."); -} diff --git a/dom/media/gtest/hello.rs b/dom/media/gtest/hello.rs deleted file mode 100644 index cd111882a..000000000 --- a/dom/media/gtest/hello.rs +++ /dev/null @@ -1,6 +0,0 @@ -#[no_mangle] -pub extern fn test_rust() -> *const u8 { - // NB: rust &str aren't null terminated. - let greeting = "hello from rust.\0"; - greeting.as_ptr() -} diff --git a/dom/media/gtest/moz.build b/dom/media/gtest/moz.build index d5d02bced..a7ea73807 100644 --- a/dom/media/gtest/moz.build +++ b/dom/media/gtest/moz.build @@ -21,7 +21,6 @@ UNIFIED_SOURCES += [ 'TestMozPromise.cpp', 'TestMP3Demuxer.cpp', 'TestMP4Demuxer.cpp', - # 'TestMP4Reader.cpp', disabled so we can turn check tests back on (bug 1175752) 'TestTrackEncoder.cpp', 'TestVideoSegment.cpp', 'TestVideoUtils.cpp', diff --git a/dom/media/moz.build b/dom/media/moz.build index 4d036a5f6..6d2c71f2d 100644 --- a/dom/media/moz.build +++ b/dom/media/moz.build @@ -30,6 +30,7 @@ DIRS += [ 'ipc', 'mediasink', 'mediasource', + 'mp3', 'ogg', 'platforms', 'systemservices', @@ -42,9 +43,6 @@ DIRS += [ 'standalone', ] -if CONFIG['MOZ_DIRECTSHOW']: - DIRS += ['directshow'] - if CONFIG['MOZ_ANDROID_OMX']: DIRS += ['android'] @@ -128,9 +126,6 @@ EXPORTS += [ 'MediaTimer.h', 'MediaTrack.h', 'MediaTrackList.h', - 'MP3Decoder.h', - 'MP3Demuxer.h', - 'MP3FrameParser.h', 'NextFrameSeekTask.h', 'nsIDocumentActivity.h', 'PrincipalChangeObserver.h', @@ -237,9 +232,6 @@ UNIFIED_SOURCES += [ 'MediaTimer.cpp', 'MediaTrack.cpp', 'MediaTrackList.cpp', - 'MP3Decoder.cpp', - 'MP3Demuxer.cpp', - 'MP3FrameParser.cpp', 'NextFrameSeekTask.cpp', 'QueueObject.cpp', 'SeekJob.cpp', @@ -294,11 +286,6 @@ LOCAL_INCLUDES += [ '/netwerk/base', ] -if CONFIG['MOZ_DIRECTSHOW']: - LOCAL_INCLUDES += [ - '/media/webrtc/trunk/webrtc/modules/video_capture/windows', - ] - if CONFIG['MOZ_WEBRTC']: LOCAL_INCLUDES += [ '/media/webrtc/signaling/src/common', diff --git a/dom/media/MP3Decoder.cpp b/dom/media/mp3/MP3Decoder.cpp index b71111e79..074a0866d 100644 --- a/dom/media/MP3Decoder.cpp +++ b/dom/media/mp3/MP3Decoder.cpp @@ -24,7 +24,7 @@ MP3Decoder::Clone(MediaDecoderOwner* aOwner) { MediaDecoderStateMachine* MP3Decoder::CreateStateMachine() { RefPtr<MediaDecoderReader> reader = - new MediaFormatReader(this, new mp3::MP3Demuxer(GetResource())); + new MediaFormatReader(this, new MP3Demuxer(GetResource())); return new MediaDecoderStateMachine(this, reader); } diff --git a/dom/media/MP3Decoder.h b/dom/media/mp3/MP3Decoder.h index 887251065..887251065 100644 --- a/dom/media/MP3Decoder.h +++ b/dom/media/mp3/MP3Decoder.h diff --git a/dom/media/MP3Demuxer.cpp b/dom/media/mp3/MP3Demuxer.cpp index 7d478a41b..5a98cabfe 100644 --- a/dom/media/MP3Demuxer.cpp +++ b/dom/media/mp3/MP3Demuxer.cpp @@ -33,7 +33,6 @@ using mozilla::media::TimeIntervals; using mp4_demuxer::ByteReader; namespace mozilla { -namespace mp3 { // MP3Demuxer @@ -1338,5 +1337,4 @@ ID3Parser::ID3Header::Update(uint8_t c) { return IsValid(mPos++); } -} // namespace mp3 } // namespace mozilla diff --git a/dom/media/MP3Demuxer.h b/dom/media/mp3/MP3Demuxer.h index 03e67b0d9..5331c4d54 100644 --- a/dom/media/MP3Demuxer.h +++ b/dom/media/mp3/MP3Demuxer.h @@ -13,7 +13,6 @@ #include <vector> namespace mozilla { -namespace mp3 { class MP3TrackDemuxer; @@ -468,7 +467,6 @@ private: UniquePtr<AudioInfo> mInfo; }; -} // namespace mp3 } // namespace mozilla #endif diff --git a/application/palemoon/components/about/moz.build b/dom/media/mp3/moz.build index 95a8451ba..596d061f8 100644 --- a/application/palemoon/components/about/moz.build +++ b/dom/media/mp3/moz.build @@ -4,16 +4,14 @@ # 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/. -EXPORTS.mozilla.browser += [ - 'AboutRedirector.h', +EXPORTS += [ + 'MP3Decoder.h', + 'MP3Demuxer.h', ] -SOURCES += [ - 'AboutRedirector.cpp', +UNIFIED_SOURCES += [ + 'MP3Decoder.cpp', + 'MP3Demuxer.cpp', ] -FINAL_LIBRARY = 'browsercomps' - -LOCAL_INCLUDES += [ - '../build', -] +FINAL_LIBRARY = 'xul' diff --git a/dom/media/platforms/MediaTelemetryConstants.h b/dom/media/platforms/MediaTelemetryConstants.h deleted file mode 100644 index 5024949a8..000000000 --- a/dom/media/platforms/MediaTelemetryConstants.h +++ /dev/null @@ -1,22 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * 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/. */ -#ifndef dom_media_platforms_MediaTelemetryConstants_h___ -#define dom_media_platforms_MediaTelemetryConstants_h___ - -namespace mozilla { -namespace media { - -enum class MediaDecoderBackend : uint32_t -{ - WMFSoftware = 0, - WMFDXVA2D3D9 = 1, - WMFDXVA2D3D11 = 2 -}; - -} // namespace media -} // namespace mozilla - -#endif // dom_media_platforms_MediaTelemetryConstants_h___ diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build index be13d31c4..f5fb72c5d 100644 --- a/dom/media/platforms/moz.build +++ b/dom/media/platforms/moz.build @@ -10,7 +10,6 @@ EXPORTS += [ 'agnostic/TheoraDecoder.h', 'agnostic/VorbisDecoder.h', 'agnostic/VPXDecoder.h', - 'MediaTelemetryConstants.h', 'PDMFactory.h', 'PlatformDecoderModule.h', 'wrappers/FuzzingWrapper.h', diff --git a/dom/media/platforms/wmf/DXVA2Manager.cpp b/dom/media/platforms/wmf/DXVA2Manager.cpp index 1226ea621..69e002f7f 100644 --- a/dom/media/platforms/wmf/DXVA2Manager.cpp +++ b/dom/media/platforms/wmf/DXVA2Manager.cpp @@ -14,7 +14,6 @@ #include "mozilla/layers/D3D11ShareHandleImage.h" #include "mozilla/layers/ImageBridgeChild.h" #include "mozilla/layers/TextureForwarder.h" -#include "MediaTelemetryConstants.h" #include "mfapi.h" #include "gfxPrefs.h" #include "MFTDecoder.h" diff --git a/dom/media/platforms/wmf/WMFMediaDataDecoder.h b/dom/media/platforms/wmf/WMFMediaDataDecoder.h index a4dd49f56..75571d61e 100644 --- a/dom/media/platforms/wmf/WMFMediaDataDecoder.h +++ b/dom/media/platforms/wmf/WMFMediaDataDecoder.h @@ -33,7 +33,7 @@ public: // Returns S_OK on success, or MF_E_TRANSFORM_NEED_MORE_INPUT if there's not // enough data to produce more output. If this returns a failure code other // than MF_E_TRANSFORM_NEED_MORE_INPUT, an error will be reported to the - // MP4Reader. + // MP4Demuxer. virtual HRESULT Output(int64_t aStreamOffset, RefPtr<MediaData>& aOutput) = 0; diff --git a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp index 8a51f817a..a7633a7de 100644 --- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp +++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp @@ -27,7 +27,6 @@ #include "mozilla/WindowsVersion.h" #include "mozilla/Telemetry.h" #include "nsPrintfCString.h" -#include "MediaTelemetryConstants.h" #include "GMPUtils.h" // For SplitAt. TODO: Move SplitAt to a central place. #include "MP4Decoder.h" #include "VPXDecoder.h" diff --git a/dom/media/test/manifest.js b/dom/media/test/manifest.js index 7e30cc97d..52e53a271 100644 --- a/dom/media/test/manifest.js +++ b/dom/media/test/manifest.js @@ -266,10 +266,10 @@ var gPlayTests = [ { name:"small-shot.mp3", type:"audio/mpeg", duration:0.27 }, { name:"owl.mp3", type:"audio/mpeg", duration:3.343 }, // owl.mp3 as above, but with something funny going on in the ID3v2 tag - // that causes DirectShow to fail. + // that caused DirectShow to fail. { name:"owl-funny-id3.mp3", type:"audio/mpeg", duration:3.343 }, // owl.mp3 as above, but with something even funnier going on in the ID3v2 tag - // that causes DirectShow to fail. + // that caused DirectShow to fail. { name:"owl-funnier-id3.mp3", type:"audio/mpeg", duration:3.343 }, // One second of silence with ~140KB of ID3 tags. Usually when the first MP3 // frame is at such a high offset into the file, MP3FrameParser will give up diff --git a/dom/media/test/test_can_play_type_mpeg.html b/dom/media/test/test_can_play_type_mpeg.html index 89e5fabef..514b5cc2f 100644 --- a/dom/media/test/test_can_play_type_mpeg.html +++ b/dom/media/test/test_can_play_type_mpeg.html @@ -151,8 +151,7 @@ var haveMp4 = (getPref("media.wmf.enabled") && IsWindowsVistaOrLater()) || check_mp4(document.getElementById('v'), haveMp4); -var haveMp3 = getPref("media.directshow.enabled") || - (getPref("media.wmf.enabled") && IsWindowsVistaOrLater()) || +var haveMp3 = getPref("media.wmf.enabled") || (IsLinux() && getPref("media.ffmpeg.enabled")) || (IsSupportedAndroid() && ((IsJellyBeanOrLater() && getPref("media.android-media-codec.enabled")) || diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index c63374541..07a5b80e7 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -7021,8 +7021,11 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation, nsIContent* aContainer, nsIContent* aChild) { + // XXXmats no lazy frames for display:contents direct descendants yet + // (Mozilla bug 979782). if (mPresShell->GetPresContext()->IsChrome() || !aContainer || - aContainer->IsInNativeAnonymousSubtree() || aContainer->IsXULElement()) { + aContainer->IsInNativeAnonymousSubtree() || aContainer->IsXULElement() || + GetDisplayContentsStyleFor(aContainer)) { return false; } @@ -7056,6 +7059,10 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation, // ignore anonymous children (eg framesets) make this complicated. So we set // these two booleans if we encounter these situations and unset them if we // hit a node with a leaf frame. + // + // Also, it's fine if one of the nodes without primary frame is a display: + // contents node except if it's the direct ancestor of the children we're + // recreating frames for. bool noPrimaryFrame = false; bool needsFrameBitSet = false; #endif @@ -7065,17 +7072,14 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation, if (content->GetPrimaryFrame() && content->GetPrimaryFrame()->IsLeaf()) { noPrimaryFrame = needsFrameBitSet = false; } - if (!noPrimaryFrame && !content->GetPrimaryFrame()) { + if (!noPrimaryFrame && !content->GetPrimaryFrame() && + !GetDisplayContentsStyleFor(content)) { noPrimaryFrame = true; } if (!needsFrameBitSet && content->HasFlag(NODE_NEEDS_FRAME)) { needsFrameBitSet = true; } #endif - // XXXmats no lazy frames for display:contents descendants yet (bug 979782). - if (GetDisplayContentsStyleFor(content)) { - return false; - } content->SetFlags(NODE_DESCENDANTS_NEED_FRAMES); content = content->GetFlattenedTreeParent(); } diff --git a/layout/reftests/css-display/display-contents-dyn-insert-text-ref.html b/layout/reftests/css-display/display-contents-dyn-insert-text-ref.html new file mode 100644 index 000000000..a212e025e --- /dev/null +++ b/layout/reftests/css-display/display-contents-dyn-insert-text-ref.html @@ -0,0 +1,7 @@ +<!doctype html> +<meta charset="utf-8"> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<title>CSS Test reference - Bug 1338678</title> +<div style="display: contents"> + <div id="element">PASS</div> +</div> diff --git a/layout/reftests/css-display/display-contents-dyn-insert-text.html b/layout/reftests/css-display/display-contents-dyn-insert-text.html new file mode 100644 index 000000000..f3b0c0c95 --- /dev/null +++ b/layout/reftests/css-display/display-contents-dyn-insert-text.html @@ -0,0 +1,16 @@ +<!doctype html> +<meta charset="utf-8"> +<link rel="author" title="Markus Stange" href="mailto:mstange@themasta.com"> +<link rel="help" href="https://drafts.csswg.org/css-display/#box-generation"> +<title>Bug 1338678 - display:contents makes textContent disappear</title> +<div style="display: contents"> + <div id="element"></div> +</div> +<script> +window.onload = function() { + document.body.offsetTop; + var element = document.getElementById('element'); + element.textContent = "FAIL"; + element.textContent = "PASS"; +} +</script> diff --git a/layout/reftests/css-display/reftest.list b/layout/reftests/css-display/reftest.list index d310422bb..00f46a80b 100644 --- a/layout/reftests/css-display/reftest.list +++ b/layout/reftests/css-display/reftest.list @@ -24,5 +24,6 @@ skip pref(layout.css.display-contents.enabled,true) == display-contents-xbl-4.xu asserts(0-1) fuzzy-if(Android,8,3216) pref(layout.css.display-contents.enabled,true) == display-contents-fieldset.html display-contents-fieldset-ref.html # bug 1089223 asserts(1) pref(layout.css.display-contents.enabled,true) == display-contents-xbl-5.xul display-contents-xbl-3-ref.xul # bug 1089223 pref(layout.css.display-contents.enabled,true) == display-contents-list-item-child.html display-contents-list-item-child-ref.html +pref(layout.css.display-contents.enabled,true) == display-contents-dyn-insert-text.html display-contents-dyn-insert-text-ref.html pref(layout.css.display-contents.enabled,true) == display-contents-writing-mode-1.html display-contents-writing-mode-1-ref.html pref(layout.css.display-contents.enabled,true) == display-contents-writing-mode-2.html display-contents-writing-mode-2-ref.html diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index b361cf0c2..33e5fe56d 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -1549,6 +1549,9 @@ protected: // All data from successfully parsed properties are placed into |mData|. nsCSSExpandedDataBlock mData; + + // Value to make sure our resolved variable results stay within sane limits. + const int32_t MAX_CSS_VAR_LENGTH = 10240; public: // Used from nsCSSParser constructors and destructors @@ -2802,6 +2805,12 @@ CSSParserImpl::ResolveValueWithVariableReferencesRec( // Invalid variable with no fallback. return false; } + // Make sure we are still using sane sizes for value and + // variableValue, and abort if OOB. + if (value.Length() > MAX_CSS_VAR_LENGTH || + variableValue.Length() > MAX_CSS_VAR_LENGTH) { + return false; + } // Valid variable with no fallback. AppendTokens(value, valueFirstToken, valueLastToken, varFirstToken, varLastToken, variableValue); diff --git a/media/ffvpx/config_unix32.h b/media/ffvpx/config_unix32.h index ae49d8075..172205963 100644 --- a/media/ffvpx/config_unix32.h +++ b/media/ffvpx/config_unix32.h @@ -213,6 +213,9 @@ #define HAVE_ES2_GL_H 0 #define HAVE_GSM_H 0 #define HAVE_IO_H 0 +#ifdef HAVE_LINUX_PERF_EVENT_H +#undef HAVE_LINUX_PERF_EVENT_H +#endif #define HAVE_LINUX_PERF_EVENT_H 0 #define HAVE_MACHINE_IOCTL_BT848_H 0 #define HAVE_MACHINE_IOCTL_METEOR_H 0 diff --git a/media/ffvpx/config_unix64.h b/media/ffvpx/config_unix64.h index 1c5c4cb4c..338b6692f 100644 --- a/media/ffvpx/config_unix64.h +++ b/media/ffvpx/config_unix64.h @@ -213,6 +213,9 @@ #define HAVE_ES2_GL_H 0 #define HAVE_GSM_H 0 #define HAVE_IO_H 0 +#ifdef HAVE_LINUX_PERF_EVENT_H +#undef HAVE_LINUX_PERF_EVENT_H +#endif #define HAVE_LINUX_PERF_EVENT_H 0 #define HAVE_MACHINE_IOCTL_BT848_H 0 #define HAVE_MACHINE_IOCTL_METEOR_H 0 diff --git a/media/libstagefright/gtest/TestMP4Rust.cpp b/media/libstagefright/gtest/TestMP4Rust.cpp deleted file mode 100644 index a338b5386..000000000 --- a/media/libstagefright/gtest/TestMP4Rust.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* 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/. */ - -#include "gtest/gtest.h" -#include "mp4parse.h" - -#include <stdint.h> -#include <stdio.h> -#include <string.h> -#include <algorithm> -#include <vector> - -static intptr_t -error_reader(uint8_t* buffer, uintptr_t size, void* userdata) -{ - return -1; -} - -struct read_vector { - explicit read_vector(FILE* file, size_t length); - explicit read_vector(size_t length); - - size_t location; - std::vector<uint8_t> buffer; -}; - -read_vector::read_vector(FILE* file, size_t length) - : location(0) -{ - buffer.resize(length); - size_t read = fread(buffer.data(), sizeof(decltype(buffer)::value_type), - buffer.size(), file); - buffer.resize(read); -} - -read_vector::read_vector(size_t length) - : location(0) -{ - buffer.resize(length, 0); -} - -static intptr_t -vector_reader(uint8_t* buffer, uintptr_t size, void* userdata) -{ - if (!buffer || !userdata) { - return -1; - } - - auto source = reinterpret_cast<read_vector*>(userdata); - if (source->location > source->buffer.size()) { - return -1; - } - uintptr_t available = source->buffer.size() - source->location; - uintptr_t length = std::min(available, size); - memcpy(buffer, source->buffer.data() + source->location, length); - source->location += length; - return length; -} - -TEST(rust, MP4MetadataEmpty) -{ - mp4parse_error rv; - mp4parse_io io; - - // Shouldn't be able to read with no context. - rv = mp4parse_read(nullptr); - EXPECT_EQ(rv, MP4PARSE_ERROR_BADARG); - - // Shouldn't be able to wrap an mp4parse_io with null members. - io = { nullptr, nullptr }; - mp4parse_parser* context = mp4parse_new(&io); - EXPECT_EQ(context, nullptr); - - io = { nullptr, &io }; - context = mp4parse_new(&io); - EXPECT_EQ(context, nullptr); - - // FIXME: this should probably be accepted. - io = { error_reader, nullptr }; - context = mp4parse_new(&io); - EXPECT_EQ(context, nullptr); - - // Read method errors should propagate. - io = { error_reader, &io }; - context = mp4parse_new(&io); - ASSERT_NE(context, nullptr); - rv = mp4parse_read(context); - EXPECT_EQ(rv, MP4PARSE_ERROR_IO); - mp4parse_free(context); - - // Short buffers should fail. - read_vector buf(0); - io = { vector_reader, &buf }; - context = mp4parse_new(&io); - ASSERT_NE(context, nullptr); - rv = mp4parse_read(context); - EXPECT_EQ(rv, MP4PARSE_ERROR_INVALID); - mp4parse_free(context); - - buf.buffer.reserve(4097); - context = mp4parse_new(&io); - ASSERT_NE(context, nullptr); - rv = mp4parse_read(context); - EXPECT_EQ(rv, MP4PARSE_ERROR_INVALID); - mp4parse_free(context); - - // Empty buffers should fail. - buf.buffer.resize(4097, 0); - context = mp4parse_new(&io); - rv = mp4parse_read(context); - EXPECT_EQ(rv, MP4PARSE_ERROR_UNSUPPORTED); - mp4parse_free(context); -} - -TEST(rust, MP4Metadata) -{ - FILE* f = fopen("street.mp4", "rb"); - ASSERT_TRUE(f != nullptr); - // Read just the moov header to work around the parser - // treating mid-box eof as an error. - //read_vector reader = read_vector(f, 1061); - struct stat s; - ASSERT_EQ(0, fstat(fileno(f), &s)); - read_vector reader = read_vector(f, s.st_size); - fclose(f); - - mp4parse_io io = { vector_reader, &reader }; - mp4parse_parser* context = mp4parse_new(&io); - ASSERT_NE(nullptr, context); - - mp4parse_error rv = mp4parse_read(context); - EXPECT_EQ(MP4PARSE_OK, rv); - - uint32_t tracks = 0; - rv = mp4parse_get_track_count(context, &tracks); - EXPECT_EQ(MP4PARSE_OK, rv); - EXPECT_EQ(2U, tracks); - - mp4parse_free(context); -} diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 546c836f0..a841bde55 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -362,9 +362,6 @@ pref("media.play-stand-alone", true); pref("media.hardware-video-decoding.enabled", true); pref("media.hardware-video-decoding.force-enabled", false); -#ifdef MOZ_DIRECTSHOW -pref("media.directshow.enabled", true); -#endif #ifdef MOZ_FMP4 pref("media.mp4.enabled", true); // Specifies whether the PDMFactory can create a test decoder that diff --git a/old-configure.in b/old-configure.in index 6b88a00af..547b71cbf 100644 --- a/old-configure.in +++ b/old-configure.in @@ -2204,7 +2204,6 @@ MOZ_VORBIS= MOZ_TREMOR= MOZ_SAMPLE_TYPE_FLOAT32= MOZ_SAMPLE_TYPE_S16= -MOZ_DIRECTSHOW= MOZ_WEBRTC= MOZ_PEERCONNECTION= MOZ_SRTP= @@ -2894,23 +2893,6 @@ fi fi # COMPILE_ENVIRONMENT dnl ======================================================== -dnl = DirectShow support -dnl ======================================================== -if test "$OS_ARCH" = "WINNT"; then - dnl Enable DirectShow support by default. - MOZ_DIRECTSHOW=1 -fi - -MOZ_ARG_DISABLE_BOOL(directshow, -[ --disable-directshow Disable support for DirectShow], - MOZ_DIRECTSHOW=, - MOZ_DIRECTSHOW=1) - -if test -n "$MOZ_DIRECTSHOW"; then - AC_DEFINE(MOZ_DIRECTSHOW) -fi; - -dnl ======================================================== dnl = EME support dnl ======================================================== @@ -5484,7 +5466,6 @@ AC_SUBST(MOZ_TREMOR) AC_SUBST(MOZ_FFVPX) AC_SUBST_LIST(FFVPX_ASFLAGS) AC_SUBST(MOZ_EME) -AC_SUBST(MOZ_DIRECTSHOW) AC_SUBST(MOZ_ANDROID_OMX) AC_SUBST(MOZ_OMX_PLUGIN) AC_SUBST(MOZ_VPX_ERROR_CONCEALMENT) diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build index 71f9a86de..624f8f54d 100644 --- a/toolkit/library/moz.build +++ b/toolkit/library/moz.build @@ -177,14 +177,6 @@ if CONFIG['MOZ_WMF']: 'strmiids', ] -if CONFIG['MOZ_DIRECTSHOW']: - OS_LIBS += [ - 'dmoguids', - 'wmcodecdspuuid', - 'strmiids', - 'msdmo', - ] - if CONFIG['OS_ARCH'] == 'FreeBSD': OS_LIBS += [ 'util', |