This commit is contained in:
Ryan VanderMeulen 2015-06-15 15:55:28 -04:00
Родитель b187c86d0a c366b2c3f3
Коммит 98ebe786fc
125 изменённых файлов: 5303 добавлений и 1435 удалений

Просмотреть файл

@ -32,13 +32,15 @@ ConvertTextAttributeToAtkAttribute(const nsACString& aName,
nsAutoString atkValue;
if (aName.EqualsLiteral("color")) {
// The format of the atk attribute is r,g,b and the gecko one is
// rgb(r,g,b).
atkValue = Substring(aValue, 5, aValue.Length() - 1);
// rgb(r, g, b).
atkValue = Substring(aValue, 4, aValue.Length() - 5);
atkValue.StripWhitespace();
atkName = sAtkTextAttrNames[ATK_TEXT_ATTR_FG_COLOR];
} else if (aName.EqualsLiteral("background-color")) {
// The format of the atk attribute is r,g,b and the gecko one is
// rgb(r,g,b).
atkValue = Substring(aValue, 5, aValue.Length() - 1);
// rgb(r, g, b).
atkValue = Substring(aValue, 4, aValue.Length() - 5);
atkValue.StripWhitespace();
atkName = sAtkTextAttrNames[ATK_TEXT_ATTR_BG_COLOR];
} else if (aName.EqualsLiteral("font-family")) {
atkValue = aValue;

Просмотреть файл

@ -16,6 +16,7 @@ support-files =
title.sjs
[browser_privatebrowsing_DownloadLastDirWithCPS.js]
skip-if = (os == "win" && os_version == "6.2") # bug 1173801
[browser_privatebrowsing_aboutHomeButtonAfterWindowClose.js]
[browser_privatebrowsing_aboutSessionRestore.js]
[browser_privatebrowsing_cache.js]

Просмотреть файл

@ -432,7 +432,7 @@ nsCCUncollectableMarker::Observe(nsISupports* aSubject, const char* aTopic,
switch(sFSState) {
case eUnmarkJSEventListeners: {
nsContentUtils::UnmarkGrayJSListenersInCCGenerationDocuments(sGeneration);
nsContentUtils::UnmarkGrayJSListenersInCCGenerationDocuments();
break;
}
case eUnmarkMessageManagers: {

Просмотреть файл

@ -3985,29 +3985,22 @@ nsContentUtils::MaybeFireNodeRemoved(nsINode* aChild, nsINode* aParent,
}
}
PLDHashOperator
ListenerEnumerator(PLDHashTable* aTable, PLDHashEntryHdr* aEntry,
uint32_t aNumber, void* aArg)
void
nsContentUtils::UnmarkGrayJSListenersInCCGenerationDocuments()
{
EventListenerManagerMapEntry* entry =
static_cast<EventListenerManagerMapEntry*>(aEntry);
if (entry) {
if (!sEventListenerManagersHash) {
return;
}
PLDHashTable::Iterator iter(sEventListenerManagersHash);
while (iter.HasMoreEntries()) {
auto entry = static_cast<EventListenerManagerMapEntry*>(iter.NextEntry());
nsINode* n = static_cast<nsINode*>(entry->mListenerManager->GetTarget());
if (n && n->IsInDoc() &&
nsCCUncollectableMarker::InGeneration(n->OwnerDoc()->GetMarkedCCGeneration())) {
entry->mListenerManager->MarkForCC();
}
}
return PL_DHASH_NEXT;
}
void
nsContentUtils::UnmarkGrayJSListenersInCCGenerationDocuments(uint32_t aGeneration)
{
if (sEventListenerManagersHash) {
PL_DHashTableEnumerate(sEventListenerManagersHash, ListenerEnumerator,
&aGeneration);
}
}
/* static */

Просмотреть файл

@ -1124,7 +1124,7 @@ public:
static mozilla::EventListenerManager*
GetExistingListenerManagerForNode(const nsINode* aNode);
static void UnmarkGrayJSListenersInCCGenerationDocuments(uint32_t aGeneration);
static void UnmarkGrayJSListenersInCCGenerationDocuments();
/**
* Remove the eventlistener manager for aNode.

Просмотреть файл

@ -534,7 +534,7 @@ struct VerifyTraceProtoAndIfaceCacheCalledTracer : public JS::CallbackTracer
: JS::CallbackTracer(rt), ok(false)
{}
void trace(void** thingp, JS::TraceKind kind) override {
void onChild(const JS::GCCellPtr&) override {
// We don't do anything here, we only want to verify that
// TraceProtoAndIfaceCache was called.
}

Просмотреть файл

@ -223,6 +223,39 @@ typedef TypedArray<uint8_t, js::UnwrapArrayBuffer, JS_GetArrayBufferData,
js::GetArrayBufferLengthAndData, JS_NewArrayBuffer>
ArrayBuffer;
typedef TypedArray<int8_t, js::UnwrapSharedInt8Array, JS_GetSharedInt8ArrayData,
js::GetSharedInt8ArrayLengthAndData, JS_NewSharedInt8Array>
SharedInt8Array;
typedef TypedArray<uint8_t, js::UnwrapSharedUint8Array, JS_GetSharedUint8ArrayData,
js::GetSharedUint8ArrayLengthAndData, JS_NewSharedUint8Array>
SharedUint8Array;
typedef TypedArray<uint8_t, js::UnwrapSharedUint8ClampedArray, JS_GetSharedUint8ClampedArrayData,
js::GetSharedUint8ClampedArrayLengthAndData, JS_NewSharedUint8ClampedArray>
SharedUint8ClampedArray;
typedef TypedArray<int16_t, js::UnwrapSharedInt16Array, JS_GetSharedInt16ArrayData,
js::GetSharedInt16ArrayLengthAndData, JS_NewSharedInt16Array>
SharedInt16Array;
typedef TypedArray<uint16_t, js::UnwrapSharedUint16Array, JS_GetSharedUint16ArrayData,
js::GetSharedUint16ArrayLengthAndData, JS_NewSharedUint16Array>
SharedUint16Array;
typedef TypedArray<int32_t, js::UnwrapSharedInt32Array, JS_GetSharedInt32ArrayData,
js::GetSharedInt32ArrayLengthAndData, JS_NewSharedInt32Array>
SharedInt32Array;
typedef TypedArray<uint32_t, js::UnwrapSharedUint32Array, JS_GetSharedUint32ArrayData,
js::GetSharedUint32ArrayLengthAndData, JS_NewSharedUint32Array>
SharedUint32Array;
typedef TypedArray<float, js::UnwrapSharedFloat32Array, JS_GetSharedFloat32ArrayData,
js::GetSharedFloat32ArrayLengthAndData, JS_NewSharedFloat32Array>
SharedFloat32Array;
typedef TypedArray<double, js::UnwrapSharedFloat64Array, JS_GetSharedFloat64ArrayData,
js::GetSharedFloat64ArrayLengthAndData, JS_NewSharedFloat64Array>
SharedFloat64Array;
typedef TypedArray_base<uint8_t, js::UnwrapSharedArrayBufferView, js::GetSharedArrayBufferViewLengthAndData>
SharedArrayBufferView;
typedef TypedArray<uint8_t, js::UnwrapSharedArrayBuffer, JS_GetSharedArrayBufferData,
js::GetSharedArrayBufferLengthAndData, JS_NewSharedArrayBuffer>
SharedArrayBuffer;
// A class for converting an nsTArray to a TypedArray
// Note: A TypedArrayCreator must not outlive the nsTArray it was created from.
// So this is best used to pass from things that understand nsTArray to

Просмотреть файл

@ -1729,9 +1729,18 @@ class IDLType(IDLObject):
def isArrayBufferView(self):
return False
def isSharedArrayBuffer(self):
return False
def isSharedArrayBufferView(self):
return False
def isTypedArray(self):
return False
def isSharedTypedArray(self):
return False
def isCallbackInterface(self):
return False
@ -1751,7 +1760,10 @@ class IDLType(IDLObject):
only returns true for the types from the TypedArray spec. """
return self.isInterface() and (self.isArrayBuffer() or \
self.isArrayBufferView() or \
self.isTypedArray())
self.isSharedArrayBuffer() or \
self.isSharedArrayBufferView() or \
self.isTypedArray() or \
self.isSharedTypedArray())
def isDictionary(self):
return False
@ -1933,9 +1945,18 @@ class IDLNullableType(IDLType):
def isArrayBufferView(self):
return self.inner.isArrayBufferView()
def isSharedArrayBuffer(self):
return self.inner.isSharedArrayBuffer()
def isSharedArrayBufferView(self):
return self.inner.isSharedArrayBufferView()
def isTypedArray(self):
return self.inner.isTypedArray()
def isSharedTypedArray(self):
return self.inner.isSharedTypedArray()
def isDictionary(self):
return self.inner.isDictionary()
@ -2424,9 +2445,18 @@ class IDLTypedefType(IDLType):
def isArrayBufferView(self):
return self.inner.isArrayBufferView()
def isSharedArrayBuffer(self):
return self.inner.isSharedArrayBuffer()
def isSharedArrayBufferView(self):
return self.inner.isSharedArrayBufferView()
def isTypedArray(self):
return self.inner.isTypedArray()
def isSharedTypedArray(self):
return self.inner.isSharedTypedArray()
def isInterface(self):
return self.inner.isInterface()
@ -2684,6 +2714,8 @@ class IDLBuiltinType(IDLType):
# Funny stuff
'ArrayBuffer',
'ArrayBufferView',
'SharedArrayBuffer',
'SharedArrayBufferView',
'Int8Array',
'Uint8Array',
'Uint8ClampedArray',
@ -2692,7 +2724,16 @@ class IDLBuiltinType(IDLType):
'Int32Array',
'Uint32Array',
'Float32Array',
'Float64Array'
'Float64Array',
'SharedInt8Array',
'SharedUint8Array',
'SharedUint8ClampedArray',
'SharedInt16Array',
'SharedUint16Array',
'SharedInt32Array',
'SharedUint32Array',
'SharedFloat32Array',
'SharedFloat64Array'
)
TagLookup = {
@ -2718,6 +2759,8 @@ class IDLBuiltinType(IDLType):
Types.void: IDLType.Tags.void,
Types.ArrayBuffer: IDLType.Tags.interface,
Types.ArrayBufferView: IDLType.Tags.interface,
Types.SharedArrayBuffer: IDLType.Tags.interface,
Types.SharedArrayBufferView: IDLType.Tags.interface,
Types.Int8Array: IDLType.Tags.interface,
Types.Uint8Array: IDLType.Tags.interface,
Types.Uint8ClampedArray: IDLType.Tags.interface,
@ -2726,7 +2769,16 @@ class IDLBuiltinType(IDLType):
Types.Int32Array: IDLType.Tags.interface,
Types.Uint32Array: IDLType.Tags.interface,
Types.Float32Array: IDLType.Tags.interface,
Types.Float64Array: IDLType.Tags.interface
Types.Float64Array: IDLType.Tags.interface,
Types.SharedInt8Array: IDLType.Tags.interface,
Types.SharedUint8Array: IDLType.Tags.interface,
Types.SharedUint8ClampedArray: IDLType.Tags.interface,
Types.SharedInt16Array: IDLType.Tags.interface,
Types.SharedUint16Array: IDLType.Tags.interface,
Types.SharedInt32Array: IDLType.Tags.interface,
Types.SharedUint32Array: IDLType.Tags.interface,
Types.SharedFloat32Array: IDLType.Tags.interface,
Types.SharedFloat64Array: IDLType.Tags.interface
}
def __init__(self, location, name, type):
@ -2766,17 +2818,30 @@ class IDLBuiltinType(IDLType):
def isArrayBufferView(self):
return self._typeTag == IDLBuiltinType.Types.ArrayBufferView
def isSharedArrayBuffer(self):
return self._typeTag == IDLBuiltinType.Types.SharedArrayBuffer
def isSharedArrayBufferView(self):
return self._typeTag == IDLBuiltinType.Types.SharedArrayBufferView
def isTypedArray(self):
return self._typeTag >= IDLBuiltinType.Types.Int8Array and \
self._typeTag <= IDLBuiltinType.Types.Float64Array
def isSharedTypedArray(self):
return self._typeTag >= IDLBuiltinType.Types.SharedInt8Array and \
self._typeTag <= IDLBuiltinType.Types.SharedFloat64Array
def isInterface(self):
# TypedArray things are interface types per the TypedArray spec,
# but we handle them as builtins because SpiderMonkey implements
# all of it internally.
return self.isArrayBuffer() or \
self.isArrayBufferView() or \
self.isTypedArray()
self.isSharedArrayBuffer() or \
self.isSharedArrayBufferView() or \
self.isTypedArray() or \
self.isSharedTypedArray()
def isNonCallbackInterface(self):
# All the interfaces we can be are non-callback
@ -2847,15 +2912,20 @@ class IDLBuiltinType(IDLType):
# ArrayBuffer is distinguishable from everything
# that's not an ArrayBuffer or a callback interface
(self.isArrayBuffer() and not other.isArrayBuffer()) or
(self.isSharedArrayBuffer() and not other.isSharedArrayBuffer()) or
# ArrayBufferView is distinguishable from everything
# that's not an ArrayBufferView or typed array.
(self.isArrayBufferView() and not other.isArrayBufferView() and
not other.isTypedArray()) or
(self.isSharedArrayBufferView() and not other.isSharedArrayBufferView() and
not other.isSharedTypedArray()) or
# Typed arrays are distinguishable from everything
# except ArrayBufferView and the same type of typed
# array
(self.isTypedArray() and not other.isArrayBufferView() and not
(other.isTypedArray() and other.name == self.name)))))
(other.isTypedArray() and other.name == self.name)) or
(self.isSharedTypedArray() and not other.isSharedArrayBufferView() and not
(other.isSharedTypedArray() and other.name == self.name)))))
def _getDependentObjects(self):
return set()
@ -2927,6 +2997,12 @@ BuiltinTypes = {
IDLBuiltinType.Types.ArrayBufferView:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "ArrayBufferView",
IDLBuiltinType.Types.ArrayBufferView),
IDLBuiltinType.Types.SharedArrayBuffer:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "SharedArrayBuffer",
IDLBuiltinType.Types.SharedArrayBuffer),
IDLBuiltinType.Types.SharedArrayBufferView:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "SharedArrayBufferView",
IDLBuiltinType.Types.SharedArrayBufferView),
IDLBuiltinType.Types.Int8Array:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "Int8Array",
IDLBuiltinType.Types.Int8Array),
@ -2953,7 +3029,34 @@ BuiltinTypes = {
IDLBuiltinType.Types.Float32Array),
IDLBuiltinType.Types.Float64Array:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "Float64Array",
IDLBuiltinType.Types.Float64Array)
IDLBuiltinType.Types.Float64Array),
IDLBuiltinType.Types.SharedInt8Array:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "SharedInt8Array",
IDLBuiltinType.Types.SharedInt8Array),
IDLBuiltinType.Types.SharedUint8Array:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "SharedUint8Array",
IDLBuiltinType.Types.SharedUint8Array),
IDLBuiltinType.Types.SharedUint8ClampedArray:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "SharedUint8ClampedArray",
IDLBuiltinType.Types.SharedUint8ClampedArray),
IDLBuiltinType.Types.SharedInt16Array:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "SharedInt16Array",
IDLBuiltinType.Types.SharedInt16Array),
IDLBuiltinType.Types.SharedUint16Array:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "SharedUint16Array",
IDLBuiltinType.Types.SharedUint16Array),
IDLBuiltinType.Types.SharedInt32Array:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "SharedInt32Array",
IDLBuiltinType.Types.SharedInt32Array),
IDLBuiltinType.Types.SharedUint32Array:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "SharedUint32Array",
IDLBuiltinType.Types.SharedUint32Array),
IDLBuiltinType.Types.SharedFloat32Array:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "SharedFloat32Array",
IDLBuiltinType.Types.SharedFloat32Array),
IDLBuiltinType.Types.SharedFloat64Array:
IDLBuiltinType(BuiltinLocation("<builtin type>"), "SharedFloat64Array",
IDLBuiltinType.Types.SharedFloat64Array)
}
@ -4413,6 +4516,7 @@ class Tokenizer(object):
"<": "LT",
">": "GT",
"ArrayBuffer": "ARRAYBUFFER",
"SharedArrayBuffer": "SHAREDARRAYBUFFER",
"or": "OR"
}
@ -5460,12 +5564,15 @@ class Parser(Tokenizer):
"""
NonAnyType : PrimitiveOrStringType TypeSuffix
| ARRAYBUFFER TypeSuffix
| SHAREDARRAYBUFFER TypeSuffix
| OBJECT TypeSuffix
"""
if p[1] == "object":
type = BuiltinTypes[IDLBuiltinType.Types.object]
elif p[1] == "ArrayBuffer":
type = BuiltinTypes[IDLBuiltinType.Types.ArrayBuffer]
elif p[1] == "SharedArrayBuffer":
type = BuiltinTypes[IDLBuiltinType.Types.SharedArrayBuffer]
else:
type = BuiltinTypes[p[1]]
@ -5859,7 +5966,7 @@ class Parser(Tokenizer):
assert isinstance(scope, IDLScope)
# xrange omits the last value.
for x in xrange(IDLBuiltinType.Types.ArrayBuffer, IDLBuiltinType.Types.Float64Array + 1):
for x in xrange(IDLBuiltinType.Types.ArrayBuffer, IDLBuiltinType.Types.SharedFloat64Array + 1):
builtin = BuiltinTypes[x]
name = builtin.name
typedef = IDLTypedef(BuiltinLocation("<builtin type>"), scope, builtin, name)
@ -5920,6 +6027,7 @@ class Parser(Tokenizer):
_builtins = """
typedef unsigned long long DOMTimeStamp;
typedef (ArrayBufferView or ArrayBuffer) BufferSource;
typedef (SharedArrayBufferView or SharedArrayBuffer) SharedBufferSource;
"""
def main():

Просмотреть файл

@ -160,7 +160,8 @@ def WebIDLTest(parser, harness):
"optional Dict2", "sequence<long>", "sequence<short>",
"MozMap<object>", "MozMap<Dict>", "MozMap<long>",
"long[]", "short[]", "Date", "Date?", "any",
"USVString" ]
"USVString", "ArrayBuffer", "ArrayBufferView", "SharedArrayBuffer", "SharedArrayBufferView",
"Uint8Array", "SharedUint8Array", "Uint16Array", "SharedUint16Array" ]
# When we can parse Date and RegExp, we need to add them here.
# Try to categorize things a bit to keep list lengths down
@ -175,8 +176,10 @@ def WebIDLTest(parser, harness):
nonStrings = allBut(argTypes, strings)
nonObjects = primitives + strings
objects = allBut(argTypes, nonObjects )
bufferSourceTypes = ["ArrayBuffer", "ArrayBufferView", "Uint8Array", "Uint16Array"]
sharedBufferSourceTypes = ["SharedArrayBuffer", "SharedArrayBufferView", "SharedUint8Array", "SharedUint16Array"]
interfaces = [ "Interface", "Interface?", "AncestorInterface",
"UnrelatedInterface", "ImplementedInterface" ]
"UnrelatedInterface", "ImplementedInterface" ] + bufferSourceTypes + sharedBufferSourceTypes
nullables = ["long?", "short?", "boolean?", "Interface?",
"CallbackInterface?", "optional Dict", "optional Dict2",
"Date?", "any"]
@ -186,7 +189,7 @@ def WebIDLTest(parser, harness):
nonUserObjects = nonObjects + interfaces + dates + sequences
otherObjects = allBut(argTypes, nonUserObjects + ["object"])
notRelatedInterfaces = (nonObjects + ["UnrelatedInterface"] +
otherObjects + dates + sequences)
otherObjects + dates + sequences + bufferSourceTypes + sharedBufferSourceTypes)
mozMaps = [ "MozMap<object>", "MozMap<Dict>", "MozMap<long>" ]
# Build a representation of the distinguishability table as a dict
@ -235,6 +238,14 @@ def WebIDLTest(parser, harness):
setDistinguishable("Date", allBut(argTypes, dates + ["object"]))
setDistinguishable("Date?", allBut(argTypes, dates + nullables + ["object"]))
setDistinguishable("any", [])
setDistinguishable("ArrayBuffer", allBut(argTypes, ["ArrayBuffer", "object"]))
setDistinguishable("ArrayBufferView", allBut(argTypes, ["ArrayBufferView", "Uint8Array", "Uint16Array", "object"]))
setDistinguishable("Uint8Array", allBut(argTypes, ["ArrayBufferView", "Uint8Array", "object"]))
setDistinguishable("Uint16Array", allBut(argTypes, ["ArrayBufferView", "Uint16Array", "object"]))
setDistinguishable("SharedArrayBuffer", allBut(argTypes, ["SharedArrayBuffer", "object"]))
setDistinguishable("SharedArrayBufferView", allBut(argTypes, ["SharedArrayBufferView", "SharedUint8Array", "SharedUint16Array", "object"]))
setDistinguishable("SharedUint8Array", allBut(argTypes, ["SharedArrayBufferView", "SharedUint8Array", "object"]))
setDistinguishable("SharedUint16Array", allBut(argTypes, ["SharedArrayBufferView", "SharedUint16Array", "object"]))
def areDistinguishable(type1, type2):
return data[type1].get(type2, False)

Просмотреть файл

@ -0,0 +1,35 @@
<!DOCTYPE html>
<meta charset='UTF-8'>
<!--
Clear the canvas to green and capture it to a stream to test that we can get
the stream to screen in a local video element.
-->
<html class="reftest-wait">
<head>
<script type='text/javascript'>
function finished() {
document.documentElement.removeAttribute("class");
}
function runTest() {
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
context.fillStyle = "rgba(0, 255, 0, 1)";
context.fillRect(0, 0, canvas.width, canvas.height);
var video = document.getElementById('video');
video.mozSrcObject = canvas.captureStream(0);
video.play();
video.onloadeddata = finished;
video.onerror = finished;
}
</script>
</head>
<body onload='runTest();'>
<video id='video' width='256' height='256'></video>
<canvas id='canvas' width='256' height='256' style="display:none"></canvas>
</body>
</html>

Просмотреть файл

@ -19,6 +19,9 @@ pref(webgl.force-layers-readback,true) == webgl-clear-test.html?readback wrappe
# Check that resize works:
== webgl-resize-test.html wrapper.html?green.png
# Check that captureStream() displays in a local video element
pref(canvas.capturestream.enabled,true) skip-if(winWidget&&layersGPUAccelerated&&d2d) == webgl-capturestream-test.html?preserve wrapper.html?green.png
# Some of the failure conditions are a little crazy. I'm (jgilbert) setting these based on
# failures encountered when running on Try, and then targetting the Try config by
# differences in the `sandbox` contents. That is, I'm labeling based on symptoms rather
@ -152,3 +155,6 @@ skip-if(!winWidget) pref(webgl.disable-angle,true) == webgl-color-test.html?nat
# focus rings
pref(canvas.focusring.enabled,true) skip-if(B2G) skip-if(Android&&AndroidVersion<15,8,500) skip-if(winWidget) needs-focus == drawFocusIfNeeded.html drawFocusIfNeeded-ref.html
pref(canvas.customfocusring.enabled,true) skip-if(B2G) skip-if(Android&&AndroidVersion<15,8,500) skip-if(winWidget) needs-focus == drawCustomFocusRing.html drawCustomFocusRing-ref.html
# Check that captureStream() displays in a local video element
pref(canvas.capturestream.enabled,true) fails-if(B2G) skip-if(winWidget&&layersGPUAccelerated&&d2d) == capturestream.html wrapper.html?green.png

Просмотреть файл

@ -0,0 +1,50 @@
<!DOCTYPE html>
<meta charset='UTF-8'>
<!--
Clear the canvas to green and capture it to a stream to test that we can get
the stream to screen in a local video element.
-->
<html class="reftest-wait">
<head>
<script type='text/javascript' src='webgl-utils.js'></script>
<script type='text/javascript'>
'use strict';
function setStatus(text) {
var elem = document.getElementById('status');
elem.innerHTML = text;
}
function finished() {
document.documentElement.removeAttribute("class");
}
function runTest() {
var canvas = document.getElementById('canvas');
var gl = initGL(canvas);
if (!gl) {
setStatus('WebGL context creation failed.');
return;
}
gl.clearColor(0.0, 1.0, 0.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT);
var video = document.getElementById('video');
video.mozSrcObject = canvas.captureStream(0);
video.play();
video.onloadeddata = finished;
video.onerror = finished;
}
</script>
</head>
<body onload='runTest();'>
<video id='video' width='256' height='256'></video>
<canvas id='canvas' width='256' height='256' style="display:none"></canvas>
<div id='status'></div>
</body>
</html>

Просмотреть файл

@ -3708,8 +3708,18 @@ EventStateManager::IsHandlingUserInput()
}
TimeDuration timeout = nsContentUtils::HandlingUserInputTimeout();
return timeout <= TimeDuration(0) ||
(TimeStamp::Now() - sHandlingInputStart) <= timeout;
TimeDuration elapsed = TimeStamp::Now() - sHandlingInputStart;
bool inTime = timeout <= TimeDuration(0) || elapsed <= timeout;
if (!inTime) {
#ifdef DEBUG
printf("EventStateManager::IsHandlingUserInput() has timed out "
"(timeout: %f, elapsed: %f)\n",
timeout.ToMilliseconds(), elapsed.ToMilliseconds());
#endif
return false;
}
return true;
}
static void

Просмотреть файл

@ -18,10 +18,6 @@ XPCOMUtils.defineLazyServiceGetter(Services, "fm",
"@mozilla.org/focus-manager;1",
"nsIFocusManager");
XPCOMUtils.defineLazyServiceGetter(Services, "threadManager",
"@mozilla.org/thread-manager;1",
"nsIThreadManager");
XPCOMUtils.defineLazyGetter(this, "domWindowUtils", function () {
return content.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
@ -461,13 +457,6 @@ let FormAssistant = {
}
},
waitForNextTick: function(callback) {
var tm = Services.threadManager;
tm.mainThread.dispatch({
run: callback,
}, Components.interfaces.nsIThread.DISPATCH_NORMAL);
},
receiveMessage: function fa_receiveMessage(msg) {
let target = this.focusedElement;
let json = msg.json;
@ -682,35 +671,13 @@ let FormAssistant = {
target = target.parentNode;
this.setFocusedElement(target);
let count = this._focusCounter;
this.waitForNextTick(function fa_handleFocusSync() {
if (count !== this._focusCounter) {
return;
}
let isHandlingFocus = this.sendInputState(target);
this.isHandlingFocus = isHandlingFocus;
}.bind(this));
this.isHandlingFocus = this.sendInputState(target);
},
unhandleFocus: function fa_unhandleFocus() {
this.setFocusedElement(null);
let count = this._focusCounter;
// Wait for the next tick before unset the focused element and etc.
// If the user move from one input from another,
// the remote process should get one Forms:Input message instead of two.
this.waitForNextTick(function fa_unhandleFocusSync() {
if (count !== this._focusCounter ||
!this.isHandlingFocus) {
return;
}
this.isHandlingFocus = false;
sendAsyncMessage("Forms:Input", { "type": "blur" });
}.bind(this));
this.isHandlingFocus = false;
sendAsyncMessage("Forms:Input", { "type": "blur" });
},
isFocusableElement: function fa_isFocusableElement(element) {

Просмотреть файл

@ -1,17 +0,0 @@
<!DOCTYPE HTML>
<html>
<body>
<div id="text" contenteditable>Jan Jongboom</div>
<script type="application/javascript;version=1.7">
var t = document.querySelector('#text');
t.focus();
var range = document.createRange();
range.selectNodeContents(t);
range.collapse(false);
var selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
</script>
</body>
</html>

Просмотреть файл

@ -6,7 +6,6 @@ support-files =
file_inputmethod.html
file_inputmethod_1043828.html
file_test_app.html
file_test_contenteditable.html
file_test_sendkey_cancel.html
file_test_sms_app.html
file_test_sms_app_1066515.html

Просмотреть файл

@ -20,8 +20,20 @@ inputmethod_setup(function() {
// The frame script running in the file
function appFrameScript() {
let document = content.document;
let window = content.document.defaultView;
let t = document.getElementById('text');
t.focus();
let range = document.createRange();
range.selectNodeContents(t);
range.collapse(false);
let selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
addMessageListener('test:InputMethod:clear', function() {
var t = content.document.getElementById('text');
t.innerHTML = '';
});
}
@ -34,18 +46,26 @@ function runTest() {
// Create an app frame to recieve keyboard inputs.
let app = document.createElement('iframe');
app.src = 'file_test_contenteditable.html';
app.src = 'data:text/html,<html><body><div id="text" contenteditable>Jan Jongboom</div></html>';
app.setAttribute('mozbrowser', true);
document.body.appendChild(app);
app.addEventListener('mozbrowserloadend', function() {
let mm = SpecialPowers.getBrowserFrameMessageManager(app);
mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
im.oninputcontextchange = function() {
if (im.inputcontext) {
im.oninputcontextchange = null;
register();
}
};
function register() {
im.inputcontext.onselectionchange = function() {
im.inputcontext.onselectionchange = null;
is(im.inputcontext.textBeforeCursor, '', 'textBeforeCursor');
is(im.inputcontext.textBeforeCursor, '', 'textAfterCursor');
is(im.inputcontext.textAfterCursor, '', 'textAfterCursor');
is(im.inputcontext.selectionStart, 0, 'selectionStart');
is(im.inputcontext.selectionEnd, 0, 'selectionEnd');
@ -54,20 +74,6 @@ function runTest() {
mm.sendAsyncMessage('test:InputMethod:clear');
}
if (im.inputcontext) {
register();
}
else {
im.oninputcontextchange = function() {
if (im.inputcontext) {
im.oninputcontextchange = null;
register();
}
};
}
mm.loadFrameScript('data:,(' + appFrameScript.toString() + ')();', false);
});
}
</script>

Просмотреть файл

@ -25,10 +25,6 @@ let appFrameScript = function appFrameScript() {
input.focus();
input.value = 'First1';
input.blur();
content.setTimeout(function() {
sendAsyncMessage('test:next', {});
});
};
function runTest() {
@ -36,7 +32,32 @@ function runTest() {
let i = 0;
im.oninputcontextchange = function() {
ok(false, 'Should not receive any inputcontextchange events.');
let inputcontext = im.inputcontext;
i++;
switch (i) {
case 1:
ok(!!inputcontext, 'Should receive inputcontext from focus().');
is(inputcontext.textAfterCursor, 'First');
break;
case 2:
ok(!!inputcontext, 'Should receive inputcontext from value change.');
is(inputcontext.textBeforeCursor, 'First1');
break;
case 3:
ok(!inputcontext, 'Should lost inputcontext from blur().');
inputmethod_cleanup();
break;
default:
ok(false, 'Unknown event count.');
inputmethod_cleanup();
}
};
// Set current page as an input method.
@ -48,11 +69,6 @@ function runTest() {
document.body.appendChild(iframe);
let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
mm.addMessageListener('test:next', function() {
ok(true, '\\o/');
inputmethod_cleanup();
});
iframe.addEventListener('mozbrowserloadend', function() {
mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
});

Просмотреть файл

@ -34,12 +34,7 @@ let appFrameScript = function appFrameScript() {
switch (i) {
case 2:
input2.focus();
break;
case 3:
input2.blur();
input2.focus();
i++; // keep the same count with the parent frame.
break;
@ -50,23 +45,26 @@ let appFrameScript = function appFrameScript() {
case 5:
input2.focus();
input2.blur();
input1.focus();
break;
case 6:
content.document.body.removeChild(input1);
break;
case 7:
input2.focus();
input1.focus();
i++; // keep the same count with the parent frame.
break;
case 8:
content.document.body.removeChild(input1);
break;
case 9:
input2.focus();
break;
case 10:
content.document.body.removeChild(input2);
break;
@ -85,26 +83,21 @@ function runTest() {
switch (i) {
// focus on the first input receives the first input context.
case 1:
ok(!!inputcontext, 'Receving the first input context');
ok(!!inputcontext, '1) Receving the first input context');
is(inputcontext.textAfterCursor, 'First');
mm.sendAsyncMessage('test:next');
break;
// focus on the second input (implicitly blur the first input)
// results the second input context.
// focus on the second input should implicitly blur the first input
case 2:
ok(!!inputcontext, 'Receving the second input context');
is(inputcontext.textAfterCursor, 'Second');
is(inputcontext, null, '2) Receving null inputcontext');
mm.sendAsyncMessage('test:next');
break;
// blur and re-focus on the second input results updated
// input context for the second input.
// ... and results the second input context.
case 3:
ok(!!inputcontext, 'Receving the second input context');
ok(!!inputcontext, '3) Receving the second input context');
is(inputcontext.textAfterCursor, 'Second');
mm.sendAsyncMessage('test:next');
@ -112,38 +105,51 @@ function runTest() {
// blur on the second input results null input context
case 4:
is(inputcontext, null, 'Receving null inputcontext');
is(inputcontext, null, '4) Receving null inputcontext');
mm.sendAsyncMessage('test:next');
break;
// focus and blur on the second input sends no message;
// focus on the first input receives the first input context.
// focus on the second input receives the second input context.
case 5:
ok(!!inputcontext, 'Receving the first input context');
ok(!!inputcontext, '5) Receving the second input context');
is(inputcontext.textAfterCursor, 'Second');
mm.sendAsyncMessage('test:next');
break;
// focus on the second input should implicitly blur the first input
case 6:
is(inputcontext, null, '6) Receving null inputcontext');
break;
// ... and results the second input context.
case 7:
ok(!!inputcontext, '7) Receving the first input context');
is(inputcontext.textAfterCursor, 'First');
mm.sendAsyncMessage('test:next');
break;
// remove on the first focused input results null input context
case 6:
is(inputcontext, null, 'Receving null inputcontext');
case 8:
is(inputcontext, null, '8) Receving null inputcontext');
mm.sendAsyncMessage('test:next');
break;
// input context for the second input.
case 7:
ok(!!inputcontext, 'Receving the second input context');
case 9:
ok(!!inputcontext, '9) Receving the second input context');
is(inputcontext.textAfterCursor, 'Second');
mm.sendAsyncMessage('test:next');
break;
// remove on the second focused input results null input context
case 8:
is(inputcontext, null, 'Receving null inputcontext');
case 10:
is(inputcontext, null, '10) Receving null inputcontext');
inputmethod_cleanup();
break;

Просмотреть файл

@ -32,12 +32,7 @@ let appFrameScript = function appFrameScript() {
switch (i) {
case 2:
select2.focus();
break;
case 3:
select2.blur();
select2.focus();
i++; // keep the same count with the parent frame.
break;
@ -48,14 +43,27 @@ let appFrameScript = function appFrameScript() {
case 5:
select2.focus();
select2.blur();
select1.focus();
break;
case 6:
select1.blur();
select1.focus();
i++; // keep the same count with the parent frame.
break;
case 8:
content.document.body.removeChild(select1);
break;
case 9:
select2.focus();
break;
case 10:
content.document.body.removeChild(select2);
break;
}
@ -73,26 +81,21 @@ function runTest() {
switch (i) {
// focus on the first input receives the first input context.
case 1:
ok(!!inputcontext, 'Receving the first input context');
ok(!!inputcontext, '1) Receving the first input context');
is(inputcontext.textAfterCursor, 'First');
mm.sendAsyncMessage('test:next');
break;
// focus on the second input (implicitly blur the first input)
// results the second input context.
// focus on the second input should implicitly blur the first input
case 2:
ok(!!inputcontext, 'Receving the second input context');
is(inputcontext.textAfterCursor, 'Second');
is(inputcontext, null, '2) Receving null inputcontext');
mm.sendAsyncMessage('test:next');
break;
// blur and re-focus on the second input results updated
// input context for the second input.
// ... and results the second input context.
case 3:
ok(!!inputcontext, 'Receving the second input context');
ok(!!inputcontext, '3) Receving the second input context');
is(inputcontext.textAfterCursor, 'Second');
mm.sendAsyncMessage('test:next');
@ -100,23 +103,51 @@ function runTest() {
// blur on the second input results null input context
case 4:
is(inputcontext, null, 'Receving null inputcontext');
is(inputcontext, null, '4) Receving null inputcontext');
mm.sendAsyncMessage('test:next');
break;
// focus and blur on the second input sends no message;
// focus on the first input receives the first input context.
// focus on the second input receives the second input context.
case 5:
ok(!!inputcontext, 'Receving the first input context');
ok(!!inputcontext, '5) Receving the second input context');
is(inputcontext.textAfterCursor, 'Second');
mm.sendAsyncMessage('test:next');
break;
// focus on the second input should implicitly blur the first input
case 6:
is(inputcontext, null, '6) Receving null inputcontext');
break;
// ... and results the second input context.
case 7:
ok(!!inputcontext, '7) Receving the first input context');
is(inputcontext.textAfterCursor, 'First');
mm.sendAsyncMessage('test:next');
break;
// blur on the first input results null input context
case 6:
is(inputcontext, null, 'Receving null inputcontext');
// remove on the first focused input results null input context
case 8:
is(inputcontext, null, '8) Receving null inputcontext');
mm.sendAsyncMessage('test:next');
break;
// input context for the second input.
case 9:
ok(!!inputcontext, '9) Receving the second input context');
is(inputcontext.textAfterCursor, 'Second');
mm.sendAsyncMessage('test:next');
break;
// remove on the second focused input results null input context
case 10:
is(inputcontext, null, '10) Receving null inputcontext');
inputmethod_cleanup();
break;

Просмотреть файл

@ -79,7 +79,9 @@
#include "mozilla/Preferences.h"
#include "mozilla/ProcessHangMonitor.h"
#include "mozilla/ProcessHangMonitorIPC.h"
#ifdef MOZ_ENABLE_PROFILER_SPS
#include "mozilla/ProfileGatherer.h"
#endif
#include "mozilla/Services.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/Telemetry.h"
@ -239,7 +241,9 @@ static NS_DEFINE_CID(kCClipboardCID, NS_CLIPBOARD_CID);
using base::ChildPrivileges;
using base::KillProcess;
#ifdef MOZ_ENABLE_PROFILER_SPS
using mozilla::ProfileGatherer;
#endif
#ifdef MOZ_CRASHREPORTER
using namespace CrashReporter;
@ -5106,12 +5110,14 @@ ContentParent::RecvGamepadListenerRemoved()
bool
ContentParent::RecvProfile(const nsCString& aProfile)
{
#ifdef MOZ_ENABLE_PROFILER_SPS
if (NS_WARN_IF(!mGatherer)) {
return true;
}
mProfile = aProfile;
mGatherer->GatheredOOPProfile();
mGatherer = nullptr;
#endif
return true;
}

Просмотреть файл

@ -37,7 +37,9 @@ class nsIWidget;
namespace mozilla {
class PRemoteSpellcheckEngineParent;
#ifdef MOZ_ENABLE_PROFILER_SPS
class ProfileGatherer;
#endif
namespace ipc {
class OptionalURIParams;
@ -933,7 +935,9 @@ private:
#endif
PProcessHangMonitorParent* mHangMonitorActor;
#ifdef MOZ_ENABLE_PROFILER_SPS
nsRefPtr<mozilla::ProfileGatherer> mGatherer;
#endif
nsCString mProfile;
};

Просмотреть файл

@ -310,7 +310,7 @@ parent:
*
* aPoint offset values in device pixels.
*/
sync GetTabOffset() returns (LayoutDeviceIntPoint aPoint);
prio(high) sync GetTabOffset() returns (LayoutDeviceIntPoint aPoint);
/**
* Gets the DPI of the screen corresponding to this browser.

Просмотреть файл

@ -2702,6 +2702,13 @@ TabParent::ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid,
// Let the widget know that the event will be sent to the child process,
// which will (hopefully) send a confirmation notice back to APZ.
InputAPZContext::SetRoutedToChildProcess();
} else {
if (aOutInputBlockId) {
*aOutInputBlockId = 0;
}
if (aOutApzResponse) {
*aOutApzResponse = nsEventStatus_eIgnore;
}
}
}

Просмотреть файл

@ -490,9 +490,10 @@ MediaRawData::MediaRawData()
, mData(nullptr)
, mSize(0)
, mCrypto(mCryptoInternal)
, mBuffer(new MediaLargeByteBuffer(RAW_DATA_DEFAULT_SIZE))
, mBuffer(new MediaByteBuffer())
, mPadding(0)
{
unused << mBuffer->SetCapacity(RAW_DATA_DEFAULT_SIZE, fallible);
}
MediaRawData::MediaRawData(const uint8_t* aData, size_t aSize)
@ -500,7 +501,7 @@ MediaRawData::MediaRawData(const uint8_t* aData, size_t aSize)
, mData(nullptr)
, mSize(0)
, mCrypto(mCryptoInternal)
, mBuffer(new MediaLargeByteBuffer(RAW_DATA_DEFAULT_SIZE))
, mBuffer(new MediaByteBuffer())
, mPadding(0)
{
if (!EnsureCapacity(aSize)) {

Просмотреть файл

@ -22,7 +22,6 @@ class Image;
class ImageContainer;
}
class MediaLargeByteBuffer;
class MediaByteBuffer;
// Container that holds media samples.
@ -369,7 +368,7 @@ private:
explicit MediaRawDataWriter(MediaRawData* aMediaRawData);
bool EnsureSize(size_t aSize);
MediaRawData* mTarget;
nsRefPtr<MediaLargeByteBuffer> mBuffer;
nsRefPtr<MediaByteBuffer> mBuffer;
};
class MediaRawData : public MediaData {
@ -403,23 +402,12 @@ private:
// read as required by some data decoders.
// Returns false if memory couldn't be allocated.
bool EnsureCapacity(size_t aSize);
nsRefPtr<MediaLargeByteBuffer> mBuffer;
nsRefPtr<MediaByteBuffer> mBuffer;
CryptoSample mCryptoInternal;
uint32_t mPadding;
MediaRawData(const MediaRawData&); // Not implemented
};
// MediaLargeByteBuffer is a ref counted fallible TArray.
// It is designed to share potentially big byte arrays.
class MediaLargeByteBuffer : public FallibleTArray<uint8_t> {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaLargeByteBuffer);
MediaLargeByteBuffer() = default;
explicit MediaLargeByteBuffer(size_t aCapacity) : FallibleTArray<uint8_t>(aCapacity) {}
private:
~MediaLargeByteBuffer() {}
};
// MediaByteBuffer is a ref counted infallible TArray.
class MediaByteBuffer : public nsTArray<uint8_t> {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaByteBuffer);

Просмотреть файл

@ -2970,11 +2970,7 @@ void MediaDecoderStateMachine::AdvanceFrame()
int64_t delta = currentFrame->mTime - clock_time;
TimeStamp presTime = nowTime + TimeDuration::FromMicroseconds(delta / mPlaybackRate);
NS_ASSERTION(currentFrame->mTime >= mStartTime, "Should have positive frame time");
// Filter out invalid frames by checking the frame time. FrameTime could be
// zero if it's a initial frame.
int64_t frameTime = currentFrame->mTime - mStartTime;
if (frameTime > 0 || (frameTime == 0 && mPlayDuration == 0) ||
IsRealTime()) {
{
ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
// If we have video, we want to increment the clock in steps of the frame
// duration.

Просмотреть файл

@ -20,7 +20,7 @@ namespace mozilla {
MP4Demuxer::MP4Demuxer(MediaResource* aResource)
: mResource(aResource)
, mStream(new mp4_demuxer::ResourceStream(aResource))
, mInitData(new MediaLargeByteBuffer)
, mInitData(new MediaByteBuffer)
{
}

Просмотреть файл

@ -51,7 +51,7 @@ private:
friend class MP4TrackDemuxer;
nsRefPtr<MediaResource> mResource;
nsRefPtr<mp4_demuxer::ResourceStream> mStream;
nsRefPtr<MediaLargeByteBuffer> mInitData;
nsRefPtr<MediaByteBuffer> mInitData;
UniquePtr<mp4_demuxer::MP4Metadata> mMetadata;
nsTArray<nsRefPtr<MP4TrackDemuxer>> mDemuxers;
};

Просмотреть файл

@ -37,7 +37,7 @@ ContainerParser::ContainerParser(const nsACString& aType)
}
bool
ContainerParser::IsInitSegmentPresent(MediaLargeByteBuffer* aData)
ContainerParser::IsInitSegmentPresent(MediaByteBuffer* aData)
{
MSE_DEBUG(ContainerParser, "aLength=%u [%x%x%x%x]",
aData->Length(),
@ -49,7 +49,7 @@ return false;
}
bool
ContainerParser::IsMediaSegmentPresent(MediaLargeByteBuffer* aData)
ContainerParser::IsMediaSegmentPresent(MediaByteBuffer* aData)
{
MSE_DEBUG(ContainerParser, "aLength=%u [%x%x%x%x]",
aData->Length(),
@ -61,7 +61,7 @@ ContainerParser::IsMediaSegmentPresent(MediaLargeByteBuffer* aData)
}
bool
ContainerParser::ParseStartAndEndTimestamps(MediaLargeByteBuffer* aData,
ContainerParser::ParseStartAndEndTimestamps(MediaByteBuffer* aData,
int64_t& aStart, int64_t& aEnd)
{
return false;
@ -86,7 +86,7 @@ ContainerParser::HasCompleteInitData()
return mHasInitData && !!mInitData->Length();
}
MediaLargeByteBuffer*
MediaByteBuffer*
ContainerParser::InitData()
{
return mInitData;
@ -121,7 +121,7 @@ public:
static const unsigned NS_PER_USEC = 1000;
static const unsigned USEC_PER_SEC = 1000000;
bool IsInitSegmentPresent(MediaLargeByteBuffer* aData) override
bool IsInitSegmentPresent(MediaByteBuffer* aData) override
{
ContainerParser::IsInitSegmentPresent(aData);
// XXX: This is overly primitive, needs to collect data as it's appended
@ -144,7 +144,7 @@ public:
return false;
}
bool IsMediaSegmentPresent(MediaLargeByteBuffer* aData) override
bool IsMediaSegmentPresent(MediaByteBuffer* aData) override
{
ContainerParser::IsMediaSegmentPresent(aData);
// XXX: This is overly primitive, needs to collect data as it's appended
@ -165,7 +165,7 @@ public:
return false;
}
bool ParseStartAndEndTimestamps(MediaLargeByteBuffer* aData,
bool ParseStartAndEndTimestamps(MediaByteBuffer* aData,
int64_t& aStart, int64_t& aEnd) override
{
bool initSegment = IsInitSegmentPresent(aData);
@ -173,7 +173,7 @@ public:
mOffset = 0;
mParser = WebMBufferedParser(0);
mOverlappedMapping.Clear();
mInitData = new MediaLargeByteBuffer();
mInitData = new MediaByteBuffer();
mResource = new SourceBufferResource(NS_LITERAL_CSTRING("video/webm"));
}
@ -258,7 +258,7 @@ public:
, mMonitor("MP4ContainerParser Index Monitor")
{}
bool IsInitSegmentPresent(MediaLargeByteBuffer* aData) override
bool IsInitSegmentPresent(MediaByteBuffer* aData) override
{
ContainerParser::IsInitSegmentPresent(aData);
// Each MP4 atom has a chunk size and chunk type. The root chunk in an MP4
@ -278,7 +278,7 @@ public:
(*aData)[7] == 'p';
}
bool IsMediaSegmentPresent(MediaLargeByteBuffer* aData) override
bool IsMediaSegmentPresent(MediaByteBuffer* aData) override
{
ContainerParser::IsMediaSegmentPresent(aData);
if (aData->Length() < 8) {
@ -298,7 +298,7 @@ public:
(*aData)[7] == 'x');
}
bool ParseStartAndEndTimestamps(MediaLargeByteBuffer* aData,
bool ParseStartAndEndTimestamps(MediaByteBuffer* aData,
int64_t& aStart, int64_t& aEnd) override
{
MonitorAutoLock mon(mMonitor); // We're not actually racing against anything,
@ -312,7 +312,7 @@ public:
// manually. This allows the ContainerParser to be shared across different
// timestampOffsets.
mParser = new mp4_demuxer::MoofParser(mStream, 0, /* aIsAudio = */ false, &mMonitor);
mInitData = new MediaLargeByteBuffer();
mInitData = new MediaByteBuffer();
} else if (!mStream || !mParser) {
return false;
}

Просмотреть файл

@ -13,7 +13,7 @@
namespace mozilla {
class MediaLargeByteBuffer;
class MediaByteBuffer;
class SourceBufferResource;
class ContainerParser {
@ -24,17 +24,17 @@ public:
// Return true if aData starts with an initialization segment.
// The base implementation exists only for debug logging and is expected
// to be called first from the overriding implementation.
virtual bool IsInitSegmentPresent(MediaLargeByteBuffer* aData);
virtual bool IsInitSegmentPresent(MediaByteBuffer* aData);
// Return true if aData starts with a media segment.
// The base implementation exists only for debug logging and is expected
// to be called first from the overriding implementation.
virtual bool IsMediaSegmentPresent(MediaLargeByteBuffer* aData);
virtual bool IsMediaSegmentPresent(MediaByteBuffer* aData);
// Parse aData to extract the start and end frame times from the media
// segment. aData may not start on a parser sync boundary. Return true
// if aStart and aEnd have been updated.
virtual bool ParseStartAndEndTimestamps(MediaLargeByteBuffer* aData,
virtual bool ParseStartAndEndTimestamps(MediaByteBuffer* aData,
int64_t& aStart, int64_t& aEnd);
// Compare aLhs and rHs, considering any error that may exist in the
@ -44,7 +44,7 @@ public:
virtual int64_t GetRoundingError();
MediaLargeByteBuffer* InitData();
MediaByteBuffer* InitData();
bool HasInitData()
{
@ -65,7 +65,7 @@ public:
static ContainerParser* CreateForMIMEType(const nsACString& aType);
protected:
nsRefPtr<MediaLargeByteBuffer> mInitData;
nsRefPtr<MediaByteBuffer> mInitData;
nsRefPtr<SourceBufferResource> mResource;
bool mHasInitData;
MediaByteRange mCompleteInitSegmentRange;

Просмотреть файл

@ -20,7 +20,7 @@ extern PRLogModuleInfo* GetSourceBufferResourceLog();
namespace mozilla {
ResourceItem::ResourceItem(MediaLargeByteBuffer* aData)
ResourceItem::ResourceItem(MediaByteBuffer* aData)
: mData(aData)
{
}
@ -82,7 +82,7 @@ ResourceQueue::CopyData(uint64_t aOffset, uint32_t aCount, char* aDest)
}
void
ResourceQueue::AppendItem(MediaLargeByteBuffer* aData)
ResourceQueue::AppendItem(MediaByteBuffer* aData)
{
mLogicalLength += aData->Length();
Push(new ResourceItem(aData));
@ -111,7 +111,7 @@ uint32_t ResourceQueue::EvictBefore(uint64_t aOffset, ErrorResult& aRv)
uint32_t offset = aOffset - mOffset;
mOffset += offset;
evicted += offset;
nsRefPtr<MediaLargeByteBuffer> data = new MediaLargeByteBuffer;
nsRefPtr<MediaByteBuffer> data = new MediaByteBuffer;
if (!data->AppendElements(item->mData->Elements() + offset,
item->mData->Length() - offset,
fallible)) {

Просмотреть файл

@ -26,9 +26,9 @@ class ErrorResult;
// timepoint.
struct ResourceItem {
explicit ResourceItem(MediaLargeByteBuffer* aData);
explicit ResourceItem(MediaByteBuffer* aData);
size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const;
nsRefPtr<MediaLargeByteBuffer> mData;
nsRefPtr<MediaByteBuffer> mData;
};
class ResourceQueue : private nsDeque {
@ -45,7 +45,7 @@ public:
// Copies aCount bytes from aOffset in the queue into aDest.
void CopyData(uint64_t aOffset, uint32_t aCount, char* aDest);
void AppendItem(MediaLargeByteBuffer* aData);
void AppendItem(MediaByteBuffer* aData);
// Tries to evict at least aSizeToEvict from the queue up until
// aOffset. Returns amount evicted.

Просмотреть файл

@ -433,7 +433,7 @@ SourceBuffer::AppendData(const uint8_t* aData, uint32_t aLength, ErrorResult& aR
{
MSE_DEBUG("AppendData(aLength=%u)", aLength);
nsRefPtr<MediaLargeByteBuffer> data = PrepareAppend(aData, aLength, aRv);
nsRefPtr<MediaByteBuffer> data = PrepareAppend(aData, aLength, aRv);
if (!data) {
return;
}
@ -536,7 +536,7 @@ SourceBuffer::AppendError(bool aDecoderError)
}
}
already_AddRefed<MediaLargeByteBuffer>
already_AddRefed<MediaByteBuffer>
SourceBuffer::PrepareAppend(const uint8_t* aData, uint32_t aLength, ErrorResult& aRv)
{
typedef SourceBufferContentManager::EvictDataResult Result;
@ -584,7 +584,7 @@ SourceBuffer::PrepareAppend(const uint8_t* aData, uint32_t aLength, ErrorResult&
return nullptr;
}
nsRefPtr<MediaLargeByteBuffer> data = new MediaLargeByteBuffer();
nsRefPtr<MediaByteBuffer> data = new MediaByteBuffer();
if (!data->AppendElements(aData, aLength, fallible)) {
aRv.Throw(NS_ERROR_DOM_QUOTA_EXCEEDED_ERR);
return nullptr;

Просмотреть файл

@ -32,7 +32,7 @@ struct JSContext;
namespace mozilla {
class ErrorResult;
class MediaLargeByteBuffer;
class MediaByteBuffer;
template <typename T> class AsyncEventRunner;
class TrackBuffersManager;
@ -157,11 +157,11 @@ private:
// http://w3c.github.io/media-source/#sourcebuffer-append-error
void AppendError(bool aDecoderError);
// Implements the "Prepare Append Algorithm". Returns MediaLargeByteBuffer object
// Implements the "Prepare Append Algorithm". Returns MediaByteBuffer object
// on success or nullptr (with aRv set) on error.
already_AddRefed<MediaLargeByteBuffer> PrepareAppend(const uint8_t* aData,
uint32_t aLength,
ErrorResult& aRv);
already_AddRefed<MediaByteBuffer> PrepareAppend(const uint8_t* aData,
uint32_t aLength,
ErrorResult& aRv);
void AppendDataCompletedWithSuccess(bool aHasActiveTracks);
void AppendDataErrored(nsresult aError);

Просмотреть файл

@ -33,7 +33,7 @@ public:
// Add data to the end of the input buffer.
// Returns false if the append failed.
virtual bool
AppendData(MediaLargeByteBuffer* aData, TimeUnit aTimestampOffset) = 0;
AppendData(MediaByteBuffer* aData, TimeUnit aTimestampOffset) = 0;
// Run MSE Buffer Append Algorithm
// 3.5.5 Buffer Append Algorithm.

Просмотреть файл

@ -212,7 +212,7 @@ SourceBufferResource::EvictAll()
}
void
SourceBufferResource::AppendData(MediaLargeByteBuffer* aData)
SourceBufferResource::AppendData(MediaByteBuffer* aData)
{
SBR_DEBUG("AppendData(aData=%p, aLength=%u)",
aData->Elements(), aData->Length());

Просмотреть файл

@ -27,7 +27,7 @@ class nsIStreamListener;
namespace mozilla {
class MediaDecoder;
class MediaLargeByteBuffer;
class MediaByteBuffer;
namespace dom {
@ -103,7 +103,7 @@ public:
}
// Used by SourceBuffer.
void AppendData(MediaLargeByteBuffer* aData);
void AppendData(MediaByteBuffer* aData);
void Ended();
bool IsEnded()
{

Просмотреть файл

@ -139,7 +139,7 @@ TrackBuffer::ContinueShutdown()
}
bool
TrackBuffer::AppendData(MediaLargeByteBuffer* aData, TimeUnit aTimestampOffset)
TrackBuffer::AppendData(MediaByteBuffer* aData, TimeUnit aTimestampOffset)
{
MOZ_ASSERT(NS_IsMainThread());
mInputBuffer = aData;
@ -162,7 +162,7 @@ TrackBuffer::BufferAppend()
nsRefPtr<AppendPromise> p = mInitializationPromise.Ensure(__func__);
bool hadInitData = mParser->HasInitData();
bool hadCompleteInitData = mParser->HasCompleteInitData();
nsRefPtr<MediaLargeByteBuffer> oldInit = mParser->InitData();
nsRefPtr<MediaByteBuffer> oldInit = mParser->InitData();
bool newInitData = mParser->IsInitSegmentPresent(mInputBuffer);
// TODO: Run more of the buffer append algorithm asynchronously.
@ -262,7 +262,7 @@ TrackBuffer::BufferAppend()
}
bool
TrackBuffer::AppendDataToCurrentResource(MediaLargeByteBuffer* aData, uint32_t aDuration)
TrackBuffer::AppendDataToCurrentResource(MediaByteBuffer* aData, uint32_t aDuration)
{
MOZ_ASSERT(NS_IsMainThread());
if (!mCurrentDecoder) {
@ -724,7 +724,7 @@ TrackBuffer::OnMetadataRead(MetadataHolder* aMetadata,
// Adding an empty buffer will reopen the SourceBufferResource
if (!aWasEnded) {
nsRefPtr<MediaLargeByteBuffer> emptyBuffer = new MediaLargeByteBuffer;
nsRefPtr<MediaByteBuffer> emptyBuffer = new MediaByteBuffer;
aDecoder->GetResource()->AppendData(emptyBuffer);
}
// HACK END.

Просмотреть файл

@ -22,7 +22,7 @@ namespace mozilla {
class ContainerParser;
class MediaSourceDecoder;
class MediaLargeByteBuffer;
class MediaByteBuffer;
class TrackBuffer final : public SourceBufferContentManager {
public:
@ -30,7 +30,7 @@ public:
nsRefPtr<ShutdownPromise> Shutdown();
bool AppendData(MediaLargeByteBuffer* aData, TimeUnit aTimestampOffset) override;
bool AppendData(MediaByteBuffer* aData, TimeUnit aTimestampOffset) override;
// Append data to the current decoder. Also responsible for calling
// NotifyDataArrived on the decoder to keep buffered range computation up
@ -119,7 +119,7 @@ private:
// Helper for AppendData, ensures NotifyDataArrived is called whenever
// data is appended to the current decoder's SourceBufferResource.
bool AppendDataToCurrentResource(MediaLargeByteBuffer* aData,
bool AppendDataToCurrentResource(MediaByteBuffer* aData,
uint32_t aDuration /* microseconds */);
// Queue on the parent's decoder task queue a call to NotifyTimeRangesChanged.
void NotifyTimeRangesChanged();
@ -163,7 +163,7 @@ private:
SourceBufferDecoder* aDecoder);
nsAutoPtr<ContainerParser> mParser;
nsRefPtr<MediaLargeByteBuffer> mInputBuffer;
nsRefPtr<MediaByteBuffer> mInputBuffer;
// A task queue using the shared media thread pool. Used exclusively to
// initialize (i.e. call ReadMetadata on) decoders as they are created via

Просмотреть файл

@ -38,7 +38,7 @@ AppendStateToStr(TrackBuffersManager::AppendState aState)
}
TrackBuffersManager::TrackBuffersManager(dom::SourceBuffer* aParent, MediaSourceDecoder* aParentDecoder, const nsACString& aType)
: mInputBuffer(new MediaLargeByteBuffer)
: mInputBuffer(new MediaByteBuffer)
, mAppendState(AppendState::WAITING_FOR_SEGMENT)
, mBufferFull(false)
, mFirstInitializationSegmentReceived(false)
@ -65,7 +65,7 @@ TrackBuffersManager::TrackBuffersManager(dom::SourceBuffer* aParent, MediaSource
}
bool
TrackBuffersManager::AppendData(MediaLargeByteBuffer* aData,
TrackBuffersManager::AppendData(MediaByteBuffer* aData,
TimeUnit aTimestampOffset)
{
MOZ_ASSERT(NS_IsMainThread());
@ -316,13 +316,13 @@ TrackBuffersManager::CompleteResetParserState()
// during the next Segment Parser Loop and a new demuxer will be created and
// initialized.
if (mFirstInitializationSegmentReceived) {
nsRefPtr<MediaLargeByteBuffer> initData = mParser->InitData();
nsRefPtr<MediaByteBuffer> initData = mParser->InitData();
MOZ_ASSERT(initData->Length(), "we must have an init segment");
// The aim here is really to destroy our current demuxer.
CreateDemuxerforMIMEType();
// Recreate our input buffer. We can't directly assign the initData buffer
// to mInputBuffer as it will get modified in the Segment Parser Loop.
mInputBuffer = new MediaLargeByteBuffer;
mInputBuffer = new MediaByteBuffer;
MOZ_ALWAYS_TRUE(mInputBuffer->AppendElements(*initData, fallible));
}
RecreateParser();
@ -927,7 +927,7 @@ TrackBuffersManager::CodedFrameProcessing()
} else {
// The mediaRange is offset by the init segment position previously added.
length = mediaRange.mEnd - (mProcessedInput - mInputBuffer->Length());
nsRefPtr<MediaLargeByteBuffer> segment = new MediaLargeByteBuffer;
nsRefPtr<MediaByteBuffer> segment = new MediaByteBuffer;
MOZ_ASSERT(mInputBuffer->Length() >= length);
if (!segment->AppendElements(mInputBuffer->Elements(), length, fallible)) {
return CodedFrameProcessingPromise::CreateAndReject(NS_ERROR_OUT_OF_MEMORY, __func__);
@ -1380,7 +1380,7 @@ TrackBuffersManager::RecreateParser()
// as it has parsed the entire InputBuffer provided.
// Once the old TrackBuffer/MediaSource implementation is removed
// we can optimize this part. TODO
nsRefPtr<MediaLargeByteBuffer> initData = mParser->InitData();
nsRefPtr<MediaByteBuffer> initData = mParser->InitData();
mParser = ContainerParser::CreateForMIMEType(mType);
if (initData) {
int64_t start, end;

Просмотреть файл

@ -20,7 +20,7 @@
namespace mozilla {
class ContainerParser;
class MediaLargeByteBuffer;
class MediaByteBuffer;
class MediaRawData;
class MediaSourceDemuxer;
class SourceBuffer;
@ -40,7 +40,7 @@ public:
TrackBuffersManager(dom::SourceBuffer* aParent, MediaSourceDecoder* aParentDecoder, const nsACString& aType);
bool AppendData(MediaLargeByteBuffer* aData, TimeUnit aTimestampOffset) override;
bool AppendData(MediaByteBuffer* aData, TimeUnit aTimestampOffset) override;
nsRefPtr<AppendPromise> BufferAppend() override;
@ -116,12 +116,12 @@ private:
return mAudioTracks.mNumTracks > 0;
}
typedef Pair<nsRefPtr<MediaLargeByteBuffer>, TimeUnit> IncomingBuffer;
typedef Pair<nsRefPtr<MediaByteBuffer>, TimeUnit> IncomingBuffer;
void AppendIncomingBuffer(IncomingBuffer aData);
nsTArray<IncomingBuffer> mIncomingBuffers;
// The input buffer as per http://w3c.github.io/media-source/index.html#sourcebuffer-input-buffer
nsRefPtr<MediaLargeByteBuffer> mInputBuffer;
nsRefPtr<MediaByteBuffer> mInputBuffer;
// The current append state as per https://w3c.github.io/media-source/#sourcebuffer-append-state
// Accessed on both the main thread and the task queue.
Atomic<AppendState> mAppendState;

Просмотреть файл

@ -68,6 +68,7 @@ GonkDecoderModule::SupportsMimeType(const nsACString& aMimeType)
aMimeType.EqualsLiteral("audio/amr-wb") ||
aMimeType.EqualsLiteral("video/mp4") ||
aMimeType.EqualsLiteral("video/mp4v-es") ||
aMimeType.EqualsLiteral("video/avc");
aMimeType.EqualsLiteral("video/avc") ||
aMimeType.EqualsLiteral("video/3gpp");
}
} // namespace mozilla

Просмотреть файл

@ -22,7 +22,9 @@
#include "mozilla/plugins/PluginBridge.h"
#include "mozilla/plugins/PluginInstanceParent.h"
#include "mozilla/Preferences.h"
#ifdef MOZ_ENABLE_PROFILER_SPS
#include "mozilla/ProfileGatherer.h"
#endif
#include "mozilla/ProcessHangMonitor.h"
#include "mozilla/Services.h"
#include "mozilla/Telemetry.h"
@ -59,7 +61,9 @@
using base::KillProcess;
using mozilla::PluginLibrary;
#ifdef MOZ_ENABLE_PROFILER_SPS
using mozilla::ProfileGatherer;
#endif
using mozilla::ipc::MessageChannel;
using mozilla::ipc::GeckoChildProcessHost;
using mozilla::dom::PCrashReporterParent;
@ -3106,10 +3110,12 @@ PluginModuleChromeParent::GatheredAsyncProfile(nsIProfileSaveEvent* aSaveEvent)
mProfile.Truncate();
}
}
#endif // MOZ_ENABLE_PROFILER_SPS
bool
PluginModuleChromeParent::RecvProfile(const nsCString& aProfile)
{
#ifdef MOZ_ENABLE_PROFILER_SPS
if (NS_WARN_IF(!mGatherer)) {
return true;
}
@ -3117,7 +3123,8 @@ PluginModuleChromeParent::RecvProfile(const nsCString& aProfile)
mProfile = aProfile;
mGatherer->GatheredOOPProfile();
mGatherer = nullptr;
#endif
return true;
}
#endif

Просмотреть файл

@ -35,7 +35,9 @@ class nsIProfileSaveEvent;
class nsPluginTag;
namespace mozilla {
#ifdef MOZ_ENABLE_PROFILER_SPS
class ProfileGatherer;
#endif
namespace dom {
class PCrashReporterParent;
class CrashReporterParent;
@ -417,8 +419,10 @@ class PluginModuleChromeParent
void OnEnteredSyncSend() override;
void OnExitedSyncSend() override;
#ifdef MOZ_ENABLE_PROFILER_SPS
void GatherAsyncProfile(mozilla::ProfileGatherer* aGatherer);
void GatheredAsyncProfile(nsIProfileSaveEvent* aSaveEvent);
#endif
virtual bool
RecvProfile(const nsCString& aProfile) override;
@ -580,7 +584,9 @@ private:
NPError mAsyncInitError;
dom::ContentParent* mContentParent;
nsCOMPtr<nsIObserver> mOfflineObserver;
#ifdef MOZ_ENABLE_PROFILER_SPS
nsRefPtr<mozilla::ProfileGatherer> mGatherer;
#endif
nsCString mProfile;
bool mIsBlocklisted;
static bool sInstantiated;

Просмотреть файл

@ -613,12 +613,19 @@ nsHTMLCSSUtils::GetDefaultLengthUnit(nsAString & aLengthUnit)
}
}
// Unfortunately, CSSStyleDeclaration::GetPropertyCSSValue is not yet implemented...
// We need then a way to determine the number part and the unit from aString, aString
// being the result of a GetPropertyValue query...
// Unfortunately, CSSStyleDeclaration::GetPropertyCSSValue is not yet
// implemented... We need then a way to determine the number part and the unit
// from aString, aString being the result of a GetPropertyValue query...
void
nsHTMLCSSUtils::ParseLength(const nsAString & aString, float * aValue, nsIAtom ** aUnit)
nsHTMLCSSUtils::ParseLength(const nsAString& aString, float* aValue,
nsIAtom** aUnit)
{
if (aString.IsEmpty()) {
*aValue = 0;
*aUnit = NS_NewAtom(aString).take();
return;
}
nsAString::const_iterator iter;
aString.BeginReading(iter);

Просмотреть файл

@ -1615,39 +1615,35 @@ DrawTargetCG::CopySurface(SourceSurface *aSurface,
MarkChanged();
if (aSurface->GetType() == SurfaceType::COREGRAPHICS_IMAGE ||
aSurface->GetType() == SurfaceType::COREGRAPHICS_CGCONTEXT ||
aSurface->GetType() == SurfaceType::DATA) {
CGImageRef image = GetRetainedImageFromSourceSurface(aSurface);
CGImageRef image = GetRetainedImageFromSourceSurface(aSurface);
// XXX: it might be more efficient for us to do the copy directly if we have access to the bits
// XXX: it might be more efficient for us to do the copy directly if we have access to the bits
CGContextSaveGState(mCg);
CGContextSetCTM(mCg, mOriginalTransform);
CGContextSaveGState(mCg);
CGContextSetCTM(mCg, mOriginalTransform);
// CopySurface ignores the clip, so we need to use private API to temporarily reset it
CGContextResetClip(mCg);
CGRect destRect = CGRectMake(aDestination.x, aDestination.y,
aSourceRect.width, aSourceRect.height);
CGContextClipToRect(mCg, destRect);
// CopySurface ignores the clip, so we need to use private API to temporarily reset it
CGContextResetClip(mCg);
CGRect destRect = CGRectMake(aDestination.x, aDestination.y,
aSourceRect.width, aSourceRect.height);
CGContextClipToRect(mCg, destRect);
CGContextSetBlendMode(mCg, kCGBlendModeCopy);
CGContextSetBlendMode(mCg, kCGBlendModeCopy);
CGContextScaleCTM(mCg, 1, -1);
CGContextScaleCTM(mCg, 1, -1);
CGRect flippedRect = CGRectMake(aDestination.x - aSourceRect.x, -(aDestination.y - aSourceRect.y + double(CGImageGetHeight(image))),
CGImageGetWidth(image), CGImageGetHeight(image));
CGRect flippedRect = CGRectMake(aDestination.x - aSourceRect.x, -(aDestination.y - aSourceRect.y + double(CGImageGetHeight(image))),
CGImageGetWidth(image), CGImageGetHeight(image));
// Quartz seems to copy A8 surfaces incorrectly if we don't initialize them
// to transparent first.
if (mFormat == SurfaceFormat::A8) {
CGContextClearRect(mCg, flippedRect);
}
CGContextDrawImage(mCg, flippedRect, image);
CGContextRestoreGState(mCg);
CGImageRelease(image);
// Quartz seems to copy A8 surfaces incorrectly if we don't initialize them
// to transparent first.
if (mFormat == SurfaceFormat::A8) {
CGContextClearRect(mCg, flippedRect);
}
CGContextDrawImage(mCg, flippedRect, image);
CGContextRestoreGState(mCg);
CGImageRelease(image);
}
void

Просмотреть файл

@ -1756,6 +1756,7 @@ BorrowedXlibDrawable::Init(DrawTarget* aDT)
if (cairo_surface_get_type(surf) != CAIRO_SURFACE_TYPE_XLIB) {
return false;
}
cairo_surface_flush(surf);
cairoDT->WillChange();
@ -1774,6 +1775,9 @@ BorrowedXlibDrawable::Init(DrawTarget* aDT)
void
BorrowedXlibDrawable::Finish()
{
DrawTargetCairo* cairoDT = static_cast<DrawTargetCairo*>(mDT);
cairo_surface_t* surf = cairoDT->mSurface;
cairo_surface_mark_dirty(surf);
if (mDrawable) {
mDrawable = None;
}

Просмотреть файл

@ -1453,29 +1453,46 @@ DrawTargetD2D1::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha)
D2D1_RECT_F samplingBounds;
Matrix mat = pat->mMatrix;
bool useSamplingRect = false;
if (!pat->mSamplingRect.IsEmpty() &&
(pat->mSurface->GetType() == SurfaceType::D2D1_1_IMAGE)) {
samplingBounds = D2DRect(pat->mSamplingRect);
mat.PreTranslate(pat->mSamplingRect.x, pat->mSamplingRect.y);
} else if (!pat->mSamplingRect.IsEmpty()) {
// We will do a partial upload of the sampling restricted area from GetImageForSurface.
samplingBounds = D2D1::RectF(0, 0, pat->mSamplingRect.width, pat->mSamplingRect.height);
} else {
samplingBounds = D2D1::RectF(0, 0,
Float(pat->mSurface->GetSize().width),
Float(pat->mSurface->GetSize().height));
}
MOZ_ASSERT(pat->mSurface->IsValid());
RefPtr<ID2D1ImageBrush> imageBrush;
RefPtr<ID2D1Image> image = GetImageForSurface(pat->mSurface, mat, pat->mExtendMode, !pat->mSamplingRect.IsEmpty() ? &pat->mSamplingRect : nullptr);
if (!image) {
return CreateTransparentBlackBrush();
}
bool useSamplingRect = false;
if (pat->mSamplingRect.IsEmpty()) {
RefPtr<ID2D1Bitmap> bitmap;
image->QueryInterface((ID2D1Bitmap**)byRef(bitmap));
if (bitmap) {
RefPtr<ID2D1BitmapBrush> bitmapBrush;
mDC->CreateBitmapBrush(bitmap,
D2D1::BitmapBrushProperties(D2DExtend(pat->mExtendMode),
D2DExtend(pat->mExtendMode),
D2DFilter(pat->mFilter)),
D2D1::BrushProperties(aAlpha, D2DMatrix(mat)),
byRef(bitmapBrush));
if (!bitmapBrush) {
gfxWarning() << "Couldn't create bitmap brush!";
return CreateTransparentBlackBrush();
}
return bitmapBrush.forget();
}
}
RefPtr<ID2D1ImageBrush> imageBrush;
if (pat->mSamplingRect.IsEmpty()) {
samplingBounds = D2D1::RectF(0, 0,
Float(pat->mSurface->GetSize().width),
Float(pat->mSurface->GetSize().height));
} else if (pat->mSurface->GetType() == SurfaceType::D2D1_1_IMAGE) {
samplingBounds = D2DRect(pat->mSamplingRect);
mat.PreTranslate(pat->mSamplingRect.x, pat->mSamplingRect.y);
} else {
// We will do a partial upload of the sampling restricted area from GetImageForSurface.
samplingBounds = D2D1::RectF(0, 0, pat->mSamplingRect.width, pat->mSamplingRect.height);
}
mDC->CreateImageBrush(image,
D2D1::ImageBrushProperties(samplingBounds,
D2DExtend(pat->mExtendMode),

Просмотреть файл

@ -127,6 +127,7 @@ static inline SurfaceFormat ToPixelFormat(const D2D1_PIXEL_FORMAT &aFormat)
{
switch(aFormat.format) {
case DXGI_FORMAT_A8_UNORM:
case DXGI_FORMAT_R8_UNORM:
return SurfaceFormat::A8;
case DXGI_FORMAT_B8G8R8A8_UNORM:
if (aFormat.alphaMode == D2D1_ALPHA_MODE_IGNORE) {

Просмотреть файл

@ -237,7 +237,7 @@ IMFYCbCrImage::GetTextureClient(CompositableClient* aClient)
RefPtr<ID3D11DeviceContext> ctx;
device->GetImmediateContext(byRef(ctx));
CD3D11_TEXTURE2D_DESC newDesc(DXGI_FORMAT_A8_UNORM,
CD3D11_TEXTURE2D_DESC newDesc(DXGI_FORMAT_R8_UNORM,
mData.mYSize.width, mData.mYSize.height, 1, 1);
newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;

Просмотреть файл

@ -159,14 +159,14 @@ VS_MASK_3D_OUTPUT LayerQuadMask3DVS(const VS_INPUT aVertex)
float4 RGBAShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target
{
float2 maskCoords = aVertex.vMaskCoords;
float mask = tMask.Sample(sSampler, maskCoords).a;
float mask = tMask.Sample(sSampler, maskCoords).r;
return tRGB.Sample(sSampler, aVertex.vTexCoords) * fLayerOpacity * mask;
}
float4 RGBAShaderMask3D(const VS_MASK_3D_OUTPUT aVertex) : SV_Target
{
float2 maskCoords = aVertex.vMaskCoords.xy / aVertex.vMaskCoords.z;
float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a;
float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).r;
return tRGB.Sample(sSampler, aVertex.vTexCoords) * fLayerOpacity * mask;
}
@ -177,7 +177,7 @@ float4 RGBShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target
result.a = fLayerOpacity;
float2 maskCoords = aVertex.vMaskCoords;
float mask = tMask.Sample(sSampler, maskCoords).a;
float mask = tMask.Sample(sSampler, maskCoords).r;
return result * mask;
}
@ -196,9 +196,9 @@ float4 CalculateYCbCrColor(const float2 aTexCoords)
float4 yuv;
float4 color;
yuv.r = tCr.Sample(sSampler, aTexCoords).a - 0.50196;
yuv.g = tY.Sample(sSampler, aTexCoords).a - 0.06275;
yuv.b = tCb.Sample(sSampler, aTexCoords).a - 0.50196;
yuv.r = tCr.Sample(sSampler, aTexCoords).r - 0.50196;
yuv.g = tY.Sample(sSampler, aTexCoords).r - 0.06275;
yuv.b = tCb.Sample(sSampler, aTexCoords).r - 0.50196;
color.r = yuv.g * 1.16438 + yuv.r * 1.59603;
color.g = yuv.g * 1.16438 - 0.81297 * yuv.r - 0.39176 * yuv.b;
@ -211,7 +211,7 @@ float4 CalculateYCbCrColor(const float2 aTexCoords)
float4 YCbCrShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target
{
float2 maskCoords = aVertex.vMaskCoords;
float mask = tMask.Sample(sSampler, maskCoords).a;
float mask = tMask.Sample(sSampler, maskCoords).r;
return CalculateYCbCrColor(aVertex.vTexCoords) * fLayerOpacity * mask;
}
@ -225,7 +225,7 @@ PS_OUTPUT ComponentAlphaShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target
result.vSrc.a = result.vAlpha.g;
float2 maskCoords = aVertex.vMaskCoords;
float mask = tMask.Sample(sSampler, maskCoords).a;
float mask = tMask.Sample(sSampler, maskCoords).r;
result.vSrc *= fLayerOpacity * mask;
result.vAlpha *= fLayerOpacity * mask;
@ -235,7 +235,7 @@ PS_OUTPUT ComponentAlphaShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target
float4 SolidColorShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target
{
float2 maskCoords = aVertex.vMaskCoords;
float mask = tMask.Sample(sSampler, maskCoords).a;
float mask = tMask.Sample(sSampler, maskCoords).r;
return fLayerColor * mask;
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,6 +1,10 @@
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// fxc -nologo -Tvs_4_0_level_9_3 CompositorD3D11VR.hlsl
// -EOculusVRDistortionVS -VnOculusVRDistortionVS -FhtmpShaderHeader
//
//
// Buffer Definitions:
@ -24,24 +28,24 @@
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 xy 0 NONE float xy
// TEXCOORD 0 xy 1 NONE float xy
// TEXCOORD 1 xy 2 NONE float xy
// TEXCOORD 2 xy 3 NONE float xy
// COLOR 0 xyzw 4 NONE float xyzw
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// POSITION 0 xy 0 NONE float xy
// TEXCOORD 0 xy 1 NONE float xy
// TEXCOORD 1 xy 2 NONE float xy
// TEXCOORD 2 xy 3 NONE float xy
// COLOR 0 xyzw 4 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xyz 1 NONE float xyz
// TEXCOORD 1 xyz 2 NONE float xyz
// TEXCOORD 2 xyz 3 NONE float xyz
// COLOR 0 xyzw 4 NONE float xyzw
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_Position 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xyz 1 NONE float xyz
// TEXCOORD 1 xyz 2 NONE float xyz
// TEXCOORD 2 xyz 3 NONE float xyz
// COLOR 0 xyzw 4 NONE float xyzw
//
//
// Constant buffer to DX9 shader constant mappings:
@ -106,10 +110,10 @@ ret
const BYTE OculusVRDistortionVS[] =
{
68, 88, 66, 67, 3, 61,
196, 122, 10, 53, 44, 234,
18, 242, 195, 238, 42, 90,
72, 193, 1, 0, 0, 0,
68, 88, 66, 67, 206, 154,
203, 64, 121, 47, 121, 169,
222, 206, 108, 175, 167, 227,
154, 37, 1, 0, 0, 0,
244, 5, 0, 0, 6, 0,
0, 0, 56, 0, 0, 0,
108, 1, 0, 0, 44, 3,
@ -245,7 +249,7 @@ const BYTE OculusVRDistortionVS[] =
116, 0, 0, 0, 10, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 10, 0,
0, 0, 4, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0,
@ -303,9 +307,9 @@ const BYTE OculusVRDistortionVS[] =
83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111,
109, 112, 105, 108, 101, 114,
32, 54, 46, 51, 46, 57,
54, 48, 48, 46, 49, 54,
51, 56, 52, 0, 171, 171,
32, 57, 46, 50, 57, 46,
57, 53, 50, 46, 51, 49,
49, 49, 0, 171, 171, 171,
73, 83, 71, 78, 152, 0,
0, 0, 5, 0, 0, 0,
8, 0, 0, 0, 128, 0,
@ -363,7 +367,11 @@ const BYTE OculusVRDistortionVS[] =
};
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// fxc -nologo -Tps_4_0_level_9_3 CompositorD3D11VR.hlsl
// -EOculusVRDistortionPS -VnOculusVRDistortionPS -FhtmpShaderHeader
//
//
// Resource Bindings:
@ -377,20 +385,20 @@ const BYTE OculusVRDistortionVS[] =
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float
// TEXCOORD 0 xyz 1 NONE float xy
// TEXCOORD 1 xyz 2 NONE float xy
// TEXCOORD 2 xyz 3 NONE float xy
// COLOR 0 xyzw 4 NONE float x
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_Position 0 xyzw 0 POS float
// TEXCOORD 0 xyz 1 NONE float xy
// TEXCOORD 1 xyz 2 NONE float xy
// TEXCOORD 2 xyz 3 NONE float xy
// COLOR 0 xyzw 4 NONE float x
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------ ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
//
// Sampler/Resource to DX9 shader sampler mappings:
@ -441,15 +449,15 @@ ret
const BYTE OculusVRDistortionPS[] =
{
68, 88, 66, 67, 108, 219,
61, 216, 27, 0, 27, 222,
242, 132, 183, 21, 166, 141,
130, 39, 1, 0, 0, 0,
128, 4, 0, 0, 6, 0,
68, 88, 66, 67, 48, 161,
127, 216, 149, 107, 53, 57,
164, 84, 84, 154, 58, 227,
125, 61, 1, 0, 0, 0,
124, 4, 0, 0, 6, 0,
0, 0, 56, 0, 0, 0,
60, 1, 0, 0, 132, 2,
0, 0, 0, 3, 0, 0,
168, 3, 0, 0, 76, 4,
164, 3, 0, 0, 72, 4,
0, 0, 65, 111, 110, 57,
252, 0, 0, 0, 252, 0,
0, 0, 0, 2, 255, 255,
@ -569,7 +577,7 @@ const BYTE OculusVRDistortionPS[] =
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
82, 68, 69, 70, 160, 0,
82, 68, 69, 70, 156, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0,
0, 0, 28, 0, 0, 0,
@ -594,43 +602,43 @@ const BYTE OculusVRDistortionPS[] =
76, 32, 83, 104, 97, 100,
101, 114, 32, 67, 111, 109,
112, 105, 108, 101, 114, 32,
54, 46, 51, 46, 57, 54,
48, 48, 46, 49, 54, 51,
56, 52, 0, 171, 171, 171,
73, 83, 71, 78, 156, 0,
0, 0, 5, 0, 0, 0,
8, 0, 0, 0, 128, 0,
0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0,
0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 140, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 1, 0, 0, 0,
7, 3, 0, 0, 140, 0,
0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 2, 0, 0, 0,
7, 3, 0, 0, 140, 0,
0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 3, 0, 0, 0,
7, 3, 0, 0, 149, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0,
0, 0, 4, 0, 0, 0,
15, 1, 0, 0, 83, 86,
95, 80, 111, 115, 105, 116,
105, 111, 110, 0, 84, 69,
88, 67, 79, 79, 82, 68,
0, 67, 79, 76, 79, 82,
0, 171, 79, 83, 71, 78,
44, 0, 0, 0, 1, 0,
57, 46, 50, 57, 46, 57,
53, 50, 46, 51, 49, 49,
49, 0, 73, 83, 71, 78,
156, 0, 0, 0, 5, 0,
0, 0, 8, 0, 0, 0,
32, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
128, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0,
83, 86, 95, 84, 97, 114,
103, 101, 116, 0, 171, 171
140, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0,
0, 0, 7, 3, 0, 0,
140, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0,
0, 0, 7, 3, 0, 0,
140, 0, 0, 0, 2, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 3, 0,
0, 0, 7, 3, 0, 0,
149, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 4, 0,
0, 0, 15, 1, 0, 0,
83, 86, 95, 80, 111, 115,
105, 116, 105, 111, 110, 0,
84, 69, 88, 67, 79, 79,
82, 68, 0, 67, 79, 76,
79, 82, 0, 171, 79, 83,
71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0,
0, 0, 32, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0,
0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0,
171, 171
};

Просмотреть файл

@ -34,7 +34,7 @@ SurfaceFormatToDXGIFormat(gfx::SurfaceFormat aFormat)
case SurfaceFormat::R8G8B8X8:
return DXGI_FORMAT_R8G8B8A8_UNORM;
case SurfaceFormat::A8:
return DXGI_FORMAT_A8_UNORM;
return DXGI_FORMAT_R8_UNORM;
default:
MOZ_ASSERT(false, "unsupported format");
return DXGI_FORMAT_UNKNOWN;
@ -451,7 +451,7 @@ TextureClientD3D11::AllocateForSurface(gfx::IntSize aSize, TextureAllocationFlag
if (gfxPrefs::Direct2DUse1_1() && d3d11device) {
CD3D11_TEXTURE2D_DESC newDesc(mFormat == SurfaceFormat::A8 ? DXGI_FORMAT_A8_UNORM : DXGI_FORMAT_B8G8R8A8_UNORM,
CD3D11_TEXTURE2D_DESC newDesc(mFormat == SurfaceFormat::A8 ? DXGI_FORMAT_R8_UNORM : DXGI_FORMAT_B8G8R8A8_UNORM,
aSize.width, aSize.height, 1, 1,
D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);

Просмотреть файл

@ -1830,23 +1830,7 @@ bool DoesD3D11TextureSharingWork(ID3D11Device *device)
bool DoesD3D11AlphaTextureSharingWork(ID3D11Device *device)
{
nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
if (gfxInfo) {
// A8 texture sharing crashes on this intel driver version (and no others)
// so just avoid using it in that case.
nsString adapterVendor;
nsString driverVersion;
gfxInfo->GetAdapterVendorID(adapterVendor);
gfxInfo->GetAdapterDriverVersion(driverVersion);
nsAString &intelVendorID = (nsAString &)GfxDriverInfo::GetDeviceVendor(VendorIntel);
if (adapterVendor.Equals(intelVendorID, nsCaseInsensitiveStringComparator()) &&
driverVersion.Equals(NS_LITERAL_STRING("8.15.10.2086"))) {
return false;
}
}
return DoesD3D11TextureSharingWorkInternal(device, DXGI_FORMAT_A8_UNORM, D3D11_BIND_SHADER_RESOURCE);
return DoesD3D11TextureSharingWorkInternal(device, DXGI_FORMAT_R8_UNORM, D3D11_BIND_SHADER_RESOURCE);
}
void

Просмотреть файл

@ -9,7 +9,9 @@
#include <limits.h>
#include "js/TracingAPI.h"
#include "jspubtd.h"
#include "js/TraceKind.h"
#include "js/Utility.h"
/* These values are private to the JS engine. */
@ -165,6 +167,7 @@ class JS_FRIEND_API(GCCellPtr)
explicit GCCellPtr(JSFunction* fun) : ptr(checkedCast(fun, JS::TraceKind::Object)) { }
explicit GCCellPtr(JSString* str) : ptr(checkedCast(str, JS::TraceKind::String)) { }
explicit GCCellPtr(JSFlatString* str) : ptr(checkedCast(str, JS::TraceKind::String)) { }
explicit GCCellPtr(JS::Symbol* sym) : ptr(checkedCast(sym, JS::TraceKind::Symbol)) { }
explicit GCCellPtr(JSScript* script) : ptr(checkedCast(script, JS::TraceKind::Script)) { }
explicit GCCellPtr(const Value& v);

52
js/public/TraceKind.h Normal file
Просмотреть файл

@ -0,0 +1,52 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sts=4 et sw=4 tw=99:
* 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 js_TraceKind_h
#define js_TraceKind_h
namespace JS {
// When tracing a thing, the GC needs to know about the layout of the object it
// is looking at. There are a fixed number of different layouts that the GC
// knows about. The "trace kind" is a static map which tells which layout a GC
// thing has.
//
// Although this map is public, the details are completely hidden. Not all of
// the matching C++ types are exposed, and those that are, are opaque.
//
// See Value::gcKind() and JSTraceCallback in Tracer.h for more details.
enum class TraceKind
{
// These trace kinds have a publicly exposed, although opaque, C++ type.
// Note: The order here is determined by our Value packing. Other users
// should sort alphabetically, for consistency.
Object = 0x00,
String = 0x01,
Symbol = 0x02,
Script = 0x03,
// Shape details are exposed through JS_TraceShapeCycleCollectorChildren.
Shape = 0x04,
// ObjectGroup details are exposed through JS_TraceObjectGroupCycleCollectorChildren.
ObjectGroup = 0x05,
// The kind associated with a nullptr.
Null = 0x06,
// The following kinds do not have an exposed C++ idiom.
BaseShape = 0x0F,
JitCode = 0x1F,
LazyScript = 0x2F
};
const static uintptr_t OutOfLineTraceKindMask = 0x07;
static_assert(uintptr_t(JS::TraceKind::BaseShape) & OutOfLineTraceKindMask, "mask bits are set");
static_assert(uintptr_t(JS::TraceKind::JitCode) & OutOfLineTraceKindMask, "mask bits are set");
static_assert(uintptr_t(JS::TraceKind::LazyScript) & OutOfLineTraceKindMask, "mask bits are set");
} // namespace JS
#endif // js_TraceKind_h

Просмотреть файл

@ -8,9 +8,10 @@
#define js_TracingAPI_h
#include "jsalloc.h"
#include "jspubtd.h"
#include "js/HashTable.h"
#include "js/HeapAPI.h"
#include "js/TraceKind.h"
class JS_PUBLIC_API(JSTracer);
@ -19,66 +20,20 @@ class JS_PUBLIC_API(CallbackTracer);
template <typename T> class Heap;
template <typename T> class TenuredHeap;
// When tracing a thing, the GC needs to know about the layout of the object it
// is looking at. There are a fixed number of different layouts that the GC
// knows about. The "trace kind" is a static map which tells which layout a GC
// thing has.
//
// Although this map is public, the details are completely hidden. Not all of
// the matching C++ types are exposed, and those that are, are opaque.
//
// See Value::gcKind() and JSTraceCallback in Tracer.h for more details.
enum class TraceKind
{
// These trace kinds have a publicly exposed, although opaque, C++ type.
// Note: The order here is determined by our Value packing. Other users
// should sort alphabetically, for consistency.
Object = 0x00,
String = 0x01,
Symbol = 0x02,
Script = 0x03,
// Shape details are exposed through JS_TraceShapeCycleCollectorChildren.
Shape = 0x04,
// ObjectGroup details are exposed through JS_TraceObjectGroupCycleCollectorChildren.
ObjectGroup = 0x05,
// The kind associated with a nullptr.
Null = 0x06,
// The following kinds do not have an exposed C++ idiom.
BaseShape = 0x0F,
JitCode = 0x1F,
LazyScript = 0x2F
};
const static uintptr_t OutOfLineTraceKindMask = 0x07;
static_assert(uintptr_t(JS::TraceKind::BaseShape) & OutOfLineTraceKindMask, "mask bits are set");
static_assert(uintptr_t(JS::TraceKind::JitCode) & OutOfLineTraceKindMask, "mask bits are set");
static_assert(uintptr_t(JS::TraceKind::LazyScript) & OutOfLineTraceKindMask, "mask bits are set");
// Returns a static string equivalent of |kind|.
JS_FRIEND_API(const char*)
GCTraceKindToAscii(JS::TraceKind kind);
} // namespace JS
// Tracer callback, called for each traceable thing directly referenced by a
// particular object or runtime structure. It is the callback responsibility
// to ensure the traversal of the full object graph via calling eventually
// JS_TraceChildren on the passed thing. In this case the callback must be
// prepared to deal with cycles in the traversal graph.
//
// kind argument is one of JS::TraceKind::Object, JS::TraceKind::String or a
// tag denoting internal implementation-specific traversal kind. In the latter
// case the only operations on thing that the callback can do is to call
// JS_TraceChildren or JS_GetTraceThingInfo.
//
// If eagerlyTraceWeakMaps is true, when we trace a WeakMap visit all
// of its mappings. This should be used in cases where the tracer
// wants to use the existing liveness of entries.
typedef void
(* JSTraceCallback)(JS::CallbackTracer* trc, void** thingp, JS::TraceKind kind);
namespace js {
class BaseShape;
class LazyScript;
class ObjectGroup;
namespace jit {
class JitCode;
} // namespace jit
} // namespace js
enum WeakMapTraceKind {
DoNotTraceWeakMaps = 0,
@ -132,8 +87,34 @@ class JS_PUBLIC_API(CallbackTracer) : public JSTracer
contextName_(nullptr), contextIndex_(InvalidIndex), contextFunctor_(nullptr)
{}
// Override this method to receive notification when an edge is visited.
virtual void trace(void** thing, JS::TraceKind kind) = 0;
// Override these methods to receive notification when an edge is visited
// with the type contained in the callback. The default implementation
// dispatches to the fully-generic onChild implementation, so for cases that
// do not care about boxing overhead and do not need the actual edges,
// just override the generic onChild.
virtual void onObjectEdge(JSObject** objp) { onChild(JS::GCCellPtr(*objp)); }
virtual void onStringEdge(JSString** strp) { onChild(JS::GCCellPtr(*strp)); }
virtual void onSymbolEdge(JS::Symbol** symp) { onChild(JS::GCCellPtr(*symp)); }
virtual void onScriptEdge(JSScript** scriptp) { onChild(JS::GCCellPtr(*scriptp)); }
virtual void onShapeEdge(js::Shape** shapep) {
onChild(JS::GCCellPtr(*shapep, JS::TraceKind::Shape));
}
virtual void onObjectGroupEdge(js::ObjectGroup** groupp) {
onChild(JS::GCCellPtr(*groupp, JS::TraceKind::ObjectGroup));
}
virtual void onBaseShapeEdge(js::BaseShape** basep) {
onChild(JS::GCCellPtr(*basep, JS::TraceKind::BaseShape));
}
virtual void onJitCodeEdge(js::jit::JitCode** codep) {
onChild(JS::GCCellPtr(*codep, JS::TraceKind::JitCode));
}
virtual void onLazyScriptEdge(js::LazyScript** lazyp) {
onChild(JS::GCCellPtr(*lazyp, JS::TraceKind::LazyScript));
}
// Override this method to receive notification when a node in the GC
// heap graph is visited.
virtual void onChild(const JS::GCCellPtr& thing) = 0;
// Access to the tracing context:
// When tracing with a JS::CallbackTracer, we invoke the callback with the
@ -185,6 +166,21 @@ class JS_PUBLIC_API(CallbackTracer) : public JSTracer
virtual TracerKind getTracerKind() const { return TracerKind::DoNotCare; }
#endif
// In C++, overriding a method hides all methods in the base class with
// that name, not just methods with that signature. Thus, the typed edge
// methods have to have distinct names to allow us to override them
// individually, which is freqently useful if, for example, we only want to
// process only one type of edge.
void dispatchToOnEdge(JSObject** objp) { onObjectEdge(objp); }
void dispatchToOnEdge(JSString** strp) { onStringEdge(strp); }
void dispatchToOnEdge(JS::Symbol** symp) { onSymbolEdge(symp); }
void dispatchToOnEdge(JSScript** scriptp) { onScriptEdge(scriptp); }
void dispatchToOnEdge(js::Shape** shapep) { onShapeEdge(shapep); }
void dispatchToOnEdge(js::ObjectGroup** groupp) { onObjectGroupEdge(groupp); }
void dispatchToOnEdge(js::BaseShape** basep) { onBaseShapeEdge(basep); }
void dispatchToOnEdge(js::jit::JitCode** codep) { onJitCodeEdge(codep); }
void dispatchToOnEdge(js::LazyScript** lazyp) { onLazyScriptEdge(lazyp); }
private:
friend class AutoTracingName;
const char* contextName_;

Просмотреть файл

@ -331,7 +331,7 @@ class Node {
// JS::ubi::Node are both essentially tagged references to other sorts of
// objects, so letting conversions happen automatically is appropriate.
MOZ_IMPLICIT Node(JS::HandleValue value);
Node(JS::TraceKind kind, void* ptr);
explicit Node(const JS::GCCellPtr& thing);
// copy construction and copy assignment just use memcpy, since we know
// instances contain nothing but a vtable pointer and a data pointer.

Просмотреть файл

@ -808,8 +808,8 @@ class HasChildTracer : public JS::CallbackTracer
RootedValue child_;
bool found_;
void trace(void** thingp, JS::TraceKind kind) {
if (*thingp == child_.toGCThing())
void onChild(const JS::GCCellPtr& thing) override {
if (thing.asCell() == child_.toGCThing())
found_ = true;
}

Просмотреть файл

@ -138,9 +138,15 @@ void
CheckHashTablesAfterMovingGC(JSRuntime* rt);
#endif
struct MovingTracer : JS::CallbackTracer {
struct MovingTracer : JS::CallbackTracer
{
explicit MovingTracer(JSRuntime* rt) : CallbackTracer(rt, TraceWeakMapKeysValues) {}
void trace(void** thingp, JS::TraceKind kind) override;
void onObjectEdge(JSObject** objp) override;
void onChild(const JS::GCCellPtr& thing) override {
MOZ_ASSERT(!RelocationOverlay::isCellForwarded(thing.asCell()));
}
#ifdef DEBUG
TracerKind getTracerKind() const override { return TracerKind::Moving; }
#endif

Просмотреть файл

@ -1230,8 +1230,8 @@ GCMarker::processMarkStackTop(SliceBudget& budget)
case SavedValueArrayTag: {
MOZ_ASSERT(!(addr & CellMask));
JSObject* obj = reinterpret_cast<JSObject*>(addr);
HeapValue* vp;
HeapValue* end;
HeapSlot* vp;
HeapSlot* end;
if (restoreValueArray(obj, (void**)&vp, (void**)&end))
pushValueArray(&obj->as<NativeObject>(), vp, end);
else
@ -2278,9 +2278,9 @@ TypeSet::MarkTypeUnbarriered(JSTracer* trc, TypeSet::Type* v, const char* name)
#ifdef DEBUG
struct AssertNonGrayTracer : public JS::CallbackTracer {
explicit AssertNonGrayTracer(JSRuntime* rt) : JS::CallbackTracer(rt) {}
void trace(void** thingp, JS::TraceKind kind) override {
DebugOnly<Cell*> thing(static_cast<Cell*>(*thingp));
MOZ_ASSERT_IF(thing->isTenured(), !thing->asTenured().isMarked(js::gc::GRAY));
void onChild(const JS::GCCellPtr& thing) override {
MOZ_ASSERT_IF(thing.asCell()->isTenured(),
!thing.asCell()->asTenured().isMarked(js::gc::GRAY));
}
};
#endif
@ -2305,7 +2305,7 @@ struct UnmarkGrayTracer : public JS::CallbackTracer
unmarkedAny(false)
{}
void trace(void** thingp, JS::TraceKind kind) override;
void onChild(const JS::GCCellPtr& thing) override;
/* True iff we are tracing the immediate children of a shape. */
bool tracingShape;
@ -2348,7 +2348,7 @@ struct UnmarkGrayTracer : public JS::CallbackTracer
* containers.
*/
void
UnmarkGrayTracer::trace(void** thingp, JS::TraceKind kind)
UnmarkGrayTracer::onChild(const JS::GCCellPtr& thing)
{
int stackDummy;
if (!JS_CHECK_STACK_SIZE(runtime()->mainThread.nativeStackLimit[StackForSystemCode],
@ -2362,14 +2362,14 @@ UnmarkGrayTracer::trace(void** thingp, JS::TraceKind kind)
return;
}
Cell* cell = static_cast<Cell*>(*thingp);
Cell* cell = thing.asCell();
// Cells in the nursery cannot be gray, and therefore must necessarily point
// to only black edges.
if (!cell->isTenured()) {
#ifdef DEBUG
AssertNonGrayTracer nongray(runtime());
TraceChildren(&nongray, cell, kind);
TraceChildren(&nongray, cell, thing.kind());
#endif
return;
}
@ -2386,16 +2386,16 @@ UnmarkGrayTracer::trace(void** thingp, JS::TraceKind kind)
// The parent will later trace |tenured|. This is done to avoid increasing
// the stack depth during shape tracing. It is safe to do because a shape
// can only have one child that is a shape.
UnmarkGrayTracer childTracer(this, kind == JS::TraceKind::Shape);
UnmarkGrayTracer childTracer(this, thing.kind() == JS::TraceKind::Shape);
if (kind != JS::TraceKind::Shape) {
TraceChildren(&childTracer, &tenured, kind);
if (thing.kind() != JS::TraceKind::Shape) {
TraceChildren(&childTracer, &tenured, thing.kind());
MOZ_ASSERT(!childTracer.previousShape);
unmarkedAny |= childTracer.unmarkedAny;
return;
}
MOZ_ASSERT(kind == JS::TraceKind::Shape);
MOZ_ASSERT(thing.kind() == JS::TraceKind::Shape);
Shape* shape = static_cast<Shape*>(&tenured);
if (tracingShape) {
MOZ_ASSERT(!previousShape);

Просмотреть файл

@ -195,9 +195,6 @@ class GCMarker : public JSTracer
bool shouldCheckCompartments() { return strictCompartmentChecking; }
#endif
/* This is public exclusively for ScanRope. */
MarkStack stack;
private:
#ifdef DEBUG
void checkZone(void* p);
@ -257,7 +254,7 @@ class GCMarker : public JSTracer
delayMarkingChildren(ptr);
}
void pushValueArray(JSObject* obj, void* start, void* end) {
void pushValueArray(JSObject* obj, HeapSlot* start, HeapSlot* end) {
checkZone(obj);
MOZ_ASSERT(start <= end);
@ -281,6 +278,9 @@ class GCMarker : public JSTracer
void saveValueRanges();
inline void processMarkStackTop(SliceBudget& budget);
/* The mark stack. Pointers in this stack are "gray" in the GC sense. */
MarkStack stack;
/* The color is only applied to objects and functions. */
uint32_t color;

Просмотреть файл

@ -552,7 +552,7 @@ class BufferGrayRootsTracer : public JS::CallbackTracer
// Set to false if we OOM while buffering gray roots.
bool bufferingGrayRootsFailed;
void trace(void** thingp, JS::TraceKind kind) override;
void onChild(const JS::GCCellPtr& thing) override;
public:
explicit BufferGrayRootsTracer(JSRuntime* rt)
@ -605,24 +605,24 @@ struct SetMaybeAliveFunctor {
};
void
BufferGrayRootsTracer::trace(void** thingp, JS::TraceKind kind)
BufferGrayRootsTracer::onChild(const JS::GCCellPtr& thing)
{
MOZ_ASSERT(runtime()->isHeapBusy());
if (bufferingGrayRootsFailed)
return;
gc::TenuredCell* thing = gc::TenuredCell::fromPointer(*thingp);
gc::TenuredCell* tenured = gc::TenuredCell::fromPointer(thing.asCell());
Zone* zone = thing->zone();
Zone* zone = tenured->zone();
if (zone->isCollecting()) {
// See the comment on SetMaybeAliveFlag to see why we only do this for
// objects and scripts. We rely on gray root buffering for this to work,
// but we only need to worry about uncollected dead compartments during
// incremental GCs (when we do gray root buffering).
CallTyped(SetMaybeAliveFunctor(), thing, kind);
CallTyped(SetMaybeAliveFunctor(), tenured, thing.kind());
if (!zone->gcGrayRoots.append(thing))
if (!zone->gcGrayRoots.append(tenured))
bufferingGrayRootsFailed = true;
}
}

Просмотреть файл

@ -46,9 +46,8 @@ T
DoCallback(JS::CallbackTracer* trc, T* thingp, const char* name)
{
CheckTracedThing(trc, *thingp);
JS::TraceKind kind = MapTypeToTraceKind<typename mozilla::RemovePointer<T>::Type>::kind;
JS::AutoTracingName ctx(trc, name);
trc->trace(reinterpret_cast<void**>(thingp), kind);
trc->dispatchToOnEdge(thingp);
return *thingp;
}
#define INSTANTIATE_ALL_VALID_TRACE_FUNCTIONS(name, type, _) \
@ -322,21 +321,19 @@ struct ObjectGroupCycleCollectorTracer : public JS::CallbackTracer
innerTracer(innerTracer)
{}
void trace(void** thingp, JS::TraceKind kind) override;
void onChild(const JS::GCCellPtr& thing) override;
JS::CallbackTracer* innerTracer;
Vector<ObjectGroup*, 4, SystemAllocPolicy> seen, worklist;
};
void
ObjectGroupCycleCollectorTracer::trace(void** thingp, JS::TraceKind kind)
ObjectGroupCycleCollectorTracer::onChild(const JS::GCCellPtr& thing)
{
JS::GCCellPtr thing(*thingp, kind);
if (thing.isObject() || thing.isScript()) {
// Invoke the inner cycle collector callback on this child. It will not
// recurse back into TraceChildren.
innerTracer->trace(thingp, kind);
innerTracer->onChild(thing);
return;
}

Просмотреть файл

@ -81,7 +81,7 @@ class js::VerifyPreTracer : public JS::CallbackTracer
{
JS::AutoDisableGenerationalGC noggc;
void trace(void** thingp, JS::TraceKind kind) override;
void onChild(const JS::GCCellPtr& thing) override;
public:
/* The gcNumber when the verification began. */
@ -112,9 +112,9 @@ class js::VerifyPreTracer : public JS::CallbackTracer
* node.
*/
void
VerifyPreTracer::trace(void** thingp, JS::TraceKind kind)
VerifyPreTracer::onChild(const JS::GCCellPtr& thing)
{
MOZ_ASSERT(!IsInsideNursery(*reinterpret_cast<Cell**>(thingp)));
MOZ_ASSERT(!IsInsideNursery(thing.asCell()));
edgeptr += sizeof(EdgeValue);
if (edgeptr >= term) {
@ -125,8 +125,8 @@ VerifyPreTracer::trace(void** thingp, JS::TraceKind kind)
VerifyNode* node = curnode;
uint32_t i = node->count;
node->edges[i].thing = *thingp;
node->edges[i].kind = kind;
node->edges[i].thing = thing.asCell();
node->edges[i].kind = thing.kind();
node->edges[i].label = contextName();
node->count++;
}
@ -252,7 +252,7 @@ IsMarkedOrAllocated(TenuredCell* cell)
struct CheckEdgeTracer : public JS::CallbackTracer {
VerifyNode* node;
explicit CheckEdgeTracer(JSRuntime* rt) : JS::CallbackTracer(rt), node(nullptr) {}
void trace(void** thingp, JS::TraceKind kind) override;
void onChild(const JS::GCCellPtr& thing) override;
};
static const uint32_t MAX_VERIFIER_EDGES = 1000;
@ -265,15 +265,15 @@ static const uint32_t MAX_VERIFIER_EDGES = 1000;
* been modified) must point to marked objects.
*/
void
CheckEdgeTracer::trace(void** thingp, JS::TraceKind kind)
CheckEdgeTracer::onChild(const JS::GCCellPtr& thing)
{
/* Avoid n^2 behavior. */
if (node->count > MAX_VERIFIER_EDGES)
return;
for (uint32_t i = 0; i < node->count; i++) {
if (node->edges[i].thing == *thingp) {
MOZ_ASSERT(node->edges[i].kind == kind);
if (node->edges[i].thing == thing.asCell()) {
MOZ_ASSERT(node->edges[i].kind == thing.kind());
node->edges[i].thing = nullptr;
return;
}

Просмотреть файл

@ -0,0 +1,6 @@
// |jit-test| --no-baseline; --non-writable-jitcode
(function(stdlib, foreign, heap) {
"use asm";
function f() {}
return f;
})();

Просмотреть файл

@ -0,0 +1,6 @@
var du = new Debugger();
if (typeof du.setupTraceLogger === "function")
du.setupTraceLogger({Scripts: true});
(function() {
for (var i = 0; i < 15; ++i) {}
})();

Просмотреть файл

@ -912,7 +912,6 @@ BaselineScript::initTraceLogger(JSRuntime* runtime, JSScript* script)
traceLoggerScriptEvent_ = TraceLoggerEvent(logger, TraceLogger_Scripts);
if (TraceLogTextIdEnabled(TraceLogger_Engine) || TraceLogTextIdEnabled(TraceLogger_Scripts)) {
AutoWritableJitCode awjc(method_);
CodeLocationLabel enter(method_, CodeOffsetLabel(traceLoggerEnterToggleOffset_));
CodeLocationLabel exit(method_, CodeOffsetLabel(traceLoggerExitToggleOffset_));
Assembler::ToggleToCmp(enter);

Просмотреть файл

@ -29,6 +29,10 @@
#include "js/MemoryMetrics.h"
#ifdef __APPLE__
#include <TargetConditionals.h>
#endif
using namespace js::jit;
size_t ExecutableAllocator::pageSize = 0;
@ -44,6 +48,28 @@ ExecutablePool::~ExecutablePool()
m_allocator->releasePoolPages(this);
}
/* static */ void
ExecutableAllocator::initStatic()
{
if (!pageSize) {
pageSize = determinePageSize();
// On Windows, VirtualAlloc effectively allocates in 64K chunks.
// (Technically, it allocates in page chunks, but the starting
// address is always a multiple of 64K, so each allocation uses up
// 64K of address space.) So a size less than that would be
// pointless. But it turns out that 64KB is a reasonable size for
// all platforms. (This assumes 4KB pages.) On 64-bit windows,
// AllocateExecutableMemory prepends an extra page for structured
// exception handling data (see comments in function) onto whatever
// is passed in, so subtract one page here.
#if defined(JS_CPU_X64) && defined(XP_WIN)
largeAllocSize = pageSize * 15;
#else
largeAllocSize = pageSize * 16;
#endif
}
}
void
ExecutableAllocator::addSizeOfCode(JS::CodeSizes* sizes) const
{
@ -62,7 +88,7 @@ ExecutableAllocator::addSizeOfCode(JS::CodeSizes* sizes) const
}
}
#ifdef TARGET_OS_IPHONE
#if TARGET_OS_IPHONE
bool ExecutableAllocator::nonWritableJitCode = true;
#else
bool ExecutableAllocator::nonWritableJitCode = false;

Просмотреть файл

@ -182,24 +182,6 @@ class ExecutableAllocator
ExecutableAllocator()
: destroyCallback(nullptr)
{
if (!pageSize) {
pageSize = determinePageSize();
// On Windows, VirtualAlloc effectively allocates in 64K chunks.
// (Technically, it allocates in page chunks, but the starting
// address is always a multiple of 64K, so each allocation uses up
// 64K of address space.) So a size less than that would be
// pointless. But it turns out that 64KB is a reasonable size for
// all platforms. (This assumes 4KB pages.) On 64-bit windows,
// AllocateExecutableMemory prepends an extra page for structured
// exception handling data (see comments in function) onto whatever
// is passed in, so subtract one page here.
#if defined(JS_CPU_X64) && defined(XP_WIN)
largeAllocSize = pageSize * 15;
#else
largeAllocSize = pageSize * 16;
#endif
}
MOZ_ASSERT(m_smallPools.empty());
}
@ -263,6 +245,8 @@ class ExecutableAllocator
this->destroyCallback = destroyCallback;
}
static void initStatic();
static bool nonWritableJitCode;
private:

Просмотреть файл

@ -1216,7 +1216,7 @@ IonScript::purgeCaches()
AutoWritableJitCode awjc(method());
for (size_t i = 0; i < numCaches(); i++)
getCacheFromIndex(i).reset();
getCacheFromIndex(i).reset(DontReprotect);
}
void

Просмотреть файл

@ -1667,7 +1667,7 @@ GetPropertyIC::tryAttachDOMProxyUnshadowed(JSContext* cx, HandleScript outerScri
// code and we will not have the same generation again for this
// object, so the generation check in the existing IC would always
// fail anyway.
reset();
reset(Reprotect);
}
Label failures;
@ -1992,9 +1992,9 @@ GetPropertyIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex
}
void
GetPropertyIC::reset()
GetPropertyIC::reset(ReprotectCode reprotect)
{
IonCache::reset();
IonCache::reset(reprotect);
hasTypedArrayLengthStub_ = false;
hasSharedTypedArrayLengthStub_ = false;
hasStrictArgumentsLengthStub_ = false;
@ -2003,18 +2003,17 @@ GetPropertyIC::reset()
}
void
IonCache::disable(IonScript* ion)
IonCache::disable()
{
AutoWritableJitCode awjc(ion->method());
reset();
reset(Reprotect);
this->disabled_ = 1;
}
void
IonCache::reset()
IonCache::reset(ReprotectCode reprotect)
{
this->stubCount_ = 0;
PatchJump(initialJump_, fallbackLabel_);
PatchJump(initialJump_, fallbackLabel_, reprotect);
lastJump_ = initialJump_;
}
@ -3219,7 +3218,7 @@ SetPropertyIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex
} else {
MOZ_ASSERT(shadows == DoesntShadow || shadows == DoesntShadowUnique);
if (shadows == DoesntShadowUnique)
cache.reset();
cache.reset(Reprotect);
if (!cache.attachDOMProxyUnshadowed(cx, outerScript, ion, obj, returnAddr))
return false;
addedSetterStub = true;
@ -3323,9 +3322,9 @@ SetPropertyIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex
}
void
SetPropertyIC::reset()
SetPropertyIC::reset(ReprotectCode reprotect)
{
IonCache::reset();
IonCache::reset(reprotect);
hasGenericProxyStub_ = false;
}
@ -4037,7 +4036,7 @@ GetElementIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex,
cache.incFailedUpdates();
if (cache.shouldDisable()) {
JitSpew(JitSpew_IonIC, "Disable inline cache");
cache.disable(ion);
cache.disable();
}
} else {
cache.resetFailedUpdates();
@ -4049,9 +4048,9 @@ GetElementIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex,
}
void
GetElementIC::reset()
GetElementIC::reset(ReprotectCode reprotect)
{
IonCache::reset();
IonCache::reset(reprotect);
hasDenseStub_ = false;
hasStrictArgumentsStub_ = false;
hasNormalArgumentsStub_ = false;
@ -4388,9 +4387,9 @@ SetElementIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex,
}
void
SetElementIC::reset()
SetElementIC::reset(ReprotectCode reprotect)
{
IonCache::reset();
IonCache::reset(reprotect);
hasDenseStub_ = false;
}

Просмотреть файл

@ -243,7 +243,7 @@ class IonCache
{
}
void disable(IonScript* ion);
void disable();
inline bool isDisabled() const {
return disabled_;
}
@ -269,7 +269,7 @@ class IonCache
void updateBaseAddress(JitCode* code, MacroAssembler& masm);
// Reset the cache around garbage collection.
virtual void reset();
virtual void reset(ReprotectCode reprotect);
bool canAttachStub() const {
return stubCount_ < MAX_STUBS;
@ -412,7 +412,7 @@ class GetPropertyIC : public IonCache
CACHE_HEADER(GetProperty)
void reset();
void reset(ReprotectCode reprotect);
Register object() const {
return object_;
@ -547,7 +547,7 @@ class SetPropertyIC : public IonCache
CACHE_HEADER(SetProperty)
void reset();
void reset(ReprotectCode reprotect);
Register object() const {
return object_;
@ -641,7 +641,7 @@ class GetElementIC : public IonCache
CACHE_HEADER(GetElement)
void reset();
void reset(ReprotectCode reprotect);
Register object() const {
return object_;
@ -750,7 +750,7 @@ class SetElementIC : public IonCache
CACHE_HEADER(SetElement)
void reset();
void reset(ReprotectCode reprotect);
Register object() const {
return object_;

Просмотреть файл

@ -2183,6 +2183,8 @@ SnapshotIterator::initInstructionResults(MaybeReadFallback& fallback)
JitFrameLayout* fp = fallback.frame->jsFrame();
RInstructionResults* results = fallback.activation->maybeIonFrameRecovery(fp);
if (!results) {
AutoCompartment ac(cx, fallback.frame->script()->compartment());
// We do not have the result yet, which means that an observable stack
// slot is requested. As we do not want to bailout every time for the
// same reason, we need to recompile without optimizing away the

Просмотреть файл

@ -8,16 +8,16 @@
#include "jsapi-tests/tests.h"
class CCWTestTracer : public JS::CallbackTracer {
void trace(void** thingp, JS::TraceKind kind) {
void onChild(const JS::GCCellPtr& thing) override {
numberOfThingsTraced++;
printf("*thingp = %p\n", *thingp);
printf("*thingp = %p\n", thing.asCell());
printf("*expectedThingp = %p\n", *expectedThingp);
printf("kind = %d\n", static_cast<int>(kind));
printf("kind = %d\n", static_cast<int>(thing.kind()));
printf("expectedKind = %d\n", static_cast<int>(expectedKind));
if (*thingp != *expectedThingp || kind != expectedKind)
if (thing.asCell() != *expectedThingp || thing.kind() != expectedKind)
okay = false;
}

Просмотреть файл

@ -552,6 +552,8 @@ JS_Init(void)
if (!TlsPerThreadData.initialized() && !TlsPerThreadData.init())
return false;
jit::ExecutableAllocator::initStatic();
if (!jit::InitializeIon())
return false;

Просмотреть файл

@ -904,7 +904,7 @@ struct DumpHeapTracer : public JS::CallbackTracer, public WeakMapTracer
map, key.asCell(), kdelegate, value.asCell());
}
void trace(void** thingp, JS::TraceKind kind) override;
void onChild(const JS::GCCellPtr& thing) override;
};
static char
@ -958,14 +958,14 @@ DumpHeapVisitCell(JSRuntime* rt, void* data, void* thing,
}
void
DumpHeapTracer::trace(void** thingp, JS::TraceKind kind)
DumpHeapTracer::onChild(const JS::GCCellPtr& thing)
{
if (gc::IsInsideNursery((js::gc::Cell*)*thingp))
if (gc::IsInsideNursery(thing.asCell()))
return;
char buffer[1024];
getTracingEdgeName(buffer, sizeof(buffer));
fprintf(output, "%s%p %c %s\n", prefix, *thingp, MarkDescriptor(*thingp), buffer);
fprintf(output, "%s%p %c %s\n", prefix, thing.asCell(), MarkDescriptor(thing.asCell()), buffer);
}
void

Просмотреть файл

@ -1694,6 +1694,12 @@ extern JS_FRIEND_API(JSObject*)
JS_NewSharedFloat64ArrayWithBuffer(JSContext* cx, JS::HandleObject arrayBuffer,
uint32_t byteOffset, uint32_t length);
/*
* Create a new SharedArrayBuffer with the given byte length.
*/
extern JS_FRIEND_API(JSObject*)
JS_NewSharedArrayBuffer(JSContext* cx, uint32_t nbytes);
/*
* Create a new ArrayBuffer with the given byte length.
*/
@ -1818,6 +1824,13 @@ UnwrapSharedFloat32Array(JSObject* obj);
extern JS_FRIEND_API(JSObject*)
UnwrapSharedFloat64Array(JSObject* obj);
extern JS_FRIEND_API(JSObject*)
UnwrapSharedArrayBuffer(JSObject* obj);
extern JS_FRIEND_API(JSObject*)
UnwrapSharedArrayBufferView(JSObject* obj);
namespace detail {
extern JS_FRIEND_DATA(const Class* const) Int8ArrayClassPtr;
@ -1869,6 +1882,16 @@ JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Uint32, uint32_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Float32, float)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Float64, double)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(SharedInt8, int8_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(SharedUint8, uint8_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(SharedUint8Clamped, uint8_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(SharedInt16, int16_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(SharedUint16, uint16_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(SharedInt32, int32_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(SharedUint32, uint32_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(SharedFloat32, float)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(SharedFloat64, double)
#undef JS_DEFINE_DATA_AND_LENGTH_ACCESSOR
// This one isn't inlined because it's rather tricky (by dint of having to deal
@ -1876,11 +1899,17 @@ JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Float64, double)
extern JS_FRIEND_API(void)
GetArrayBufferViewLengthAndData(JSObject* obj, uint32_t* length, uint8_t** data);
extern JS_FRIEND_API(void)
GetSharedArrayBufferViewLengthAndData(JSObject* obj, uint32_t* length, uint8_t** data);
// This one isn't inlined because there are a bunch of different ArrayBuffer
// classes that would have to be individually handled here.
extern JS_FRIEND_API(void)
GetArrayBufferLengthAndData(JSObject* obj, uint32_t* length, uint8_t** data);
extern JS_FRIEND_API(void)
GetSharedArrayBufferLengthAndData(JSObject* obj, uint32_t* length, uint8_t** data);
} // namespace js
/*
@ -1921,6 +1950,9 @@ JS_GetObjectAsArrayBuffer(JSObject* obj, uint32_t* length, uint8_t** data);
extern JS_FRIEND_API(js::Scalar::Type)
JS_GetArrayBufferViewType(JSObject* obj);
extern JS_FRIEND_API(js::Scalar::Type)
JS_GetSharedArrayBufferViewType(JSObject* obj);
/*
* Check whether obj supports the JS_GetArrayBuffer* APIs. Note that this may
* return false if a security wrapper is encountered that denies the
@ -2040,6 +2072,27 @@ JS_GetFloat32ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(double*)
JS_GetFloat64ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(uint8_t*)
JS_GetSharedArrayBufferData(JSObject* obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(int8_t*)
JS_GetSharedInt8ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(uint8_t*)
JS_GetSharedUint8ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(uint8_t*)
JS_GetSharedUint8ClampedArrayData(JSObject* obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(int16_t*)
JS_GetSharedInt16ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(uint16_t*)
JS_GetSharedUint16ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(int32_t*)
JS_GetSharedInt32ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(uint32_t*)
JS_GetSharedUint32ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(float*)
JS_GetSharedFloat32ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(double*)
JS_GetSharedFloat64ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&);
/*
* Same as above, but for any kind of ArrayBufferView. Prefer the type-specific
* versions when possible.

Просмотреть файл

@ -2207,19 +2207,10 @@ GCRuntime::relocateArenas(Zone* zone, JS::gcreason::Reason reason, SliceBudget&
}
void
MovingTracer::trace(void** thingp, JS::TraceKind kind)
MovingTracer::onObjectEdge(JSObject** objp)
{
TenuredCell* thing = TenuredCell::fromPointer(*thingp);
// Currently we only relocate objects.
if (kind != JS::TraceKind::Object) {
MOZ_ASSERT(!RelocationOverlay::isCellForwarded(thing));
return;
}
JSObject* obj = reinterpret_cast<JSObject*>(thing);
if (IsForwarded(obj))
*thingp = Forwarded(obj);
if (IsForwarded(*objp))
*objp = Forwarded(*objp);
}
void
@ -3677,7 +3668,7 @@ GCRuntime::shouldPreserveJITCode(JSCompartment* comp, int64_t currentTime,
#ifdef DEBUG
class CompartmentCheckTracer : public JS::CallbackTracer
{
void trace(void** thingp, JS::TraceKind kind) override;
void onChild(const JS::GCCellPtr& thing) override;
public:
explicit CompartmentCheckTracer(JSRuntime* rt)
@ -3720,17 +3711,17 @@ struct MaybeCompartmentFunctor {
};
void
CompartmentCheckTracer::trace(void** thingp, JS::TraceKind kind)
CompartmentCheckTracer::onChild(const JS::GCCellPtr& thing)
{
TenuredCell* thing = TenuredCell::fromPointer(*thingp);
TenuredCell* tenured = TenuredCell::fromPointer(thing.asCell());
JSCompartment* comp = CallTyped(MaybeCompartmentFunctor(), thing, kind);
JSCompartment* comp = CallTyped(MaybeCompartmentFunctor(), tenured, thing.kind());
if (comp && compartment) {
MOZ_ASSERT(comp == compartment || runtime()->isAtomsCompartment(comp) ||
(srcKind == JS::TraceKind::Object &&
InCrossCompartmentMap(static_cast<JSObject*>(src), thing, kind)));
InCrossCompartmentMap(static_cast<JSObject*>(src), tenured, thing.kind())));
} else {
MOZ_ASSERT(thing->zone() == zone || thing->zone()->isAtomsZone());
MOZ_ASSERT(tenured->zone() == zone || tenured->zone()->isAtomsZone());
}
}

Просмотреть файл

@ -31,7 +31,7 @@ with Files('jit/**'):
for gcfile in ['jsgc*', 'devtools/rootAnalysis', 'devtools/gc-ubench', 'devtools/gctrace']:
with Files(gcfile):
BUG_COMPONENT = component_gc
for header in ('GCAPI.h', 'HeapAPI.h', 'RootingAPI.h', 'SliceBudget.h', 'TracingAPI.h', 'WeakMapPtr.h'):
for header in ('GCAPI.h', 'HeapAPI.h', 'RootingAPI.h', 'SliceBudget.h', 'TraceKind.h', 'TracingAPI.h', 'WeakMapPtr.h'):
with Files('../public/' + header):
BUG_COMPONENT = component_gc
@ -122,6 +122,7 @@ EXPORTS.js += [
'../public/RootingAPI.h',
'../public/SliceBudget.h',
'../public/StructuredClone.h',
'../public/TraceKind.h',
'../public/TracingAPI.h',
'../public/TrackedOptimizationInfo.h',
'../public/TypeDecls.h',

Просмотреть файл

@ -42,6 +42,7 @@
#include "js/MemoryMetrics.h"
#include "vm/GlobalObject.h"
#include "vm/Interpreter.h"
#include "vm/SharedArrayObject.h"
#include "vm/WrapperObject.h"
#include "jsatominlines.h"
@ -1285,6 +1286,14 @@ js::UnwrapArrayBufferView(JSObject* obj)
return nullptr;
}
JS_FRIEND_API(JSObject*)
js::UnwrapSharedArrayBufferView(JSObject* obj)
{
if (JSObject* unwrapped = CheckedUnwrap(obj))
return unwrapped->is<SharedTypedArrayObject>() ? unwrapped : nullptr;
return nullptr;
}
JS_FRIEND_API(uint32_t)
JS_GetArrayBufferByteLength(JSObject* obj)
{
@ -1346,6 +1355,13 @@ JS_NewArrayBuffer(JSContext* cx, uint32_t nbytes)
return ArrayBufferObject::create(cx, nbytes);
}
JS_FRIEND_API(JSObject*)
JS_NewSharedArrayBuffer(JSContext* cx, uint32_t nbytes)
{
MOZ_ASSERT(nbytes <= INT32_MAX);
return SharedArrayBufferObject::New(cx, nbytes);
}
JS_PUBLIC_API(JSObject*)
JS_NewArrayBufferWithContents(JSContext* cx, size_t nbytes, void* data)
{
@ -1376,6 +1392,14 @@ js::UnwrapArrayBuffer(JSObject* obj)
return nullptr;
}
JS_FRIEND_API(JSObject*)
js::UnwrapSharedArrayBuffer(JSObject* obj)
{
if (JSObject* unwrapped = CheckedUnwrap(obj))
return unwrapped->is<SharedArrayBufferObject>() ? unwrapped : nullptr;
return nullptr;
}
JS_PUBLIC_API(void*)
JS_StealArrayBufferContents(JSContext* cx, HandleObject objArg)
{

Просмотреть файл

@ -382,9 +382,36 @@ js::AsSharedArrayBuffer(HandleObject obj)
return obj->as<SharedArrayBufferObject>();
}
JS_FRIEND_API(void)
js::GetSharedArrayBufferViewLengthAndData(JSObject* obj, uint32_t* length, uint8_t** data)
{
MOZ_ASSERT(obj->is<SharedTypedArrayObject>());
*length = obj->as<SharedTypedArrayObject>().byteLength();
*data = static_cast<uint8_t*>(obj->as<SharedTypedArrayObject>().viewData());
}
JS_FRIEND_API(void)
js::GetSharedArrayBufferLengthAndData(JSObject* obj, uint32_t* length, uint8_t** data)
{
MOZ_ASSERT(obj->is<SharedArrayBufferObject>());
*length = obj->as<SharedArrayBufferObject>().byteLength();
*data = obj->as<SharedArrayBufferObject>().dataPointer();
}
JS_FRIEND_API(bool)
JS_IsSharedArrayBufferObject(JSObject* obj)
{
obj = CheckedUnwrap(obj);
return obj ? obj->is<ArrayBufferObject>() : false;
return obj ? obj->is<SharedArrayBufferObject>() : false;
}
JS_FRIEND_API(uint8_t*)
JS_GetSharedArrayBufferData(JSObject* obj, const JS::AutoCheckCannotGC&)
{
obj = CheckedUnwrap(obj);
if (!obj)
return nullptr;
return obj->as<SharedArrayBufferObject>().dataPointer();
}

Просмотреть файл

@ -999,6 +999,105 @@ SharedTypedArrayObject::setElement(SharedTypedArrayObject& obj, uint32_t index,
}
}
JS_FRIEND_API(int8_t*)
JS_GetSharedInt8ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&)
{
obj = CheckedUnwrap(obj);
if (!obj)
return nullptr;
SharedTypedArrayObject* tarr = &obj->as<SharedTypedArrayObject>();
MOZ_ASSERT((int32_t) tarr->type() == Scalar::Int8);
return static_cast<int8_t*>(tarr->viewData());
}
JS_FRIEND_API(uint8_t*)
JS_GetSharedUint8ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&)
{
obj = CheckedUnwrap(obj);
if (!obj)
return nullptr;
SharedTypedArrayObject* tarr = &obj->as<SharedTypedArrayObject>();
MOZ_ASSERT((int32_t) tarr->type() == Scalar::Uint8);
return static_cast<uint8_t*>(tarr->viewData());
}
JS_FRIEND_API(uint8_t*)
JS_GetSharedUint8ClampedArrayData(JSObject* obj, const JS::AutoCheckCannotGC&)
{
obj = CheckedUnwrap(obj);
if (!obj)
return nullptr;
SharedTypedArrayObject* tarr = &obj->as<SharedTypedArrayObject>();
MOZ_ASSERT((int32_t) tarr->type() == Scalar::Uint8Clamped);
return static_cast<uint8_t*>(tarr->viewData());
}
JS_FRIEND_API(int16_t*)
JS_GetSharedInt16ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&)
{
obj = CheckedUnwrap(obj);
if (!obj)
return nullptr;
SharedTypedArrayObject* tarr = &obj->as<SharedTypedArrayObject>();
MOZ_ASSERT((int32_t) tarr->type() == Scalar::Int16);
return static_cast<int16_t*>(tarr->viewData());
}
JS_FRIEND_API(uint16_t*)
JS_GetSharedUint16ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&)
{
obj = CheckedUnwrap(obj);
if (!obj)
return nullptr;
SharedTypedArrayObject* tarr = &obj->as<SharedTypedArrayObject>();
MOZ_ASSERT((int32_t) tarr->type() == Scalar::Uint16);
return static_cast<uint16_t*>(tarr->viewData());
}
JS_FRIEND_API(int32_t*)
JS_GetSharedInt32ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&)
{
obj = CheckedUnwrap(obj);
if (!obj)
return nullptr;
SharedTypedArrayObject* tarr = &obj->as<SharedTypedArrayObject>();
MOZ_ASSERT((int32_t) tarr->type() == Scalar::Int32);
return static_cast<int32_t*>(tarr->viewData());
}
JS_FRIEND_API(uint32_t*)
JS_GetSharedUint32ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&)
{
obj = CheckedUnwrap(obj);
if (!obj)
return nullptr;
SharedTypedArrayObject* tarr = &obj->as<SharedTypedArrayObject>();
MOZ_ASSERT((int32_t) tarr->type() == Scalar::Uint32);
return static_cast<uint32_t*>(tarr->viewData());
}
JS_FRIEND_API(float*)
JS_GetSharedFloat32ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&)
{
obj = CheckedUnwrap(obj);
if (!obj)
return nullptr;
SharedTypedArrayObject* tarr = &obj->as<SharedTypedArrayObject>();
MOZ_ASSERT((int32_t) tarr->type() == Scalar::Float32);
return static_cast<float*>(tarr->viewData());
}
JS_FRIEND_API(double*)
JS_GetSharedFloat64ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&)
{
obj = CheckedUnwrap(obj);
if (!obj)
return nullptr;
SharedTypedArrayObject* tarr = &obj->as<SharedTypedArrayObject>();
MOZ_ASSERT((int32_t) tarr->type() == Scalar::Float64);
return static_cast<double*>(tarr->viewData());
}
#undef IMPL_SHARED_TYPED_ARRAY_STATICS
#undef IMPL_SHARED_TYPED_ARRAY_JSAPI_CONSTRUCTORS
#undef IMPL_SHARED_TYPED_ARRAY_COMBINED_UNWRAPPERS

Просмотреть файл

@ -2211,6 +2211,18 @@ JS_GetArrayBufferViewType(JSObject* obj)
MOZ_CRASH("invalid ArrayBufferView type");
}
JS_FRIEND_API(js::Scalar::Type)
JS_GetSharedArrayBufferViewType(JSObject* obj)
{
obj = CheckedUnwrap(obj);
if (!obj)
return Scalar::MaxTypedArrayViewType;
if (obj->is<SharedTypedArrayObject>())
return obj->as<SharedTypedArrayObject>().type();
MOZ_CRASH("invalid SharedArrayBufferView type");
}
JS_FRIEND_API(int8_t*)
JS_GetInt8ArrayData(JSObject* obj, const JS::AutoCheckCannotGC&)
{

Просмотреть файл

@ -65,9 +65,9 @@ struct Node::ConstructFunctor : public js::BoolDefaultAdaptor<Value, false> {
template <typename T> bool operator()(T* t, Node* node) { node->construct(t); return true; }
};
Node::Node(JS::TraceKind kind, void* ptr)
Node::Node(const JS::GCCellPtr &thing)
{
js::gc::CallTyped(ConstructFunctor(), ptr, kind, this);
js::gc::CallTyped(ConstructFunctor(), thing.asCell(), thing.kind(), this);
}
Node::Node(HandleValue value)
@ -111,7 +111,7 @@ class SimpleEdgeVectorTracer : public JS::CallbackTracer {
// True if we should populate the edge's names.
bool wantNames;
void trace(void** thingp, JS::TraceKind kind) {
void onChild(const JS::GCCellPtr& thing) override {
if (!okay)
return;
@ -139,7 +139,7 @@ class SimpleEdgeVectorTracer : public JS::CallbackTracer {
// ownership of name; if the append succeeds, the vector element
// then takes ownership; if the append fails, then the temporary
// retains it, and its destructor will free it.
if (!vec->append(mozilla::Move(SimpleEdge(name16, Node(kind, *thingp))))) {
if (!vec->append(mozilla::Move(SimpleEdge(name16, Node(thing))))) {
okay = false;
return;
}

Просмотреть файл

@ -1,178 +0,0 @@
<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=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/. -->
<!DOCTYPE html>
<html>
<head>
<title>MathJax fonts</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
jax: ["output/HTML-CSS"],
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/unpacked/MathJax.js">
</script>
<script type="text/javascript">
var fontList = [
"MathJax_Main",
"MathJax_Size1",
"MathJax_Size2",
"MathJax_Size3",
"MathJax_Size4",
"MathJax_AMS",
"MathJax_Main-bold"
];
var noChar = codePoint();
function codePoint(aValue, aFont)
{
var v = 0xFFFD;
if (aValue) {
v = aValue;
}
var f = "";
if (aFont) {
var i = fontList.indexOf(aFont);
if (i > 0) {
f = "@" + i;
}
}
var hexacode = Number(v).toString(16).toUpperCase();
while (hexacode.length < 4) {
hexacode = "0" + hexacode;
}
return "\\u" + hexacode + f;
}
function codePoint2(aList)
{
if (aList) {
return codePoint(aList[0], aList[1]);
} else {
return noChar;
}
}
function isSupported(aStretch)
{
for (var x in aStretch) {
var part = aStretch[x];
if (part[0] instanceof Array) {
// Composite char
return false;
} else if (part.length > 2) {
// Part has scale factor
return false;
}
}
return true;
}
MathJax.Hub.Queue(
["Require", MathJax.Ajax, "[MathJax]/jax/element/mml/jax.js"],
["Require", MathJax.Ajax, "[MathJax]/jax/output/HTML-CSS/jax.js"],
["Require", MathJax.Ajax, "[MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata-extra.js"],
function () {
var t = document.getElementById("output");
t.value = "";
var fontData = MathJax.OutputJax["HTML-CSS"].FONTDATA;
t.value += "# Content below is generated from MathJaxFonts.html. Do not edit.\n";
t.value += "\n";
// Generate the list of external fonts
for (var i = 1; i < fontList.length; i++) {
t.value += "external." + i + " = " + fontList[i] + "\n";
}
t.value += "\n";
// Generate stretchy table for delimiters
var delimiters = fontData.DELIMITERS;
for (var u in delimiters) {
var v = delimiters[u];
if (v.load) {
// These characters are already handled when we load fontdata-extra.js
continue;
}
if (v.alias) {
if (delimiters.hasOwnProperty(v.alias)) {
// use data from the char pointed by this alias
v = delimiters[v.alias];
} else {
// It is an alias to a non-stretchy char. Ignore it.
continue;
}
}
if (v.stretch && !isSupported(v.stretch)) {
// This construction is not supported.
t.value += "# " + codePoint(u) + " = [not supported]\n";
continue;
}
t.value += codePoint(u);
t.value += " = ";
if (v.stretch) {
if (v.dir == "V") {
t.value += codePoint2(v.stretch.top);
t.value += codePoint2(v.stretch.mid);
t.value += codePoint2(v.stretch.bot);
t.value += codePoint2(v.stretch.ext);
} else {
t.value += codePoint2(v.stretch.left);
t.value += codePoint2(v.stretch.mid);
t.value += codePoint2(v.stretch.right);
t.value += codePoint2(v.stretch.rep);
}
} else {
t.value += noChar + noChar + noChar + noChar;
}
for (var i in v.HW) {
t.value += codePoint(u, v.HW[i][1]);
}
t.value += "\n";
}
// Generate table for large operators
var fonts1 = fontData.FONTS[fontList[1]];
var fonts2 = fontData.FONTS[fontList[2]];
for (var u in fonts1) {
if (delimiters.hasOwnProperty(u) || // already listed above
u == "version" || u == "available" ||
u == "directory" || u == "family" || u == "testString") {
// Ignore these properties
continue;
}
t.value += codePoint(u);
t.value += " = ";
t.value += noChar + noChar + noChar + noChar;
t.value += codePoint(u, fontList[1]);
if (fonts2.hasOwnProperty(u)) {
t.value += codePoint(u, fontList[2]);
}
t.value += "\n";
}
});
</script>
</head>
<body>
<textarea id="output" cols="80" rows="20"></textarea>
</body>
</html>

Просмотреть файл

@ -1,144 +0,0 @@
# 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/.
# Content below is generated from MathJaxFonts.html. Do not edit.
external.1 = MathJax_Size1
external.2 = MathJax_Size2
external.3 = MathJax_Size3
external.4 = MathJax_Size4
external.5 = MathJax_AMS
# external.6 = MathJax_Main-bold
\u0028 = \u239B@4\uFFFD\u239D@4\u239C@4\u0028\u0028@1\u0028@2\u0028@3\u0028@4
\u0029 = \u239E@4\uFFFD\u23A0@4\u239F@4\u0029\u0029@1\u0029@2\u0029@3\u0029@4
\u002F = \uFFFD\uFFFD\uFFFD\uFFFD\u002F\u002F@1\u002F@2\u002F@3\u002F@4
\u005B = \u23A1@4\uFFFD\u23A3@4\u23A2@4\u005B\u005B@1\u005B@2\u005B@3\u005B@4
\u005C = \uFFFD\uFFFD\uFFFD\uFFFD\u005C\u005C@1\u005C@2\u005C@3\u005C@4
\u005D = \u23A4@4\uFFFD\u23A6@4\u23A5@4\u005D\u005D@1\u005D@2\u005D@3\u005D@4
\u007B = \u23A7@4\u23A8@4\u23A9@4\u23AA@4\u007B\u007B@1\u007B@2\u007B@3\u007B@4
\u007C = \uFFFD\uFFFD\uFFFD\u2223\u007C
\u007D = \u23AB@4\u23AC@4\u23AD@4\u23AA@4\u007D\u007D@1\u007D@2\u007D@3\u007D@4
\u00AF = \uFFFD\uFFFD\uFFFD\u00AF\u00AF
\u02C6 = \uFFFD\uFFFD\uFFFD\uFFFD\u02C6\u02C6@1\u02C6@2\u02C6@3\u02C6@4
\u02DC = \uFFFD\uFFFD\uFFFD\uFFFD\u02DC\u02DC@1\u02DC@2\u02DC@3\u02DC@4
\u2016 = \uFFFD\uFFFD\uFFFD\u2225\u2016@1\u2016
\u2190 = \u2190\uFFFD\uFFFD\u2212\u2190
\u2191 = \u2191@1\uFFFD\uFFFD\u23D0@1\u2191
\u2192 = \uFFFD\uFFFD\u2192\u2212\u2192
\u2193 = \uFFFD\uFFFD\u2193@1\u23D0@1\u2193
\u2194 = \u2190\uFFFD\u2192\u2212\u2194
\u2195 = \u2191@1\uFFFD\u2193@1\u23D0@1\u2195
\u21D0 = \u21D0\uFFFD\uFFFD\u003D\u21D0
\u21D1 = \u21D1@1\uFFFD\uFFFD\u2016@1\u21D1
\u21D2 = \uFFFD\uFFFD\u21D2\u003D\u21D2
\u21D3 = \uFFFD\uFFFD\u21D3@1\u2016@1\u21D3
\u21D4 = \u21D0\uFFFD\u21D2\u003D\u21D4
\u21D5 = \u21D1@1\uFFFD\u21D3@1\u2016@1\u21D5
\u2212 = \uFFFD\uFFFD\uFFFD\u2212\u2212
\u221A = \uE001@4\uFFFD\u23B7@4\uE000@4\u221A\u221A@1\u221A@2\u221A@3\u221A@4
\u2223 = \uFFFD\uFFFD\uFFFD\u2223\u2223
\u2225 = \uFFFD\uFFFD\uFFFD\u2225\u2225
\u2308 = \u23A1@4\uFFFD\uFFFD\u23A2@4\u2308\u2308@1\u2308@2\u2308@3\u2308@4
\u2309 = \u23A4@4\uFFFD\uFFFD\u23A5@4\u2309\u2309@1\u2309@2\u2309@3\u2309@4
\u230A = \uFFFD\uFFFD\u23A3@4\u23A2@4\u230A\u230A@1\u230A@2\u230A@3\u230A@4
\u230B = \uFFFD\uFFFD\u23A6@4\u23A5@4\u230B\u230B@1\u230B@2\u230B@3\u230B@4
\u23AA = \u23AA@4\uFFFD\u23AA@4\u23AA@4\u23AA@4
\u23B0 = \u23A7@4\uFFFD\u23AD@4\u23AA@4\u23B0
\u23B1 = \u23AB@4\uFFFD\u23A9@4\u23AA@4\u23B1
\u23D0 = \uFFFD\uFFFD\uFFFD\u2223\u23D0@1\u23D0
# \u23DE = [not supported]
# \u23DF = [not supported]
\u27E8 = \uFFFD\uFFFD\uFFFD\uFFFD\u27E8\u27E8@1\u27E8@2\u27E8@3\u27E8@4
\u27E9 = \uFFFD\uFFFD\uFFFD\uFFFD\u27E9\u27E9@1\u27E9@2\u27E9@3\u27E9@4
\u27EE = \u23A7@4\uFFFD\u23A9@4\u23AA@4\u27EE
\u27EF = \u23AB@4\uFFFD\u23AD@4\u23AA@4\u27EF
\u002D = \uFFFD\uFFFD\uFFFD\u2212\u002D
\u005E = \uFFFD\uFFFD\uFFFD\uFFFD\u005E\u005E@1\u005E@2\u005E@3\u005E@4
\u005F = \uFFFD\uFFFD\uFFFD\u2212\u005F
\u007E = \uFFFD\uFFFD\uFFFD\uFFFD\u007E\u007E@1\u007E@2\u007E@3\u007E@4
\u02C9 = \uFFFD\uFFFD\uFFFD\u00AF\u02C9
\u0302 = \uFFFD\uFFFD\uFFFD\uFFFD\u0302\u0302@1\u0302@2\u0302@3\u0302@4
\u0303 = \uFFFD\uFFFD\uFFFD\uFFFD\u0303\u0303@1\u0303@2\u0303@3\u0303@4
\u0332 = \uFFFD\uFFFD\uFFFD\u2212\u0332
\u2015 = \uFFFD\uFFFD\uFFFD\u2212\u2015
\u2017 = \uFFFD\uFFFD\uFFFD\u2212\u2017
\u203E = \uFFFD\uFFFD\uFFFD\u00AF\u203E
\u2215 = \uFFFD\uFFFD\uFFFD\uFFFD\u2215\u2215@1\u2215@2\u2215@3\u2215@4
\u2329 = \uFFFD\uFFFD\uFFFD\uFFFD\u2329\u2329@1\u2329@2\u2329@3\u2329@4
\u232A = \uFFFD\uFFFD\uFFFD\uFFFD\u232A\u232A@1\u232A@2\u232A@3\u232A@4
\u23AF = \uFFFD\uFFFD\uFFFD\u2212\u23AF
\u2500 = \uFFFD\uFFFD\uFFFD\u2212\u2500
\u2758 = \uFFFD\uFFFD\uFFFD\u2223\u2758
\u3008 = \uFFFD\uFFFD\uFFFD\uFFFD\u3008\u3008@1\u3008@2\u3008@3\u3008@4
\u3009 = \uFFFD\uFFFD\uFFFD\uFFFD\u3009\u3009@1\u3009@2\u3009@3\u3009@4
# \uFE37 = [not supported]
# \uFE38 = [not supported]
\u003D = \uFFFD\uFFFD\uFFFD\u003D\u003D
\u219E = \u219E@5\uFFFD\uFFFD\u2212\u219E@5
\u21A0 = \uFFFD\uFFFD\u21A0@5\u2212\u21A0@5
# \u21A4 = [not supported]
# \u21A5 = [not supported]
# \u21A6 = [not supported]
# \u21A7 = [not supported]
# \u21B0 = [not supported]
# \u21B1 = [not supported]
\u21BC = \u21BC\uFFFD\uFFFD\u2212\u21BC
\u21BD = \u21BD\uFFFD\uFFFD\u2212\u21BD
# \u21BE = [not supported]
# \u21BF = [not supported]
\u21C0 = \uFFFD\uFFFD\u21C0\u2212\u21C0
\u21C1 = \uFFFD\uFFFD\u21C1\u2212\u21C1
# \u21C2 = [not supported]
# \u21C3 = [not supported]
\u21DA = \u21DA@5\uFFFD\uFFFD\u2261\u21DA@5
\u21DB = \uFFFD\uFFFD\u21DB@5\u2261\u21DB@5
# \u23B4 = [not supported]
# \u23B5 = [not supported]
\u23DC = \uE150@4\uFFFD\uE151@4\uE154@4\u23DC@5\u23DC
\u23DD = \uE152@4\uFFFD\uE153@4\uE154@4\u23DD@5\u23DD
# \u23E0 = [not supported]
# \u23E1 = [not supported]
# \u2906 = [not supported]
# \u2907 = [not supported]
\u294E = \u21BC\uFFFD\u21C0\u2212
# \u294F = [not supported]
\u2950 = \u21BD\uFFFD\u21C1\u2212
# \u2951 = [not supported]
# \u295A = [not supported]
# \u295B = [not supported]
# \u295C = [not supported]
# \u295D = [not supported]
# \u295E = [not supported]
# \u295F = [not supported]
# \u2960 = [not supported]
# \u2961 = [not supported]
\u27F5 = \u2190\uFFFD\uFFFD\u2212\u27F5
\u27F6 = \uFFFD\uFFFD\u2192\u2212\u27F6
\u27F7 = \u2190\uFFFD\u2192\u2212\u27F7
\u27F8 = \u21D0\uFFFD\uFFFD\u003D\u27F8
\u27F9 = \uFFFD\uFFFD\u21D2\u003D\u27F9
\u27FA = \u21D0\uFFFD\u21D2\u003D\u27FA
# \u27FB = [not supported]
# \u27FC = [not supported]
# \u27FD = [not supported]
# \u27FE = [not supported]
\u0020 = \uFFFD\uFFFD\uFFFD\uFFFD\u0020@1\u0020@2
\u00A0 = \uFFFD\uFFFD\uFFFD\uFFFD\u00A0@1\u00A0@2
\u220F = \uFFFD\uFFFD\uFFFD\uFFFD\u220F@1\u220F@2
\u2210 = \uFFFD\uFFFD\uFFFD\uFFFD\u2210@1\u2210@2
\u2211 = \uFFFD\uFFFD\uFFFD\uFFFD\u2211@1\u2211@2
\u222B = \uFFFD\uFFFD\uFFFD\uFFFD\u222B@1\u222B@2
\u222C = \uFFFD\uFFFD\uFFFD\uFFFD\u222C@1\u222C@2
\u222D = \uFFFD\uFFFD\uFFFD\uFFFD\u222D@1\u222D@2
\u222E = \uFFFD\uFFFD\uFFFD\uFFFD\u222E@1\u222E@2
\u22C0 = \uFFFD\uFFFD\uFFFD\uFFFD\u22C0@1\u22C0@2
\u22C1 = \uFFFD\uFFFD\uFFFD\uFFFD\u22C1@1\u22C1@2
\u22C2 = \uFFFD\uFFFD\uFFFD\uFFFD\u22C2@1\u22C2@2
\u22C3 = \uFFFD\uFFFD\uFFFD\uFFFD\u22C3@1\u22C3@2
\u2A00 = \uFFFD\uFFFD\uFFFD\uFFFD\u2A00@1\u2A00@2
\u2A01 = \uFFFD\uFFFD\uFFFD\uFFFD\u2A01@1\u2A01@2
\u2A02 = \uFFFD\uFFFD\uFFFD\uFFFD\u2A02@1\u2A02@2
\u2A04 = \uFFFD\uFFFD\uFFFD\uFFFD\u2A04@1\u2A04@2
\u2A06 = \uFFFD\uFFFD\uFFFD\uFFFD\u2A06@1\u2A06@2

Просмотреть файл

@ -1,43 +0,0 @@
# 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/.
# LOCALIZATION NOTE: FILE
# Do not translate anything in this file
# This file contains the list of all stretchy MathML chars that
# can be rendered with Standard Symbols L.
# [ T/L | M | B/R | G | size0 ... size{N-1} ]
\u0028 = \uF8EB\uFFFD\uF8ED\uF8EC\u0028 # (
\u0029 = \uF8F6\uFFFD\uF8F8\uF8F7\u0029 # )
\u005B = \uF8EE\uFFFD\uF8F0\uF8EF\u005B # [
\u005D = \uF8F9\uFFFD\uF8FB\uF8FA\u005D # ]
\u007B = \uF8F1\uF8F2\uF8F3\uF8F4\u007B # {
\u007C = \uFFFD\uFFFD\uFFFD\u007C\u007C # |
\u007D = \uF8FC\uF8FD\uF8FE\uF8F4\u007D # }
\u00AF = \uFFFD\uFFFD\uFFFD\uF8E5\u00AF # ad-hoc: overbar is stretched with the radical extender
\u0332 = \uFFFD\uFFFD\uFFFD\u005F\u0332 # ad-hock: UnderBar (0x0332) is stretched with underscore
\u2190 = \u2190\uFFFD\uFFFD\uF8E7\u2190 # LeftArrow, larr, leftarrow
\u2191 = \u2191\uFFFD\uFFFD\uF8E6\u2191 # UpArrow, uarr, uparrow
\u2192 = \uFFFD\uFFFD\u2192\uF8E7\u2192 # RightArrow, rarr, rightarrow
\u2193 = \uFFFD\uFFFD\u2193\uF8E6\u2193 # DownArrow, darr, downarrow
\u2194 = \u2190\uFFFD\u2192\uF8E7\u2194 # LeftRightArrow, harr, leftrightarrow
\u2195 = \u2191\uFFFD\u2193\uF8E6\u2195 # UpDownArrow, updownarrow, varr
\u222B = \u2320\uFFFD\u2321\uF8F5\u222B # Integral, int
# If there are problems with the font-supplied glue use a rule:
# \u222B = \u2320\uFFFD\u2321\uFFFD\u222B # Integral, int
# Using parts of [ and ]
\u2308 = \uF8EE\uFFFD\uFFFD\uF8EF\u2308 # LeftCeiling, lceil
\u2309 = \uF8F9\uFFFD\uFFFD\uF8FA\u2309 # RightCeiling, rceil
\u230A = \uFFFD\uFFFD\uF8F0\uF8EF\u230A # LeftFloor, lfloor
\u230B = \uFFFD\uFFFD\uF8FB\uF8FA\u230B # RightFloor, rfloor
# same as normal arrows
\u27F5 = \u2190\uFFFD\uFFFD\uF8E7\u27F5 # LongLeftArrow
\u27F6 = \uFFFD\uFFFD\u2192\uF8E7\u27F6 # LongRightArrow
\u27F7 = \u2190\uFFFD\u2192\uF8E7\u27F7 # LongLeftRightArrow

Просмотреть файл

@ -55,8 +55,6 @@ JAR_MANIFESTS += ['jar.mn']
RESOURCE_FILES.fonts += [
'mathfont.properties',
'mathfontMathJax_Main.properties',
'mathfontStandardSymbolsL.properties',
'mathfontSTIXGeneral.properties',
'mathfontUnicode.properties',
]

Просмотреть файл

@ -734,9 +734,7 @@ InitGlobals(nsPresContext* aPresContext)
// observer and will be deleted at shutdown. We now add some private
// per font-family tables for stretchy operators, in order of preference.
// Do not include the Unicode table in this list.
if (!glyphTableList->AddGlyphTable(NS_LITERAL_STRING("MathJax_Main")) ||
!glyphTableList->AddGlyphTable(NS_LITERAL_STRING("STIXGeneral")) ||
!glyphTableList->AddGlyphTable(NS_LITERAL_STRING("Standard Symbols L"))
if (!glyphTableList->AddGlyphTable(NS_LITERAL_STRING("STIXGeneral"))
#ifdef XP_WIN
|| !glyphTableList->AddGlyphTable(NS_LITERAL_STRING("Symbol"))
#endif

Просмотреть файл

@ -13,11 +13,11 @@ namespace mp4_demuxer {
BufferStream::BufferStream()
: mStartOffset(0)
, mData(new mozilla::MediaLargeByteBuffer)
, mData(new mozilla::MediaByteBuffer)
{
}
BufferStream::BufferStream(mozilla::MediaLargeByteBuffer* aBuffer)
BufferStream::BufferStream(mozilla::MediaByteBuffer* aBuffer)
: mStartOffset(0)
, mData(aBuffer)
{

Просмотреть файл

@ -10,7 +10,7 @@
#include "MediaResource.h"
namespace mozilla {
class MediaLargeByteBuffer;
class MediaByteBuffer;
}
namespace mp4_demuxer {
@ -22,7 +22,7 @@ public:
* Therefore BufferStream shouldn't get used after aData is destroyed.
*/
BufferStream();
explicit BufferStream(mozilla::MediaLargeByteBuffer* aBuffer);
explicit BufferStream(mozilla::MediaByteBuffer* aBuffer);
virtual bool ReadAt(int64_t aOffset, void* aData, size_t aLength,
size_t* aBytesRead) override;
@ -39,7 +39,7 @@ public:
private:
~BufferStream();
int64_t mStartOffset;
nsRefPtr<mozilla::MediaLargeByteBuffer> mData;
nsRefPtr<mozilla::MediaByteBuffer> mData;
};
}

Просмотреть файл

@ -1860,7 +1860,7 @@ pref("intl.hyphenation-alias.nb-*", "nb");
pref("intl.hyphenation-alias.nn-*", "nn");
pref("font.name.serif.x-math", "Latin Modern Math");
pref("font.name-list.serif.x-math", "Latin Modern Math, XITS Math, Cambria Math, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, MathJax_Main, STIXGeneral, DejaVu Serif, DejaVu Sans, Standard Symbols L, serif");
pref("font.name-list.serif.x-math", "Latin Modern Math, XITS Math, Cambria Math, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, STIXGeneral, DejaVu Serif, DejaVu Sans, serif");
pref("font.name.sans-serif.x-math", "sans-serif");
pref("font.name.monospace.x-math", "monospace");
@ -2976,7 +2976,7 @@ pref("font.minimum-size.th", 10);
pref("font.default.x-devanagari", "sans-serif");
pref("font.name.serif.x-math", "Latin Modern Math");
// We have special support for Monotype Symbol on Windows.
pref("font.name-list.serif.x-math", "Latin Modern Math, XITS Math, Cambria Math, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, MathJax_Main, STIXGeneral, DejaVu Serif, DejaVu Sans, Symbol, Times New Roman");
pref("font.name-list.serif.x-math", "Latin Modern Math, XITS Math, Cambria Math, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, STIXGeneral, DejaVu Serif, DejaVu Sans, Symbol, Times New Roman");
pref("font.name.sans-serif.x-math", "Arial");
pref("font.name.monospace.x-math", "Courier New");
pref("font.name.cursive.x-math", "Comic Sans MS");
@ -3407,7 +3407,7 @@ pref("font.size.variable.zh-TW", 15);
pref("font.name.serif.x-math", "Latin Modern Math");
// Apple's Symbol is Unicode so use it
pref("font.name-list.serif.x-math", "Latin Modern Math, XITS Math, Cambria Math, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, MathJax_Main, STIXGeneral, DejaVu Serif, DejaVu Sans, Symbol, Times");
pref("font.name-list.serif.x-math", "Latin Modern Math, XITS Math, Cambria Math, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, STIXGeneral, DejaVu Serif, DejaVu Sans, Symbol, Times");
pref("font.name.sans-serif.x-math", "Helvetica");
pref("font.name.monospace.x-math", "Courier");
pref("font.name.cursive.x-math", "Apple Chancery");
@ -3833,7 +3833,7 @@ pref("font.name.monospace.zh-TW", "Fira Mono");
pref("font.name-list.sans-serif.zh-TW", "Fira Sans,Droid Sans Fallback");
pref("font.name.serif.x-math", "Latin Modern Math");
pref("font.name-list.serif.x-math", "Latin Modern Math, XITS Math, Cambria Math, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, MathJax_Main, STIXGeneral, DejaVu Serif, DejaVu Sans, Charis SIL Compact");
pref("font.name-list.serif.x-math", "Latin Modern Math, XITS Math, Cambria Math, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, STIXGeneral, DejaVu Serif, DejaVu Sans, Charis SIL Compact");
pref("font.name.sans-serif.x-math", "Fira Sans");
pref("font.name.monospace.x-math", "Fira Mono");
@ -3911,7 +3911,7 @@ pref("font.name-list.sans-serif.zh-TW", "Roboto, Droid Sans, Noto Sans TC, Noto
pref("font.name-list.monospace.zh-TW", "Droid Sans Fallback");
pref("font.name.serif.x-math", "Latin Modern Math");
pref("font.name-list.serif.x-math", "Latin Modern Math, XITS Math, Cambria Math, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, MathJax_Main, STIXGeneral, DejaVu Serif, DejaVu Sans, Charis SIL Compact");
pref("font.name-list.serif.x-math", "Latin Modern Math, XITS Math, Cambria Math, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, STIXGeneral, DejaVu Serif, DejaVu Sans, Charis SIL Compact");
pref("font.name.sans-serif.x-math", "Clear Sans");
pref("font.name.monospace.x-math", "Droid Sans Mono");

Просмотреть файл

@ -48,7 +48,6 @@ GeckoSimplePrograms([
CppUnitTests([
'TestBind',
'TestCookie',
'TestSTSParser',
'TestUDPSocket',
])

Просмотреть файл

@ -4,6 +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/.
GeckoCppUnitTests([
'TestCertDB',
CppUnitTests([
'TestSTSParser',
])
GeckoCppUnitTests([
'TestCertDB',
])

Просмотреть файл

@ -4,5 +4,3 @@ skip-if = buildapp == 'b2g' || e10s
[test_bug480509.html]
skip-if = toolkit == 'android'
[test_bug483440.html]
skip-if = toolkit == 'android'

Просмотреть файл

@ -1,62 +0,0 @@
<html>
<head>
<title>Test bug 483437 and bug 480509</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script class="testbody" type="text/javascript">
var certdb = SpecialPowers.Cc["@mozilla.org/security/x509certdb;1"]
.getService(SpecialPowers.Ci.nsIX509CertDB);
function test(certNick, expected)
{
var cert1 = certdb.findCertByNickname(null, certNick);
var certDumpTree1 = SpecialPowers.Cc["@mozilla.org/security/nsASN1Tree;1"]
.createInstance(SpecialPowers.Ci.nsIASN1Tree);
certDumpTree1.loadASN1Structure(cert1.ASN1Structure);
var value1 = certDumpTree1.getDisplayData(9);
is(value1, expected, "Incorrect OID recognized");
}
test("bug483440-attack2b",
"Object Identifier (2 5 4 Unknown) = www.bank.com\n"+
"OU = Hacking Division\n"+
"CN = www.badguy.com\nO = Badguy Inc\n");
test("bug483440-pk10oflo",
"Object Identifier (2 5 4 Unknown) = www.bank.com\n"+
"OU = Hacking Division\n"+
"CN = www.badguy.com\nO = Badguy Inc\n");
test("bug483440-attack7",
// Check 88 80 80 80 01, not leading, have to pass
"Object Identifier (2 5 4 2147483649) = attack1\n"+
// Check 90 80 80 80 01, not leading, have to fail
"Object Identifier (2 5 4 Unknown) = attack2\n"+
// Check 80 80 80 80 80, not leading, have to fail
"Object Identifier (2 5 4 Unknown) = attack3\n"+
// Check 81 81, trailing, have to fail
"Object Identifier (2 5 4 3 Unknown) = attack4\n"+
// Check FF FF FF 7F, not leading, have to pass
"Object Identifier (2 5 4 268435455) = attack5\n"+
// Check 80 leading, have to fail
"Object Identifier (Unknown 3) = attack6\n"+
// Check 14757 = 2*40 + 14677 leading single byle encoded as F325,
// have to pass
"Object Identifier (2 14677 4 3) = attack7\n");
</script>
</body>
</html>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше