diff --git a/browser/components/sessionstore/content/aboutSessionRestore.js b/browser/components/sessionstore/content/aboutSessionRestore.js index d2793e6716f..0d32645a9e8 100644 --- a/browser/components/sessionstore/content/aboutSessionRestore.js +++ b/browser/components/sessionstore/content/aboutSessionRestore.js @@ -140,7 +140,7 @@ function restoreSession() { ss.setWindowState(top, stateString, true); return; } - + // restore the session into a new window and close the current tab var newWindow = top.openDialog(top.location, "_blank", "chrome,dialog=no,all"); newWindow.addEventListener("load", function() { diff --git a/content/media/webm/nsWebMReader.cpp b/content/media/webm/nsWebMReader.cpp index 06611ea4ff1..125e8c0f33f 100644 --- a/content/media/webm/nsWebMReader.cpp +++ b/content/media/webm/nsWebMReader.cpp @@ -137,9 +137,12 @@ nsWebMReader::nsWebMReader(nsBuiltinDecoder* aDecoder) mAudioStartUsec(-1), mAudioFrames(0), mHasVideo(false), - mHasAudio(false) + mHasAudio(false), + mForceStereoMode(0) { MOZ_COUNT_CTOR(nsWebMReader); + + Preferences::GetInt("media.webm.force_stereo_mode", &mForceStereoMode); } nsWebMReader::~nsWebMReader() @@ -306,25 +309,21 @@ nsresult nsWebMReader::ReadMetadata(nsVideoInfo* aInfo) break; } - PRInt32 forceStereoMode; - if (NS_SUCCEEDED(Preferences::GetInt("media.webm.force_stereo_mode", - &forceStereoMode))) { - switch (forceStereoMode) { - case 1: - mInfo.mStereoMode = STEREO_MODE_LEFT_RIGHT; - break; - case 2: - mInfo.mStereoMode = STEREO_MODE_RIGHT_LEFT; - break; - case 3: - mInfo.mStereoMode = STEREO_MODE_TOP_BOTTOM; - break; - case 4: - mInfo.mStereoMode = STEREO_MODE_BOTTOM_TOP; - break; - default: - mInfo.mStereoMode = STEREO_MODE_MONO; - } + switch (mForceStereoMode) { + case 1: + mInfo.mStereoMode = STEREO_MODE_LEFT_RIGHT; + break; + case 2: + mInfo.mStereoMode = STEREO_MODE_RIGHT_LEFT; + break; + case 3: + mInfo.mStereoMode = STEREO_MODE_TOP_BOTTOM; + break; + case 4: + mInfo.mStereoMode = STEREO_MODE_BOTTOM_TOP; + break; + default: + mInfo.mStereoMode = STEREO_MODE_MONO; } } else if (!mHasAudio && type == NESTEGG_TRACK_AUDIO) { diff --git a/content/media/webm/nsWebMReader.h b/content/media/webm/nsWebMReader.h index 3ff70da12b8..b6b5e76e728 100644 --- a/content/media/webm/nsWebMReader.h +++ b/content/media/webm/nsWebMReader.h @@ -240,6 +240,10 @@ private: // Booleans to indicate if we have audio and/or video data bool mHasVideo; bool mHasAudio; + + // Value of the "media.webm.force_stereo_mode" pref, which we need off the + // main thread. + PRInt32 mForceStereoMode; }; #endif diff --git a/toolkit/content/widgets/videocontrols.css b/toolkit/content/widgets/videocontrols.css index 75b5a8ab286..d100682df41 100644 --- a/toolkit/content/widgets/videocontrols.css +++ b/toolkit/content/widgets/videocontrols.css @@ -20,6 +20,7 @@ .mediaControlsFrame { direction: ltr; /* Prevent unwanted style inheritance. See bug 554717. */ + text-align: left; list-style-image: none !important; font: normal normal normal 100%/normal sans-serif !important; text-decoration: none !important; diff --git a/toolkit/mozapps/extensions/AddonRepository.jsm b/toolkit/mozapps/extensions/AddonRepository.jsm index c33eb2244b0..11573851fcf 100644 --- a/toolkit/mozapps/extensions/AddonRepository.jsm +++ b/toolkit/mozapps/extensions/AddonRepository.jsm @@ -1257,8 +1257,10 @@ var AddonRepository = { // Parses addon_compatibility nodes, that describe compatibility overrides. _parseAddonCompatElement: function(aResultObj, aElement) { let guid = this._getDescendantTextContent(aElement, "guid"); - if (!guid) + if (!guid) { + LOG("Compatibility override is missing guid."); return; + } let compat = {id: guid}; compat.hosted = aElement.getAttribute("hosted") != "false"; @@ -1292,21 +1294,31 @@ var AddonRepository = { function parseRangeNode(aNode) { let type = aNode.getAttribute("type"); // Only "incompatible" (blacklisting) is supported for now. - if (type != "incompatible") + if (type != "incompatible") { + LOG("Compatibility override of unsupported type found."); return null; + } let override = new AddonManagerPrivate.AddonCompatibilityOverride(type); override.minVersion = this._getDirectDescendantTextContent(aNode, "min_version"); override.maxVersion = this._getDirectDescendantTextContent(aNode, "max_version"); - if (!override.minVersion || !override.maxVersion) + if (!override.minVersion) { + LOG("Compatibility override is missing min_version."); return null; + } + if (!override.maxVersion) { + LOG("Compatibility override is missing max_version."); + return null; + } let appRanges = aNode.querySelectorAll("compatible_applications > application"); let appRange = findMatchingAppRange.bind(this)(appRanges); - if (!appRange) + if (!appRange) { + LOG("Compatibility override is missing a valid application range."); return null; + } override.appID = appRange.appID; override.appMinVersion = appRange.appMinVersion; diff --git a/toolkit/mozapps/extensions/XPIProvider.jsm b/toolkit/mozapps/extensions/XPIProvider.jsm index 0288121449d..530add649a0 100644 --- a/toolkit/mozapps/extensions/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/XPIProvider.jsm @@ -6148,6 +6148,7 @@ AddonInstall.prototype = { if (aRepoAddon) { aAddon._repositoryAddon = aRepoAddon; aAddon.compatibilityOverrides = aRepoAddon.compatibilityOverrides; + aAddon.appDisabled = !isUsableAddon(aAddon); aCallback(); return; } @@ -6159,6 +6160,7 @@ AddonInstall.prototype = { aAddon.compatibilityOverrides = aRepoAddon ? aRepoAddon.compatibilityOverrides : null; + aAddon.appDisabled = !isUsableAddon(aAddon); aCallback(); }); }); diff --git a/toolkit/mozapps/extensions/test/addons/test_install6/install.rdf b/toolkit/mozapps/extensions/test/addons/test_install6/install.rdf new file mode 100644 index 00000000000..b1f97c1fd47 --- /dev/null +++ b/toolkit/mozapps/extensions/test/addons/test_install6/install.rdf @@ -0,0 +1,24 @@ + + + + + + + addon6@tests.mozilla.org + 1.0 + + + Addon Test 6 + Test Description + + + + xpcshell@tests.mozilla.org + 1 + 1 + + + + + diff --git a/toolkit/mozapps/extensions/test/xpcshell/data/test_install.xml b/toolkit/mozapps/extensions/test/xpcshell/data/test_install.xml index 7c47f8a42bf..33f14a2fdcf 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/data/test_install.xml +++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_install.xml @@ -31,4 +31,23 @@ ALL http://example.com/browser/toolkit/mozapps/extensions/test/browser/addons/browser_install1_2.xpi + + + addon6@tests.mozilla.org + Addon Test 6 + + + 1.0 + 1.0 + + + XPCShell + 1.0 + 1.0 + xpcshell@tests.mozilla.org + + + + + diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_install.js b/toolkit/mozapps/extensions/test/xpcshell/test_install.js index 21283692f8f..bcc153a673a 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_install.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_install.js @@ -1678,7 +1678,52 @@ function check_test_28(install) { function finish_test_28(install) { prepare_test({}, [ "onDownloadCancelled" - ], do_test_finished); + ], run_test_29); install.cancel(); } + +// Tests that an install with a matching compatibility override has appDisabled +// set correctly. +function run_test_29() { + Services.prefs.setBoolPref("extensions.getAddons.cache.enabled", true); + + prepare_test({ }, [ + "onNewInstall" + ]); + + let url = "http://localhost:4444/addons/test_install6.xpi"; + AddonManager.getInstallForURL(url, function(install) { + ensure_test_completed(); + + do_check_neq(install, null); + do_check_eq(install.version, "1.0"); + do_check_eq(install.name, "Addon Test 6"); + do_check_eq(install.state, AddonManager.STATE_AVAILABLE); + + AddonManager.getInstallsByTypes(null, function(activeInstalls) { + do_check_eq(activeInstalls.length, 1); + do_check_eq(activeInstalls[0], install); + + prepare_test({}, [ + "onDownloadStarted", + "onDownloadEnded" + ], check_test_29); + install.install(); + }); + }, "application/x-xpinstall", null, "Addon Test 6", null, "1.0"); +} + +function check_test_29(install) { + //ensure_test_completed(); + do_check_eq(install.state, AddonManager.STATE_DOWNLOADED); + do_check_neq(install.addon, null); + do_check_false(install.addon.isCompatible); + do_check_true(install.addon.appDisabled); + + prepare_test({}, [ + "onDownloadCancelled" + ], do_test_finished); + install.cancel(); + return false; +} diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index b916a5c97cb..7383c0b000b 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -1374,7 +1374,7 @@ GraphWalker::DoWalk(nsDeque &aQueue) class nsCycleCollectorLogger : public nsICycleCollectorListener { public: - nsCycleCollectorLogger() : mStream(nsnull) + nsCycleCollectorLogger() : mStream(nsnull), mWantAllTraces(false) { } ~nsCycleCollectorLogger() @@ -1385,6 +1385,19 @@ public: } NS_DECL_ISUPPORTS + NS_IMETHOD AllTraces(nsICycleCollectorListener** aListener) + { + mWantAllTraces = true; + NS_ADDREF(*aListener = this); + return NS_OK; + } + + NS_IMETHOD GetWantAllTraces(bool* aAllTraces) + { + *aAllTraces = mWantAllTraces; + return NS_OK; + } + NS_IMETHOD Begin() { char name[MAXPATHLEN] = {'\0'}; @@ -1456,6 +1469,7 @@ public: private: FILE *mStream; + bool mWantAllTraces; static PRUint32 gLogCounter; }; @@ -1584,15 +1598,22 @@ GCGraphBuilder::GCGraphBuilder(GCGraph &aGraph, if (!PL_DHashTableInit(&mPtrToNodeMap, &PtrNodeOps, nsnull, sizeof(PtrToNodeEntry), 32768)) mPtrToNodeMap.ops = nsnull; - // We want all edges and all info if DEBUG_CC is set or if we have a - // listener. Do we want them all the time? -#ifndef DEBUG_CC - if (mListener) + + PRUint32 flags = 0; +#ifdef DEBUG_CC + flags = nsCycleCollectionTraversalCallback::WANT_DEBUG_INFO | + nsCycleCollectionTraversalCallback::WANT_ALL_TRACES; #endif - { - mFlags |= nsCycleCollectionTraversalCallback::WANT_DEBUG_INFO | - nsCycleCollectionTraversalCallback::WANT_ALL_TRACES; + if (!flags && mListener) { + flags = nsCycleCollectionTraversalCallback::WANT_DEBUG_INFO; + bool all = false; + mListener->GetWantAllTraces(&all); + if (all) { + flags |= nsCycleCollectionTraversalCallback::WANT_ALL_TRACES; + } } + + mFlags |= flags; } GCGraphBuilder::~GCGraphBuilder() diff --git a/xpcom/base/nsICycleCollectorListener.idl b/xpcom/base/nsICycleCollectorListener.idl index 53d6e238da0..69e9c9d77d2 100644 --- a/xpcom/base/nsICycleCollectorListener.idl +++ b/xpcom/base/nsICycleCollectorListener.idl @@ -49,9 +49,13 @@ * a call to end(). If begin() returns an error none of the other * functions will be called. */ -[scriptable, uuid(3f3901bb-6a1c-4998-b32e-6f10a51db470)] +[scriptable, uuid(35a3a9b0-a120-4bf7-9739-46027fe96212)] interface nsICycleCollectorListener : nsISupports { + nsICycleCollectorListener allTraces(); + // false if allTraces() has not been called. + readonly attribute boolean wantAllTraces; + void begin(); void noteRefCountedObject (in unsigned long long aAddress, in unsigned long aRefCount,