Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
Roy Tam 2020-05-09 07:01:19 +08:00
commit bd1e07b203
33 changed files with 163 additions and 449 deletions

View file

@ -1044,12 +1044,7 @@ BrowserGlue.prototype = {
});
}
let signingRequired;
if (AppConstants.MOZ_REQUIRE_SIGNING) {
signingRequired = true;
} else {
signingRequired = Services.prefs.getBoolPref("xpinstall.signatures.required");
}
let signingRequired = Services.prefs.getBoolPref("xpinstall.signatures.required");
if (signingRequired) {
let disabledAddons = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_DISABLED);

View file

@ -64,7 +64,3 @@ if test "$OS_ARCH" = "WINNT" -o \
"$OS_ARCH" = "Darwin"; then
MOZ_CAN_DRAW_IN_TITLEBAR=1
fi
# Disable checking that add-ons are signed by the trusted root
MOZ_ADDON_SIGNING=0
MOZ_REQUIRE_SIGNING=0

View file

@ -38,7 +38,7 @@ if test -n "$USE_ICU"; then
dnl We also don't do it on Windows because sometimes the file goes
dnl missing -- possibly due to overzealous antivirus software? --
dnl which prevents the browser from starting up :(
if test -z "$JS_STANDALONE" -a "$OS_TARGET" != WINNT -a "$MOZ_WIDGET_TOOLKIT" != "android"; then
if test -z "$JS_STANDALONE"; then
MOZ_ICU_DATA_ARCHIVE=1
else
MOZ_ICU_DATA_ARCHIVE=

View file

@ -91,7 +91,7 @@ const Curl = {
if (utils.isUrlEncodedRequest(data) ||
["PUT", "POST", "PATCH"].includes(data.method)) {
postDataText = data.postDataText;
addPostData("--data");
addPostData("--data-raw");
addPostData(utils.writePostDataTextParams(postDataText));
ignoredHeaders.add("content-length");
} else if (multipartRequest) {
@ -400,7 +400,12 @@ const CurlUtils = {
* Credit: Google DevTools
*/
escapeStringWin: function (str) {
/* Replace quote by double quote (but not by \") because it is
/*
Replace dollar sign because of commands (e.g $(cmd.exe)) in
powershell when using double quotes.
Useful details http://www.rlmueller.net/PowerShellEscape.htm
Replace quote by double quote (but not by \") because it is
recognized by both cmd.exe and MS Crt arguments parser.
Replace % by "%" because it could be expanded to an environment
@ -414,7 +419,8 @@ const CurlUtils = {
Replace new line outside of quotes since cmd.exe doesn't let
to do it inside.
*/
return "\"" + str.replace(/"/g, "\"\"")
return "\"" + str.replace(/\$/g, "`$")
.replace(/"/g, "\"\"")
.replace(/%/g, "\"%\"")
.replace(/\\/g, "\\\\")
.replace(/[\r\n]+/g, "\"^$&\"") + "\"";

View file

@ -8,6 +8,7 @@
#define mozilla_dom_ElementInlines_h
#include "mozilla/dom/Element.h"
#include "nsIContentInlines.h"
#include "nsIDocument.h"
namespace mozilla {

View file

@ -45,9 +45,6 @@ extern bool IsCurrentThreadRunningChromeWorker();
static char *sPopupAllowedEvents;
static bool sReturnHighResTimeStamp = false;
static bool sReturnHighResTimeStampIsSet = false;
Event::Event(EventTarget* aOwner,
nsPresContext* aPresContext,
WidgetEvent* aEvent)
@ -68,13 +65,6 @@ Event::ConstructorInit(EventTarget* aOwner,
SetOwner(aOwner);
mIsMainThreadEvent = NS_IsMainThread();
if (mIsMainThreadEvent && !sReturnHighResTimeStampIsSet) {
Preferences::AddBoolVarCache(&sReturnHighResTimeStamp,
"dom.event.highrestimestamp.enabled",
sReturnHighResTimeStamp);
sReturnHighResTimeStampIsSet = true;
}
mPrivateDataDuplicated = false;
mWantsPopupControlCheck = false;
@ -1093,10 +1083,6 @@ Event::TimeStamp() const
double
Event::TimeStampImpl() const
{
if (!sReturnHighResTimeStamp) {
return static_cast<double>(mEvent->mTime);
}
if (mEvent->mTimeStamp.IsNull()) {
return 0.0;
}

View file

@ -35,12 +35,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=77992
SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged");
// We don't use SpecialPowers.pushPrefEnv since it can delay the test
// function until after the load event has fired which means we can't
// test the timestamp of the load event.
const kPrefName = "dom.event.highrestimestamp.enabled";
var prevPrefValue = SpecialPowers.getBoolPref(kPrefName);
SpecialPowers.setBoolPref(kPrefName, true);
testRegularEvents();
// Event.timeStamp should be relative to the time origin which is:

View file

@ -127,58 +127,37 @@ public:
MediaResult IsInitSegmentPresent(MediaByteBuffer* aData) override
{
ContainerParser::IsInitSegmentPresent(aData);
// XXX: This is overly primitive, needs to collect data as it's appended
// to the SB and handle, rather than assuming everything is present in a
// single aData segment.
// 0x1a45dfa3 // EBML
// ...
// DocType == "webm"
// ...
// 0x18538067 // Segment (must be "unknown" size or contain a value large
// enough to include the Segment Information and Tracks
// elements that follow)
// 0x1549a966 // -> Segment Info
// 0x1654ae6b // -> One or more Tracks
// 0x1a45dfa3 // EBML
if (aData->Length() < 4) {
return NS_ERROR_NOT_AVAILABLE;
}
if ((*aData)[0] == 0x1a && (*aData)[1] == 0x45 && (*aData)[2] == 0xdf &&
(*aData)[3] == 0xa3) {
return NS_OK;
WebMBufferedParser parser(0);
nsTArray<WebMTimeDataOffset> mapping;
ReentrantMonitor dummy("dummy");
bool result = parser.Append(aData->Elements(), aData->Length(), mapping,
dummy);
if (!result) {
return MediaResult(NS_ERROR_FAILURE, RESULT_DETAIL("Invalid webm content"));
}
return MediaResult(NS_ERROR_FAILURE, RESULT_DETAIL("Invalid webm content"));
return parser.mInitEndOffset > 0 ? NS_OK : NS_ERROR_NOT_AVAILABLE;
}
MediaResult IsMediaSegmentPresent(MediaByteBuffer* aData) override
{
ContainerParser::IsMediaSegmentPresent(aData);
// XXX: This is overly primitive, needs to collect data as it's appended
// to the SB and handle, rather than assuming everything is present in a
// single aData segment.
// 0x1a45dfa3 // EBML
// ...
// DocType == "webm"
// ...
// 0x18538067 // Segment (must be "unknown" size)
// 0x1549a966 // -> Segment Info
// 0x1654ae6b // -> One or more Tracks
// 0x1f43b675 // Cluster
if (aData->Length() < 4) {
return NS_ERROR_NOT_AVAILABLE;
}
if ((*aData)[0] == 0x1f && (*aData)[1] == 0x43 && (*aData)[2] == 0xb6 &&
(*aData)[3] == 0x75) {
return NS_OK;
WebMBufferedParser parser(0);
nsTArray<WebMTimeDataOffset> mapping;
ReentrantMonitor dummy("dummy");
parser.AppendMediaSegmentOnly();
bool result = parser.Append(aData->Elements(), aData->Length(), mapping,
dummy);
if (!result) {
return MediaResult(NS_ERROR_FAILURE, RESULT_DETAIL("Invalid webm content"));
}
// 0x1c53bb6b // Cues
if ((*aData)[0] == 0x1c && (*aData)[1] == 0x53 && (*aData)[2] == 0xbb &&
(*aData)[3] == 0x6b) {
return NS_OK;
}
return MediaResult(NS_ERROR_FAILURE, RESULT_DETAIL("Invalid webm content"));
return parser.GetClusterOffset() >= 0 ? NS_OK : NS_ERROR_NOT_AVAILABLE;
}
MediaResult ParseStartAndEndTimestamps(MediaByteBuffer* aData,

View file

@ -254,8 +254,6 @@ void
AudioBuffer::CopyFromChannel(const Float32Array& aDestination, uint32_t aChannelNumber,
uint32_t aStartInChannel, ErrorResult& aRv)
{
aDestination.ComputeLengthAndData();
uint32_t length = aDestination.Length();
CheckedInt<uint32_t> end = aStartInChannel;
end += length;
@ -266,6 +264,7 @@ AudioBuffer::CopyFromChannel(const Float32Array& aDestination, uint32_t aChannel
}
JS::AutoCheckCannotGC nogc;
aDestination.ComputeLengthAndData();
JSObject* channelArray = mJSChannels[aChannelNumber];
const float* sourceData = nullptr;
if (channelArray) {
@ -296,8 +295,6 @@ AudioBuffer::CopyToChannel(JSContext* aJSContext, const Float32Array& aSource,
uint32_t aChannelNumber, uint32_t aStartInChannel,
ErrorResult& aRv)
{
aSource.ComputeLengthAndData();
uint32_t length = aSource.Length();
CheckedInt<uint32_t> end = aStartInChannel;
end += length;
@ -320,6 +317,7 @@ AudioBuffer::CopyToChannel(JSContext* aJSContext, const Float32Array& aSource,
return;
}
aSource.ComputeLengthAndData();
bool isShared = false;
float* channelData = JS_GetFloat32ArrayData(channelArray, &isShared, nogc);
// The channelData arrays should all have originated in

View file

@ -113,6 +113,7 @@ bool WebMBufferedParser::Append(const unsigned char* aBuffer, uint32_t aLength,
} else {
mClusterEndOffset = -1;
}
mGotClusterTimecode = false;
mState = READ_ELEMENT_ID;
break;
case BLOCKGROUP_ID:
@ -121,6 +122,11 @@ bool WebMBufferedParser::Append(const unsigned char* aBuffer, uint32_t aLength,
case SIMPLEBLOCK_ID:
/* FALLTHROUGH */
case BLOCK_ID:
if (!mGotClusterTimecode) {
WEBM_DEBUG("The Timecode element must appear before any Block or "
"SimpleBlock elements in a Cluster");
return false;
}
mBlockSize = mElement.mSize.mValue;
mBlockTimecode = 0;
mBlockTimecodeLength = BLOCK_TIMECODE_LENGTH;
@ -164,6 +170,7 @@ bool WebMBufferedParser::Append(const unsigned char* aBuffer, uint32_t aLength,
break;
case READ_TIMECODESCALE:
if (!mGotTimecodeScale) {
WEBM_DEBUG("Should get the SegmentInfo first");
return false;
}
mTimecodeScale = mVInt.mValue;
@ -171,6 +178,7 @@ bool WebMBufferedParser::Append(const unsigned char* aBuffer, uint32_t aLength,
break;
case READ_CLUSTER_TIMECODE:
mClusterTimecode = mVInt.mValue;
mGotClusterTimecode = true;
mState = READ_ELEMENT_ID;
break;
case READ_BLOCK_TIMECODE:
@ -190,6 +198,7 @@ bool WebMBufferedParser::Append(const unsigned char* aBuffer, uint32_t aLength,
// Don't insert invalid negative timecodes.
if (mBlockTimecode >= 0 || mClusterTimecode >= uint16_t(abs(mBlockTimecode))) {
if (!mGotTimecodeScale) {
WEBM_DEBUG("Should get the TimecodeScale first");
return false;
}
uint64_t absTimecode = mClusterTimecode + mBlockTimecode;
@ -266,6 +275,12 @@ WebMBufferedParser::EndSegmentOffset(int64_t aOffset)
return mBlockEndOffset;
}
int64_t
WebMBufferedParser::GetClusterOffset() const
{
return mClusterOffset;
}
// SyncOffsetComparator and TimeComparator are slightly confusing, in that
// the nsTArray they're used with (mTimeMapping) is sorted by mEndOffset and
// these comparators are used on the other fields of WebMTimeDataOffset.

View file

@ -67,7 +67,7 @@ struct WebMBufferedParser
, mVIntLeft(0)
, mBlockSize(0)
, mClusterTimecode(0)
, mClusterOffset(0)
, mClusterOffset(-1)
, mClusterEndOffset(-1)
, mBlockOffset(0)
, mBlockTimecode(0)
@ -75,6 +75,7 @@ struct WebMBufferedParser
, mSkipBytes(0)
, mTimecodeScale(1000000)
, mGotTimecodeScale(false)
, mGotClusterTimecode(false)
{
if (mStartOffset != 0) {
mState = FIND_CLUSTER_SYNC;
@ -86,6 +87,12 @@ struct WebMBufferedParser
return mTimecodeScale;
}
// Use this function when we would only feed media segment for the parser.
void AppendMediaSegmentOnly()
{
mGotTimecodeScale = true;
}
// If this parser is not expected to parse a segment info, it must be told
// the appropriate timecode scale to use from elsewhere.
void SetTimecodeScale(uint32_t aTimecodeScale) {
@ -114,6 +121,9 @@ struct WebMBufferedParser
// This allows to determine the end of the interval containg aOffset.
int64_t EndSegmentOffset(int64_t aOffset);
// Return the Cluster offset, return -1 if we can't find the Cluster.
int64_t GetClusterOffset() const;
// The offset at which this parser started parsing. Used to merge
// adjacent parsers, in which case the later parser adopts the earlier
// parser's mStartOffset.
@ -231,7 +241,7 @@ private:
// Start offset of the cluster currently being parsed. Used as the sync
// point offset for the offset-to-time mapping as each block timecode is
// been parsed.
// been parsed. -1 if unknown.
int64_t mClusterOffset;
// End offset of the cluster currently being parsed. -1 if unknown.
@ -260,6 +270,9 @@ private:
// True if we read the timecode scale from the segment info or have
// confirmed that the default value is to be used.
bool mGotTimecodeScale;
// True if we've read the cluster time code.
bool mGotClusterTimecode;
};
class WebMBufferedState final

View file

@ -236,14 +236,10 @@ function sanityCheckEvent(evt)
is(evt.eventPhase, evt.AT_TARGET);
is(evt.bubbles, false, "Event should not bubble");
is(evt.cancelable, false, "Event should not be cancelable");
if (SpecialPowers.getBoolPref("dom.event.highrestimestamp.enabled")) {
var now = window.performance.now();
ok(evt.timeStamp > 0 && evt.timeStamp < now,
"Event timeStamp (" + evt.timeStamp + ") should be > 0 but " +
"before the current time (" + now + ")");
} else {
is(evt.timeStamp, 0, "Event timeStamp should be 0");
}
var now = window.performance.now();
ok(evt.timeStamp > 0 && evt.timeStamp < now,
"Event timeStamp (" + evt.timeStamp + ") should be > 0 but " +
"before the current time (" + now + ")");
ok(evt.view !== null, "Event view not set");
}

View file

@ -448,6 +448,15 @@ URLSearchParams::GetValueAtIndex(uint32_t aIndex) const
return mParams->GetValueAtIndex(aIndex);
}
void
URLSearchParams::Sort(ErrorResult& aRv)
{
aRv = mParams->Sort();
if (!aRv.Failed()) {
NotifyObserver();
}
}
// Helper functions for structured cloning
inline bool
ReadString(JSStructuredCloneReader* aReader, nsString& aString)
@ -472,6 +481,39 @@ ReadString(JSStructuredCloneReader* aReader, nsString& aString)
return true;
}
nsresult
URLParams::Sort()
{
// Unfortunately we cannot use nsTArray<>.Sort() because it doesn't keep the
// correct order of the values for equal keys.
// Let's sort the keys, without duplicates.
FallibleTArray<nsString> keys;
for (const Param& param : mParams) {
if (!keys.Contains(param.mKey) &&
!keys.InsertElementSorted(param.mKey, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
}
FallibleTArray<Param> params;
// Here we recreate the array starting from the sorted keys.
for (uint32_t keyId = 0, keysLength = keys.Length(); keyId < keysLength;
++keyId) {
const nsString& key = keys[keyId];
for (const Param& param : mParams) {
if (param.mKey.Equals(key) &&
!params.AppendElement(param, fallible)) {
return NS_ERROR_OUT_OF_MEMORY;
}
}
}
mParams.SwapElements(params);
return NS_OK;
}
inline bool
WriteString(JSStructuredCloneWriter* aWriter, const nsString& aString)
{

View file

@ -70,7 +70,7 @@ public:
void Get(const nsAString& aName, nsString& aRetval);
void GetAll(const nsAString& aName, nsTArray<nsString >& aRetval);
void GetAll(const nsAString& aName, nsTArray<nsString>& aRetval);
void Set(const nsAString& aName, const nsAString& aValue);
@ -103,6 +103,8 @@ public:
return mParams[aIndex].mValue;
}
nsresult Sort();
bool
ReadStructuredClone(JSStructuredCloneReader* aReader);
@ -171,6 +173,8 @@ public:
const nsAString& GetKeyAtIndex(uint32_t aIndex) const;
const nsAString& GetValueAtIndex(uint32_t aIndex) const;
void Sort(ErrorResult& aRv);
void Stringify(nsString& aRetval) const
{
Serialize(aRetval);

View file

@ -22,6 +22,10 @@ interface URLSearchParams {
sequence<USVString> getAll(USVString name);
boolean has(USVString name);
void set(USVString name, USVString value);
[Throws]
void sort();
iterable<USVString, USVString>;
stringifier;
};

View file

@ -67,21 +67,11 @@ function runTests()
"input event is fired on unexpected element: " + aEvent.target.tagName);
ok(!aEvent.cancelable, "input event must not be cancelable");
ok(aEvent.bubbles, "input event must be bubbles");
if (SpecialPowers.getBoolPref("dom.event.highrestimestamp.enabled")) {
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
} else {
var eventTime = new Date(aEvent.timeStamp);
var duration = Math.abs(Date.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" +
eventTime.toLocaleString() +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
}
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
inputEvent = aEvent;
};

View file

@ -41,21 +41,11 @@ function runTests()
"input event is fired on unexpected element: " + aEvent.target.tagName);
ok(!aEvent.cancelable, "input event must not be cancelable");
ok(aEvent.bubbles, "input event must be bubbles");
if (SpecialPowers.getBoolPref("dom.event.highrestimestamp.enabled")) {
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
} else {
var eventTime = new Date(aEvent.timeStamp);
var duration = Math.abs(Date.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" +
eventTime.toLocaleString() +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
}
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
inputEvent = aEvent;
};

View file

@ -11,7 +11,6 @@
#include "mozilla/layers/ContentHost.h"
#include "mozilla/layers/Effects.h"
#include "nsWindowsHelpers.h"
#include "Nv3DVUtils.h"
#include "gfxFailure.h"
#include "mozilla/layers/LayerManagerComposite.h"
#include "gfxPrefs.h"
@ -426,44 +425,6 @@ CompositorD3D9::DrawQuad(const gfx::Rect &aRect,
MOZ_ASSERT(sourceCb->GetD3D9Texture());
MOZ_ASSERT(sourceCr->GetD3D9Texture());
/*
* Send 3d control data and metadata
*/
if (mDeviceManager->GetNv3DVUtils()) {
Nv_Stereo_Mode mode;
switch (source->AsSourceD3D9()->GetStereoMode()) {
case StereoMode::LEFT_RIGHT:
mode = NV_STEREO_MODE_LEFT_RIGHT;
break;
case StereoMode::RIGHT_LEFT:
mode = NV_STEREO_MODE_RIGHT_LEFT;
break;
case StereoMode::BOTTOM_TOP:
mode = NV_STEREO_MODE_BOTTOM_TOP;
break;
case StereoMode::TOP_BOTTOM:
mode = NV_STEREO_MODE_TOP_BOTTOM;
break;
case StereoMode::MONO:
mode = NV_STEREO_MODE_MONO;
break;
}
// Send control data even in mono case so driver knows to leave stereo mode.
mDeviceManager->GetNv3DVUtils()->SendNv3DVControl(mode, true, FIREFOX_3DV_APP_HANDLE);
if (source->AsSourceD3D9()->GetStereoMode() != StereoMode::MONO) {
mDeviceManager->GetNv3DVUtils()->SendNv3DVControl(mode, true, FIREFOX_3DV_APP_HANDLE);
RefPtr<IDirect3DSurface9> renderTarget;
d3d9Device->GetRenderTarget(0, getter_AddRefs(renderTarget));
mDeviceManager->GetNv3DVUtils()->SendNv3DVMetaData((unsigned int)aRect.width,
(unsigned int)aRect.height,
(HANDLE)(sourceY->GetD3D9Texture()),
(HANDLE)(renderTarget));
}
}
// Linear scaling is default here, adhering to mFilter is difficult since
// presumably even with point filtering we'll still want chroma upsampling
// to be linear. In the current approach we can't.

View file

@ -8,7 +8,6 @@
#include "nsIServiceManager.h"
#include "nsIConsoleService.h"
#include "nsPrintfCString.h"
#include "Nv3DVUtils.h"
#include "plstr.h"
#include <algorithm>
#include "gfx2DGlue.h"
@ -263,21 +262,6 @@ DeviceManagerD3D9::Initialize()
return false;
}
if (gfxPrefs::StereoVideoEnabled()) {
/* Create an Nv3DVUtils instance */
if (!mNv3DVUtils) {
mNv3DVUtils = new Nv3DVUtils();
if (!mNv3DVUtils) {
NS_WARNING("Could not create a new instance of Nv3DVUtils.");
}
}
/* Initialize the Nv3DVUtils object */
if (mNv3DVUtils) {
mNv3DVUtils->Initialize();
}
}
HMODULE d3d9 = LoadLibraryW(L"d3d9.dll");
decltype(Direct3DCreate9)* d3d9Create = (decltype(Direct3DCreate9)*)
GetProcAddress(d3d9, "Direct3DCreate9");
@ -385,14 +369,6 @@ DeviceManagerD3D9::Initialize()
/*
* Do some post device creation setup
*/
if (mNv3DVUtils) {
IUnknown* devUnknown = nullptr;
if (mDevice) {
mDevice->QueryInterface(IID_IUnknown, (void **)&devUnknown);
}
mNv3DVUtils->SetDeviceInfo(devUnknown);
}
auto failCreateShaderMsg = "[D3D9] failed to create a critical resource (shader) code";
hr = mDevice->CreateVertexShader((DWORD*)LayerQuadVS,

View file

@ -18,7 +18,6 @@ namespace mozilla {
namespace layers {
class DeviceManagerD3D9;
class Nv3DVUtils;
class Layer;
class TextureSourceD3D9;
@ -179,11 +178,6 @@ public:
// returns the register to be used for the mask texture, if appropriate
uint32_t SetShaderMode(ShaderMode aMode, MaskType aMaskType);
/**
* Return pointer to the Nv3DVUtils instance
*/
Nv3DVUtils *GetNv3DVUtils() { return mNv3DVUtils; }
/**
* Returns true if this device was removed.
*/
@ -338,9 +332,6 @@ private:
/* If this device was removed */
bool mDeviceWasRemoved;
/* Nv3DVUtils instance */
nsAutoPtr<Nv3DVUtils> mNv3DVUtils;
/**
* Verifies all required device capabilities are present.
*/

View file

@ -1,148 +0,0 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* 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 "mozilla/DebugOnly.h"
#include "nsIServiceManager.h"
#include "nsIConsoleService.h"
#include <initguid.h>
#include "Nv3DVUtils.h"
DEFINE_GUID(CLSID_NV3DVStreaming,
0xf7747266, 0x777d, 0x4f61, 0xa1, 0x75, 0xdd, 0x5a, 0xdf, 0x1e, 0x37, 0xdf);
DEFINE_GUID(IID_INV3DVStreaming,
0xf98f9bb2, 0xb914, 0x4d44, 0x98, 0xfa, 0x6e, 0x37, 0x85, 0x16, 0x98, 0x55);
namespace mozilla {
namespace layers {
/**
* Constructor and Destructor
*/
Nv3DVUtils::Nv3DVUtils()
: m3DVStreaming (nullptr)
{
}
Nv3DVUtils::~Nv3DVUtils()
{
UnInitialize();
}
// Silence spurious warnings!
#if defined(WARNING) || defined WARN_IF_FALSE
#error We shouldn't be redefining these!
#endif
// Uncomment these to enable spurious warnings.
//#define WARNING(str) NS_WARNING(str)
//#define WARN_IF_FALSE(b, str) NS_WARNING_ASSERTION(b, str)
#define WARNING(str)
#define WARN_IF_FALSE(b, str)
/**
* Initializes the Nv3DVUtils object.
*/
void
Nv3DVUtils::Initialize()
{
/*
* Detect if 3D Streaming object is already loaded. Do nothing in that case.
*/
if (m3DVStreaming) {
WARNING("Nv3DVStreaming COM object already instantiated.\n");
return;
}
/*
* Create the COM object. If we fail at any stage, just return
*/
HRESULT hr = CoCreateInstance(CLSID_NV3DVStreaming, nullptr, CLSCTX_INPROC_SERVER, IID_INV3DVStreaming, (void**)(getter_AddRefs(m3DVStreaming)));
if (FAILED(hr) || !m3DVStreaming) {
WARNING("Nv3DVStreaming CoCreateInstance failed (disabled).");
return;
}
/*
* Initialize the object. Note that m3DVStreaming cannot be nullptr at this point.
*/
bool bRetVal = m3DVStreaming->Nv3DVInitialize();
if (!bRetVal) {
WARNING("Nv3DVStreaming Nv3DVInitialize failed!");
return;
}
}
/**
* Release resources used by the COM Object, and then release
* the COM Object (nsRefPtr gets released by setting to nullptr)
*
*/
void
Nv3DVUtils::UnInitialize()
{
if (m3DVStreaming) {
m3DVStreaming->Nv3DVRelease();
}
}
/**
* Sets the device info, along with any other initialization that is needed after device creation
* Pass the D3D9 device pointer is an IUnknown input argument.
*/
void
Nv3DVUtils::SetDeviceInfo(IUnknown *devUnknown)
{
if (!devUnknown) {
WARNING("D3D Device Pointer (IUnknown) is nullptr.\n");
return;
}
if (!m3DVStreaming) {
return;
}
bool rv = m3DVStreaming->Nv3DVSetDevice(devUnknown);
if (!rv) {
WARNING("Nv3DVStreaming Nv3DVControl failed!");
return;
}
rv = m3DVStreaming->Nv3DVControl(NV_STEREO_MODE_RIGHT_LEFT, true, FIREFOX_3DV_APP_HANDLE);
WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVControl failed!");
}
/*
* Send Stereo Control Information. Used mainly to re-route
* calls from ImageLayerD3D9 to the 3DV COM object
*/
void
Nv3DVUtils::SendNv3DVControl(Nv_Stereo_Mode eStereoMode, bool bEnableStereo, DWORD dw3DVAppHandle)
{
if (!m3DVStreaming)
return;
DebugOnly<bool> rv = m3DVStreaming->Nv3DVControl(eStereoMode, bEnableStereo, dw3DVAppHandle);
WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVControl failed!");
}
/*
* Send Stereo Metadata. Used mainly to re-route calls
* from ImageLayerD3D9 to the 3DV COM object
*/
void
Nv3DVUtils::SendNv3DVMetaData(unsigned int dwWidth, unsigned int dwHeight, HANDLE hSrcLuma, HANDLE hDst)
{
if (!m3DVStreaming)
return;
DebugOnly<bool> rv = m3DVStreaming->Nv3DVMetaData((DWORD)dwWidth, (DWORD)dwHeight, hSrcLuma, hDst);
WARN_IF_FALSE(rv, "Nv3DVStreaming Nv3DVMetaData failed!");
}
} /* namespace layers */
} /* namespace mozilla */

View file

@ -1,86 +0,0 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* 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 GFX_NV3DVUTILS_H
#define GFX_NV3DVUTILS_H
#include "Layers.h"
#include <windows.h>
#include <d3d9.h>
namespace mozilla {
namespace layers {
#define FIREFOX_3DV_APP_HANDLE 0xECB992B6
enum Nv_Stereo_Mode {
NV_STEREO_MODE_LEFT_RIGHT = 0,
NV_STEREO_MODE_RIGHT_LEFT = 1,
NV_STEREO_MODE_TOP_BOTTOM = 2,
NV_STEREO_MODE_BOTTOM_TOP = 3,
NV_STEREO_MODE_MONO = 4,
NV_STEREO_MODE_LAST = 5
};
class INv3DVStreaming : public IUnknown {
public:
virtual bool Nv3DVInitialize() = 0;
virtual bool Nv3DVRelease() = 0;
virtual bool Nv3DVSetDevice(IUnknown* pDevice) = 0;
virtual bool Nv3DVControl(Nv_Stereo_Mode eStereoMode, bool bEnableStereo, DWORD dw3DVAppHandle) = 0;
virtual bool Nv3DVMetaData(DWORD dwWidth, DWORD dwHeight, HANDLE hSrcLuma, HANDLE hDst) = 0;
};
/*
* Nv3DVUtils class
*/
class Nv3DVUtils {
public:
Nv3DVUtils();
~Nv3DVUtils();
/*
* Initializes the Nv3DVUtils object.
*/
void Initialize();
/*
* Release any resources if needed
*
*/
void UnInitialize();
/*
* Sets the device info, along with any other initialization that is needed after device creation
* Pass the D3D9 device pointer is an IUnknown input argument
*/
void SetDeviceInfo(IUnknown *devUnknown);
/*
* Send Stereo Control Information. Used mainly to re-route
* calls from ImageLayerD3D9 to the 3DV COM object
*/
void SendNv3DVControl(Nv_Stereo_Mode eStereoMode, bool bEnableStereo, DWORD dw3DVAppHandle);
/*
* Send Stereo Metadata. Used mainly to re-route calls
* from ImageLayerD3D9 to the 3DV COM object
*/
void SendNv3DVMetaData(unsigned int dwWidth, unsigned int dwHeight, HANDLE hSrcLuma, HANDLE hDst);
private:
/* Nv3DVStreaming interface pointer */
RefPtr<INv3DVStreaming> m3DVStreaming;
};
} // namespace layers
} // namespace mozilla
#endif /* GFX_NV3DVUTILS_H */

View file

@ -72,7 +72,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
SOURCES += [
'd3d9/CompositorD3D9.cpp',
'd3d9/DeviceManagerD3D9.cpp',
'd3d9/Nv3DVUtils.cpp',
]
if CONFIG['MOZ_ENABLE_D3D10_LAYER']:
EXPORTS.mozilla.layers += [

View file

@ -511,7 +511,6 @@ private:
DECL_GFX_PREF(Live, "layers.progressive-paint", ProgressivePaint, bool, false);
DECL_GFX_PREF(Live, "layers.shared-buffer-provider.enabled", PersistentBufferProviderSharedEnabled, bool, false);
DECL_GFX_PREF(Live, "layers.single-tile.enabled", LayersSingleTileEnabled, bool, true);
DECL_GFX_PREF(Once, "layers.stereo-video.enabled", StereoVideoEnabled, bool, false);
// We allow for configurable and rectangular tile size to avoid wasting memory on devices whose
// screen size does not align nicely to the default tile size. Although layers can be any size,

View file

@ -134,6 +134,7 @@ GetObject(const MDefinition* ins)
case MDefinition::Op_SetArgumentsObjectArg:
case MDefinition::Op_GetFrameArgument:
case MDefinition::Op_SetFrameArgument:
case MDefinition::Op_CreateThis:
case MDefinition::Op_CompareExchangeTypedArrayElement:
case MDefinition::Op_AtomicExchangeTypedArrayElement:
case MDefinition::Op_AtomicTypedArrayElementBinop:

View file

@ -5007,9 +5007,10 @@ class MCreateThis
TRIVIAL_NEW_WRAPPERS
NAMED_OPERANDS((0, getCallee), (1, getNewTarget))
// Although creation of |this| modifies global state, it is safely repeatable.
// Performs a property read from |newTarget| if |newTarget| is a JSFunction
// with an own |.prototype| property.
AliasSet getAliasSet() const override {
return AliasSet::None();
return AliasSet::Load(AliasSet::Any);
}
bool possiblyCalls() const override {
return true;

View file

@ -161,6 +161,11 @@ SOURCES += [
SYMBOLS_FILE = 'avcodec.symbols'
NO_VISIBILITY_FLAGS = True
# GCC 10 defaults -fno-common, we don't care to solve this "properly" yet
# so use GCC < 10 behavior.
if CONFIG['GNU_CC'] and CONFIG['CC_VERSION'] >= '10.0.0':
CFLAGS += ['-fcommon']
USE_LIBS += [
'mozavutil'
]

View file

@ -217,16 +217,17 @@ nsresult nsZipHandle::Init(nsIFile *file, nsZipHandle **ret,
#else
handle->mNSPRFileDesc = fd.forget();
#endif
handle->mMap = map;
handle->mFile.Init(file);
handle->mTotalLen = (uint32_t) size;
handle->mFileStart = buf;
rv = handle->findDataStart();
if (NS_FAILED(rv)) {
PR_MemUnmap(buf, (uint32_t) size);
handle->mFileStart = nullptr;
PR_CloseFileMap(map);
return rv;
}
handle->mMap = map;
handle.forget(ret);
return NS_OK;
}

View file

@ -1247,7 +1247,6 @@ pref("privacy.trackingprotection.pbmode.enabled", false);
pref("dom.event.contextmenu.enabled", true);
pref("dom.event.clipboardevents.enabled", true);
pref("dom.event.highrestimestamp.enabled", true);
pref("dom.webcomponents.enabled", false);

View file

@ -354,6 +354,13 @@ DataChannelConnection::Init(unsigned short aPort, uint16_t aNumStreams, bool aUs
usrsctp_sysctl_set_sctp_blackhole(2);
// ECN is currently not supported by the Firefox code
usrsctp_sysctl_set_sctp_ecn_enable(0);
// Disabling authentication and dynamic address reconfiguration as neither
// of them are used for data channel and only result in additional code
// paths being used.
usrsctp_sysctl_set_sctp_asconf_enable(0);
usrsctp_sysctl_set_sctp_auth_enable(0);
sctp_initialized = true;
RefPtr<DataChannelShutdown> shutdown = new DataChannelShutdown();

View file

@ -2073,7 +2073,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
int init_offset, initack_offset, initack_limit;
int retval;
int error = 0;
uint8_t auth_chunk_buf[SCTP_PARAM_BUFFER_SIZE];
uint8_t auth_chunk_buf[SCTP_CHUNK_BUFFER_SIZE];
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
struct socket *so;
@ -2264,8 +2264,12 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
if (auth_skipped) {
struct sctp_auth_chunk *auth;
auth = (struct sctp_auth_chunk *)
sctp_m_getptr(m, auth_offset, auth_len, auth_chunk_buf);
if (auth_len <= SCTP_CHUNK_BUFFER_SIZE) {
auth = (struct sctp_auth_chunk *)
sctp_m_getptr(m, auth_offset, auth_len, auth_chunk_buf);
} else {
auth = NULL;
}
if ((auth == NULL) || sctp_handle_auth(stcb, auth, m, auth_offset)) {
/* auth HMAC failed, dump the assoc and packet */
SCTPDBG(SCTP_DEBUG_AUTH1,
@ -4655,11 +4659,15 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length,
if (auth_skipped && (stcb != NULL)) {
struct sctp_auth_chunk *auth;
auth = (struct sctp_auth_chunk *)
sctp_m_getptr(m, auth_offset,
if (auth_len <= SCTP_CHUNK_BUFFER_SIZE) {
auth = (struct sctp_auth_chunk *)
sctp_m_getptr(m, auth_offset,
auth_len, chunk_buf);
got_auth = 1;
auth_skipped = 0;
got_auth = 1;
auth_skipped = 0;
} else {
auth = NULL;
}
if ((auth == NULL) || sctp_handle_auth(stcb, auth, m,
auth_offset)) {
/* auth HMAC failed so dump it */

View file

@ -87,8 +87,7 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
DIRS += ['filepicker']
if CONFIG['MOZ_TOOLKIT_SEARCH'] and not CONFIG['MC_BASILISK'] \
and not CONFIG['HYPE_ICEWEASEL'] \
and not CONFIG['HYPE_ICEDOVE']:
and not CONFIG['HYPE_ICEWEASEL']:
DIRS += ['search']
if CONFIG['MOZ_URL_CLASSIFIER']:

View file

@ -455,6 +455,8 @@ NS_IMETHODIMP nsXULWindow::Destroy()
if (mDestroying)
return NS_OK;
nsCOMPtr<nsIXULWindow> kungFuDeathGrip(this);
mozilla::AutoRestore<bool> guard(mDestroying);
mDestroying = true;
@ -467,16 +469,6 @@ NS_IMETHODIMP nsXULWindow::Destroy()
if (parentWindow)
parentWindow->RemoveChildWindow(this);
// let's make sure the window doesn't get deleted out from under us
// while we are trying to close....this can happen if the docshell
// we close ends up being the last owning reference to this xulwindow
// XXXTAB This shouldn't be an issue anymore because the ownership model
// only goes in one direction. When webshell container is fully removed
// try removing this...
nsCOMPtr<nsIXULWindow> placeHolder = this;
// Remove modality (if any) and hide while destroying. More than
// a convenience, the hide prevents user interaction with the partially
// destroyed window. This is especially necessary when the eldest window