зеркало из https://github.com/mozilla/pjs.git
Merge mozilla-inbound with mozilla-central
This commit is contained in:
Коммит
4ba28e6922
|
@ -137,9 +137,12 @@ nsWebMReader::nsWebMReader(nsBuiltinDecoder* aDecoder)
|
||||||
mAudioStartUsec(-1),
|
mAudioStartUsec(-1),
|
||||||
mAudioFrames(0),
|
mAudioFrames(0),
|
||||||
mHasVideo(false),
|
mHasVideo(false),
|
||||||
mHasAudio(false)
|
mHasAudio(false),
|
||||||
|
mForceStereoMode(0)
|
||||||
{
|
{
|
||||||
MOZ_COUNT_CTOR(nsWebMReader);
|
MOZ_COUNT_CTOR(nsWebMReader);
|
||||||
|
|
||||||
|
Preferences::GetInt("media.webm.force_stereo_mode", &mForceStereoMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsWebMReader::~nsWebMReader()
|
nsWebMReader::~nsWebMReader()
|
||||||
|
@ -306,10 +309,7 @@ nsresult nsWebMReader::ReadMetadata(nsVideoInfo* aInfo)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
PRInt32 forceStereoMode;
|
switch (mForceStereoMode) {
|
||||||
if (NS_SUCCEEDED(Preferences::GetInt("media.webm.force_stereo_mode",
|
|
||||||
&forceStereoMode))) {
|
|
||||||
switch (forceStereoMode) {
|
|
||||||
case 1:
|
case 1:
|
||||||
mInfo.mStereoMode = STEREO_MODE_LEFT_RIGHT;
|
mInfo.mStereoMode = STEREO_MODE_LEFT_RIGHT;
|
||||||
break;
|
break;
|
||||||
|
@ -326,7 +326,6 @@ nsresult nsWebMReader::ReadMetadata(nsVideoInfo* aInfo)
|
||||||
mInfo.mStereoMode = STEREO_MODE_MONO;
|
mInfo.mStereoMode = STEREO_MODE_MONO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (!mHasAudio && type == NESTEGG_TRACK_AUDIO) {
|
else if (!mHasAudio && type == NESTEGG_TRACK_AUDIO) {
|
||||||
nestegg_audio_params params;
|
nestegg_audio_params params;
|
||||||
r = nestegg_track_audio_params(mContext, track, ¶ms);
|
r = nestegg_track_audio_params(mContext, track, ¶ms);
|
||||||
|
|
|
@ -240,6 +240,10 @@ private:
|
||||||
// Booleans to indicate if we have audio and/or video data
|
// Booleans to indicate if we have audio and/or video data
|
||||||
bool mHasVideo;
|
bool mHasVideo;
|
||||||
bool mHasAudio;
|
bool mHasAudio;
|
||||||
|
|
||||||
|
// Value of the "media.webm.force_stereo_mode" pref, which we need off the
|
||||||
|
// main thread.
|
||||||
|
PRInt32 mForceStereoMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
.mediaControlsFrame {
|
.mediaControlsFrame {
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
/* Prevent unwanted style inheritance. See bug 554717. */
|
/* Prevent unwanted style inheritance. See bug 554717. */
|
||||||
|
text-align: left;
|
||||||
list-style-image: none !important;
|
list-style-image: none !important;
|
||||||
font: normal normal normal 100%/normal sans-serif !important;
|
font: normal normal normal 100%/normal sans-serif !important;
|
||||||
text-decoration: none !important;
|
text-decoration: none !important;
|
||||||
|
|
|
@ -1257,8 +1257,10 @@ var AddonRepository = {
|
||||||
// Parses addon_compatibility nodes, that describe compatibility overrides.
|
// Parses addon_compatibility nodes, that describe compatibility overrides.
|
||||||
_parseAddonCompatElement: function(aResultObj, aElement) {
|
_parseAddonCompatElement: function(aResultObj, aElement) {
|
||||||
let guid = this._getDescendantTextContent(aElement, "guid");
|
let guid = this._getDescendantTextContent(aElement, "guid");
|
||||||
if (!guid)
|
if (!guid) {
|
||||||
|
LOG("Compatibility override is missing guid.");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let compat = {id: guid};
|
let compat = {id: guid};
|
||||||
compat.hosted = aElement.getAttribute("hosted") != "false";
|
compat.hosted = aElement.getAttribute("hosted") != "false";
|
||||||
|
@ -1292,21 +1294,31 @@ var AddonRepository = {
|
||||||
function parseRangeNode(aNode) {
|
function parseRangeNode(aNode) {
|
||||||
let type = aNode.getAttribute("type");
|
let type = aNode.getAttribute("type");
|
||||||
// Only "incompatible" (blacklisting) is supported for now.
|
// Only "incompatible" (blacklisting) is supported for now.
|
||||||
if (type != "incompatible")
|
if (type != "incompatible") {
|
||||||
|
LOG("Compatibility override of unsupported type found.");
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
let override = new AddonManagerPrivate.AddonCompatibilityOverride(type);
|
let override = new AddonManagerPrivate.AddonCompatibilityOverride(type);
|
||||||
|
|
||||||
override.minVersion = this._getDirectDescendantTextContent(aNode, "min_version");
|
override.minVersion = this._getDirectDescendantTextContent(aNode, "min_version");
|
||||||
override.maxVersion = this._getDirectDescendantTextContent(aNode, "max_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;
|
return null;
|
||||||
|
}
|
||||||
|
if (!override.maxVersion) {
|
||||||
|
LOG("Compatibility override is missing max_version.");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
let appRanges = aNode.querySelectorAll("compatible_applications > application");
|
let appRanges = aNode.querySelectorAll("compatible_applications > application");
|
||||||
let appRange = findMatchingAppRange.bind(this)(appRanges);
|
let appRange = findMatchingAppRange.bind(this)(appRanges);
|
||||||
if (!appRange)
|
if (!appRange) {
|
||||||
|
LOG("Compatibility override is missing a valid application range.");
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
override.appID = appRange.appID;
|
override.appID = appRange.appID;
|
||||||
override.appMinVersion = appRange.appMinVersion;
|
override.appMinVersion = appRange.appMinVersion;
|
||||||
|
|
|
@ -6148,6 +6148,7 @@ AddonInstall.prototype = {
|
||||||
if (aRepoAddon) {
|
if (aRepoAddon) {
|
||||||
aAddon._repositoryAddon = aRepoAddon;
|
aAddon._repositoryAddon = aRepoAddon;
|
||||||
aAddon.compatibilityOverrides = aRepoAddon.compatibilityOverrides;
|
aAddon.compatibilityOverrides = aRepoAddon.compatibilityOverrides;
|
||||||
|
aAddon.appDisabled = !isUsableAddon(aAddon);
|
||||||
aCallback();
|
aCallback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -6159,6 +6160,7 @@ AddonInstall.prototype = {
|
||||||
aAddon.compatibilityOverrides = aRepoAddon ?
|
aAddon.compatibilityOverrides = aRepoAddon ?
|
||||||
aRepoAddon.compatibilityOverrides :
|
aRepoAddon.compatibilityOverrides :
|
||||||
null;
|
null;
|
||||||
|
aAddon.appDisabled = !isUsableAddon(aAddon);
|
||||||
aCallback();
|
aCallback();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<!-- An extension that has a compatibility override making it incompatible. -->
|
||||||
|
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
|
||||||
|
|
||||||
|
<Description about="urn:mozilla:install-manifest">
|
||||||
|
<em:id>addon6@tests.mozilla.org</em:id>
|
||||||
|
<em:version>1.0</em:version>
|
||||||
|
|
||||||
|
<!-- Front End MetaData -->
|
||||||
|
<em:name>Addon Test 6</em:name>
|
||||||
|
<em:description>Test Description</em:description>
|
||||||
|
|
||||||
|
<em:targetApplication>
|
||||||
|
<Description>
|
||||||
|
<em:id>xpcshell@tests.mozilla.org</em:id>
|
||||||
|
<em:minVersion>1</em:minVersion>
|
||||||
|
<em:maxVersion>1</em:maxVersion>
|
||||||
|
</Description>
|
||||||
|
</em:targetApplication>
|
||||||
|
|
||||||
|
</Description>
|
||||||
|
</RDF>
|
|
@ -31,4 +31,23 @@
|
||||||
<compatible_os>ALL</compatible_os>
|
<compatible_os>ALL</compatible_os>
|
||||||
<install size="2">http://example.com/browser/toolkit/mozapps/extensions/test/browser/addons/browser_install1_2.xpi</install>
|
<install size="2">http://example.com/browser/toolkit/mozapps/extensions/test/browser/addons/browser_install1_2.xpi</install>
|
||||||
</addon>
|
</addon>
|
||||||
|
|
||||||
|
<addon_compatibility hosted="false">
|
||||||
|
<guid>addon6@tests.mozilla.org</guid>
|
||||||
|
<name>Addon Test 6</name>
|
||||||
|
<version_ranges>
|
||||||
|
<version_range type="incompatible">
|
||||||
|
<min_version>1.0</min_version>
|
||||||
|
<max_version>1.0</max_version>
|
||||||
|
<compatible_applications>
|
||||||
|
<application>
|
||||||
|
<name>XPCShell</name>
|
||||||
|
<min_version>1.0</min_version>
|
||||||
|
<max_version>1.0</max_version>
|
||||||
|
<appID>xpcshell@tests.mozilla.org</appID>
|
||||||
|
</application>
|
||||||
|
</compatible_applications>
|
||||||
|
</version_range>
|
||||||
|
</version_ranges>
|
||||||
|
</addon_compatibility>
|
||||||
</searchresults>
|
</searchresults>
|
||||||
|
|
|
@ -1678,7 +1678,52 @@ function check_test_28(install) {
|
||||||
function finish_test_28(install) {
|
function finish_test_28(install) {
|
||||||
prepare_test({}, [
|
prepare_test({}, [
|
||||||
"onDownloadCancelled"
|
"onDownloadCancelled"
|
||||||
], do_test_finished);
|
], run_test_29);
|
||||||
|
|
||||||
install.cancel();
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -1374,7 +1374,7 @@ GraphWalker<Visitor>::DoWalk(nsDeque &aQueue)
|
||||||
class nsCycleCollectorLogger : public nsICycleCollectorListener
|
class nsCycleCollectorLogger : public nsICycleCollectorListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsCycleCollectorLogger() : mStream(nsnull)
|
nsCycleCollectorLogger() : mStream(nsnull), mWantAllTraces(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
~nsCycleCollectorLogger()
|
~nsCycleCollectorLogger()
|
||||||
|
@ -1385,6 +1385,19 @@ public:
|
||||||
}
|
}
|
||||||
NS_DECL_ISUPPORTS
|
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()
|
NS_IMETHOD Begin()
|
||||||
{
|
{
|
||||||
char name[MAXPATHLEN] = {'\0'};
|
char name[MAXPATHLEN] = {'\0'};
|
||||||
|
@ -1456,6 +1469,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FILE *mStream;
|
FILE *mStream;
|
||||||
|
bool mWantAllTraces;
|
||||||
|
|
||||||
static PRUint32 gLogCounter;
|
static PRUint32 gLogCounter;
|
||||||
};
|
};
|
||||||
|
@ -1584,15 +1598,22 @@ GCGraphBuilder::GCGraphBuilder(GCGraph &aGraph,
|
||||||
if (!PL_DHashTableInit(&mPtrToNodeMap, &PtrNodeOps, nsnull,
|
if (!PL_DHashTableInit(&mPtrToNodeMap, &PtrNodeOps, nsnull,
|
||||||
sizeof(PtrToNodeEntry), 32768))
|
sizeof(PtrToNodeEntry), 32768))
|
||||||
mPtrToNodeMap.ops = nsnull;
|
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?
|
PRUint32 flags = 0;
|
||||||
#ifndef DEBUG_CC
|
#ifdef DEBUG_CC
|
||||||
if (mListener)
|
flags = nsCycleCollectionTraversalCallback::WANT_DEBUG_INFO |
|
||||||
#endif
|
|
||||||
{
|
|
||||||
mFlags |= nsCycleCollectionTraversalCallback::WANT_DEBUG_INFO |
|
|
||||||
nsCycleCollectionTraversalCallback::WANT_ALL_TRACES;
|
nsCycleCollectionTraversalCallback::WANT_ALL_TRACES;
|
||||||
|
#endif
|
||||||
|
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()
|
GCGraphBuilder::~GCGraphBuilder()
|
||||||
|
|
|
@ -49,9 +49,13 @@
|
||||||
* a call to end(). If begin() returns an error none of the other
|
* a call to end(). If begin() returns an error none of the other
|
||||||
* functions will be called.
|
* functions will be called.
|
||||||
*/
|
*/
|
||||||
[scriptable, uuid(3f3901bb-6a1c-4998-b32e-6f10a51db470)]
|
[scriptable, uuid(35a3a9b0-a120-4bf7-9739-46027fe96212)]
|
||||||
interface nsICycleCollectorListener : nsISupports
|
interface nsICycleCollectorListener : nsISupports
|
||||||
{
|
{
|
||||||
|
nsICycleCollectorListener allTraces();
|
||||||
|
// false if allTraces() has not been called.
|
||||||
|
readonly attribute boolean wantAllTraces;
|
||||||
|
|
||||||
void begin();
|
void begin();
|
||||||
void noteRefCountedObject (in unsigned long long aAddress,
|
void noteRefCountedObject (in unsigned long long aAddress,
|
||||||
in unsigned long aRefCount,
|
in unsigned long aRefCount,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче