merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2016-02-03 11:59:20 +01:00
commit a636b23432
676 changed files with 12411 additions and 5544 deletions

View File

@ -759,7 +759,7 @@ getAttributesCB(AtkObject *aAtkObj)
if (!proxy)
return nullptr;
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->Attributes(&attrs);
if (attrs.IsEmpty())
return nullptr;
@ -1019,7 +1019,7 @@ refRelationSetCB(AtkObject *aAtkObj)
continue;
size_t targetCount = targetSets[i].Length();
nsAutoTArray<AtkObject*, 5> wrappers;
AutoTArray<AtkObject*, 5> wrappers;
for (size_t j = 0; j < targetCount; j++)
wrappers.AppendElement(GetWrapperFor(targetSets[i][j]));
@ -1664,7 +1664,7 @@ AccessibleWrap::GetColumnHeader(TableAccessible* aAccessible, int32_t aColIdx)
return nullptr;
}
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
tableCell->ColHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;
@ -1698,7 +1698,7 @@ AccessibleWrap::GetRowHeader(TableAccessible* aAccessible, int32_t aRowIdx)
return nullptr;
}
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
tableCell->RowHeaderCells(&headerCells);
if (headerCells.IsEmpty()) {
return nullptr;

View File

@ -273,7 +273,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
{
*aSelected = nullptr;
nsAutoTArray<uint32_t, 10> cols;
AutoTArray<uint32_t, 10> cols;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->SelectedColIndices(&cols);
@ -300,7 +300,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
static gint
getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
{
nsAutoTArray<uint32_t, 10> rows;
AutoTArray<uint32_t, 10> rows;
AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
if (accWrap) {
accWrap->AsTable()->SelectedRowIndices(&rows);

View File

@ -311,7 +311,7 @@ getRunAttributesCB(AtkText *aText, gint aOffset,
return nullptr;
}
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->TextAttributes(false, aOffset, &attrs, &startOffset, &endOffset);
*aStartOffset = startOffset;
*aEndOffset = endOffset;
@ -337,7 +337,7 @@ getDefaultAttributesCB(AtkText *aText)
return nullptr;
}
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->DefaultTextAttributes(&attrs);
return ConvertToAtkTextAttributeSet(attrs);
}

View File

@ -76,7 +76,7 @@ protected:
DocAccessible* mDocument;
/**
* Pending events array. Don't make this an nsAutoTArray; we use
* Pending events array. Don't make this an AutoTArray; we use
* SwapElements() on it.
*/
nsTArray<RefPtr<AccEvent> > mEvents;

View File

@ -282,7 +282,7 @@ private:
/**
* A pending accessible tree update notifications for content insertions.
* Don't make this an nsAutoTArray; we use SwapElements() on it.
* Don't make this an AutoTArray; we use SwapElements() on it.
*/
nsTArray<RefPtr<ContentInsertion> > mContentInsertions;
@ -316,7 +316,7 @@ private:
nsTHashtable<nsCOMPtrHashKey<nsIContent> > mTextHash;
/**
* Other notifications like DOM events. Don't make this an nsAutoTArray; we
* Other notifications like DOM events. Don't make this an AutoTArray; we
* use SwapElements() on it.
*/
nsTArray<RefPtr<Notification> > mNotifications;

View File

@ -17,7 +17,7 @@ inline Accessible*
TextRange::Container() const
{
uint32_t pos1 = 0, pos2 = 0;
nsAutoTArray<Accessible*, 30> parents1, parents2;
AutoTArray<Accessible*, 30> parents1, parents2;
return CommonParent(mStartContainer, mEndContainer,
&parents1, &pos1, &parents2, &pos2);
}

View File

@ -24,7 +24,7 @@ TextPoint::operator <(const TextPoint& aPoint) const
// Build the chain of parents
Accessible* p1 = mContainer;
Accessible* p2 = aPoint.mContainer;
nsAutoTArray<Accessible*, 30> parents1, parents2;
AutoTArray<Accessible*, 30> parents1, parents2;
do {
parents1.AppendElement(p1);
p1 = p1->Parent();
@ -76,7 +76,7 @@ TextRange::EmbeddedChildren(nsTArray<Accessible*>* aChildren) const
Accessible* p2 = mEndContainer->GetChildAtOffset(mEndOffset);
uint32_t pos1 = 0, pos2 = 0;
nsAutoTArray<Accessible*, 30> parents1, parents2;
AutoTArray<Accessible*, 30> parents1, parents2;
Accessible* container =
CommonParent(p1, p2, &parents1, &pos1, &parents2, &pos2);
@ -146,7 +146,7 @@ bool
TextRange::Crop(Accessible* aContainer)
{
uint32_t boundaryPos = 0, containerPos = 0;
nsAutoTArray<Accessible*, 30> boundaryParents, containerParents;
AutoTArray<Accessible*, 30> boundaryParents, containerParents;
// Crop the start boundary.
Accessible* container = nullptr;

View File

@ -87,7 +87,7 @@ private:
DocAccessible* mDoc;
Accessible* mContext;
nsIContent* mAnchorNode;
nsAutoTArray<ChildrenIterator, 20> mStateStack;
AutoTArray<ChildrenIterator, 20> mStateStack;
int32_t mChildFilter;
uint32_t mFlags;
};

View File

@ -1048,7 +1048,7 @@ DocAccessibleChild::RecvColHeaderCells(const uint64_t& aID,
{
TableCellAccessible* acc = IdToTableCellAccessible(aID);
if (acc) {
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
acc->ColHeaderCells(&headerCells);
aCells->SetCapacity(headerCells.Length());
for (uint32_t i = 0; i < headerCells.Length(); ++i) {
@ -1066,7 +1066,7 @@ DocAccessibleChild::RecvRowHeaderCells(const uint64_t& aID,
{
TableCellAccessible* acc = IdToTableCellAccessible(aID);
if (acc) {
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
acc->RowHeaderCells(&headerCells);
aCells->SetCapacity(headerCells.Length());
for (uint32_t i = 0; i < headerCells.Length(); ++i) {
@ -1368,7 +1368,7 @@ DocAccessibleChild::RecvTableSelectedCells(const uint64_t& aID,
{
TableAccessible* acc = IdToTableAccessible(aID);
if (acc) {
nsAutoTArray<Accessible*, 30> cells;
AutoTArray<Accessible*, 30> cells;
acc->SelectedCells(&cells);
aCellIDs->SetCapacity(cells.Length());
for (uint32_t i = 0; i < cells.Length(); ++i) {
@ -1529,7 +1529,7 @@ DocAccessibleChild::RecvSelectedItems(const uint64_t& aID,
{
Accessible* acc = IdToAccessibleSelect(aID);
if (acc) {
nsAutoTArray<Accessible*, 10> selectedItems;
AutoTArray<Accessible*, 10> selectedItems;
acc->SelectedItems(&selectedItems);
aSelectedItemIDs->SetCapacity(selectedItems.Length());
for (size_t i = 0; i < selectedItems.Length(); ++i) {

View File

@ -778,7 +778,7 @@ ProxyAccessible::TableSelectedRowCount()
void
ProxyAccessible::TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs)
{
nsAutoTArray<uint64_t, 30> cellIDs;
AutoTArray<uint64_t, 30> cellIDs;
Unused << mDoc->SendTableSelectedCells(mID, &cellIDs);
aCellIDs->SetCapacity(cellIDs.Length());
for (uint32_t i = 0; i < cellIDs.Length(); ++i) {
@ -857,7 +857,7 @@ ProxyAccessible::AtkTableRowHeader(int32_t aRow)
void
ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
{
nsAutoTArray<uint64_t, 10> itemIDs;
AutoTArray<uint64_t, 10> itemIDs;
Unused << mDoc->SendSelectedItems(mID, &itemIDs);
aSelectedItems->SetCapacity(itemIDs.Length());
for (size_t i = 0; i < itemIDs.Length(); ++i) {

View File

@ -420,7 +420,7 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
nsCOMPtr<nsIPersistentProperties> attributes = accWrap->Attributes();
nsAccUtils::GetAccAttr(attributes, nsGkAtoms::linethickness_, thickness);
} else {
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->Attributes(&attrs);
for (size_t i = 0 ; i < attrs.Length() ; i++) {
if (attrs.ElementAt(i).Name() == "thickness") {
@ -684,11 +684,11 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
// get the array of children.
if (accWrap) {
nsAutoTArray<Accessible*, 10> childrenArray;
AutoTArray<Accessible*, 10> childrenArray;
accWrap->GetUnignoredChildren(&childrenArray);
mChildren = ConvertToNSArray(childrenArray);
} else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
nsAutoTArray<ProxyAccessible*, 10> childrenArray;
AutoTArray<ProxyAccessible*, 10> childrenArray;
GetProxyUnignoredChildren(proxy, &childrenArray);
mChildren = ConvertToNSArray(childrenArray);
}

View File

@ -207,12 +207,12 @@
return [NSValue valueWithRange:NSMakeRange(cell->ColIdx(),
cell->ColExtent())];
if ([attribute isEqualToString:NSAccessibilityRowHeaderUIElementsAttribute]) {
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
cell->RowHeaderCells(&headerCells);
return ConvertToNSArray(headerCells);
}
if ([attribute isEqualToString:NSAccessibilityColumnHeaderUIElementsAttribute]) {
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
cell->ColHeaderCells(&headerCells);
return ConvertToNSArray(headerCells);
}

View File

@ -768,7 +768,7 @@ ia2Accessible::get_selectionRanges(IA2Range** aRanges,
if (acc->IsDefunct())
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<TextRange, 1> ranges;
AutoTArray<TextRange, 1> ranges;
acc->Document()->SelectionRanges(&ranges);
uint32_t len = ranges.Length();
for (uint32_t idx = 0; idx < len; idx++) {

View File

@ -371,7 +371,7 @@ ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren,
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<uint32_t, 30> cellIndices;
AutoTArray<uint32_t, 30> cellIndices;
mTable->SelectedCellIndices(&cellIndices);
uint32_t maxCells = cellIndices.Length();
@ -663,7 +663,7 @@ ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells)
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<Accessible*, 30> cells;
AutoTArray<Accessible*, 30> cells;
mTable->SelectedCells(&cells);
if (cells.IsEmpty())
return S_FALSE;
@ -699,7 +699,7 @@ ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns)
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<uint32_t, 30> colIndices;
AutoTArray<uint32_t, 30> colIndices;
mTable->SelectedColIndices(&colIndices);
uint32_t maxCols = colIndices.Length();
@ -729,7 +729,7 @@ ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows)
if (!mTable)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<uint32_t, 30> rowIndices;
AutoTArray<uint32_t, 30> rowIndices;
mTable->SelectedRowIndices(&rowIndices);
uint32_t maxRows = rowIndices.Length();

View File

@ -100,7 +100,7 @@ ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles,
if (!mTableCell)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<Accessible*, 10> cells;
AutoTArray<Accessible*, 10> cells;
mTableCell->ColHeaderCells(&cells);
*aNColumnHeaderCells = cells.Length();
@ -172,7 +172,7 @@ ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles,
if (!mTableCell)
return CO_E_OBJNOTCONNECTED;
nsAutoTArray<Accessible*, 10> cells;
AutoTArray<Accessible*, 10> cells;
mTableCell->RowHeaderCells(&cells);
*aNRowHeaderCells = cells.Length();

View File

@ -61,7 +61,7 @@ ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset,
int32_t startOffset = 0, endOffset = 0;
HRESULT hr;
if (ProxyAccessible* proxy = HyperTextProxyFor(this)) {
nsAutoTArray<Attribute, 10> attrs;
AutoTArray<Attribute, 10> attrs;
proxy->TextAttributes(true, aOffset, &attrs, &startOffset, &endOffset);
hr = AccessibleWrap::ConvertToIA2Attributes(&attrs, aTextAttributes);
} else {

View File

@ -834,7 +834,7 @@ AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren)
return E_NOTIMPL;
if (IsSelect()) {
nsAutoTArray<Accessible*, 10> selectedItems;
AutoTArray<Accessible*, 10> selectedItems;
if (IsProxy()) {
nsTArray<ProxyAccessible*> proxies;
Proxy()->SelectedItems(&proxies);

View File

@ -371,7 +371,7 @@ xpcAccessibleHyperText::GetSelectionRanges(nsIArray** aRanges)
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoTArray<TextRange, 1> ranges;
AutoTArray<TextRange, 1> ranges;
Intl()->SelectionRanges(&ranges);
uint32_t len = ranges.Length();
for (uint32_t idx = 0; idx < len; idx++)

View File

@ -21,7 +21,7 @@ xpcAccessibleSelectable::GetSelectedItems(nsIArray** aSelectedItems)
return NS_ERROR_FAILURE;
NS_PRECONDITION(Intl()->IsSelect(), "Called on non selectable widget!");
nsAutoTArray<Accessible*, 10> items;
AutoTArray<Accessible*, 10> items;
Intl()->SelectedItems(&items);
uint32_t itemCount = items.Length();

View File

@ -273,7 +273,7 @@ xpcAccessibleTable::GetSelectedCells(nsIArray** aSelectedCells)
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
AutoTArray<Accessible*, XPC_TABLE_DEFAULT_SIZE> cellsArray;
Intl()->SelectedCells(&cellsArray);
uint32_t totalCount = cellsArray.Length();
@ -299,7 +299,7 @@ xpcAccessibleTable::GetSelectedCellIndices(uint32_t* aCellsArraySize,
if (!Intl())
return NS_ERROR_FAILURE;
nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> cellsArray;
Intl()->SelectedCellIndices(&cellsArray);
*aCellsArraySize = cellsArray.Length();
@ -324,7 +324,7 @@ xpcAccessibleTable::GetSelectedColumnIndices(uint32_t* aColsArraySize,
if (!Intl())
return NS_ERROR_FAILURE;
nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> colsArray;
Intl()->SelectedColIndices(&colsArray);
*aColsArraySize = colsArray.Length();
@ -349,7 +349,7 @@ xpcAccessibleTable::GetSelectedRowIndices(uint32_t* aRowsArraySize,
if (!Intl())
return NS_ERROR_FAILURE;
nsAutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
AutoTArray<uint32_t, XPC_TABLE_DEFAULT_SIZE> rowsArray;
Intl()->SelectedRowIndices(&rowsArray);
*aRowsArraySize = rowsArray.Length();

View File

@ -108,7 +108,7 @@ xpcAccessibleTableCell::GetColumnHeaderCells(nsIArray** aHeaderCells)
if (!Intl())
return NS_ERROR_FAILURE;
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
Intl()->ColHeaderCells(&headerCells);
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);
@ -132,7 +132,7 @@ xpcAccessibleTableCell::GetRowHeaderCells(nsIArray** aHeaderCells)
if (!Intl())
return NS_ERROR_FAILURE;
nsAutoTArray<Accessible*, 10> headerCells;
AutoTArray<Accessible*, 10> headerCells;
Intl()->RowHeaderCells(&headerCells);
nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID);

View File

@ -355,6 +355,10 @@ pref("browser.safebrowsing.downloads.enabled", true);
pref("browser.safebrowsing.downloads.remote.enabled", true);
pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000);
pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.downloads.remote.block_dangerous", true);
pref("browser.safebrowsing.downloads.remote.block_dangerous_host", true);
pref("browser.safebrowsing.downloads.remote.block_potentially_unwanted", false);
pref("browser.safebrowsing.downloads.remote.block_uncommon", false);
pref("browser.safebrowsing.debug", false);
pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar");

View File

@ -25,6 +25,7 @@
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
<project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="34adfb400e031f3dd3353d92413572db5e3a7376"/>
<project name="platform_system_libpdu" path="system/libpdu" remote="b2g" revision="ac4e539dbd73522c466ebffba53edea61702082f"/>
<project name="platform_system_sensorsd" path="system/sensorsd" remote="b2g" revision="3799a1cb57f08e9468d1cec6c74f8abe93ddae36"/>
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>

View File

@ -25,6 +25,7 @@
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
<project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
<project name="platform_system_libfdio" path="system/libfdio" remote="b2g" revision="34adfb400e031f3dd3353d92413572db5e3a7376"/>
<project name="platform_system_libpdu" path="system/libpdu" remote="b2g" revision="ac4e539dbd73522c466ebffba53edea61702082f"/>
<project name="platform_system_sensorsd" path="system/sensorsd" remote="b2g" revision="3799a1cb57f08e9468d1cec6c74f8abe93ddae36"/>
<default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>

View File

@ -26,17 +26,14 @@ DEFINES += -DJAREXT=
DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
# Set MSVC dlls version to package, if any.
ifdef WIN32_REDIST_DIR
ifdef MOZ_NO_DEBUG_RTL
ifdef WIN32_REDIST_DIR
DEFINES += -DMOZ_PACKAGE_MSVC_DLLS=1
DEFINES += -DMSVC_C_RUNTIME_DLL=$(MSVC_C_RUNTIME_DLL)
DEFINES += -DMSVC_CXX_RUNTIME_DLL=$(MSVC_CXX_RUNTIME_DLL)
ifdef MSVC_APPCRT_DLL
DEFINES += -DMSVC_APPCRT_DLL=$(MSVC_APPCRT_DLL)
endif
ifdef MSVC_DESKTOPCRT_DLL
DEFINES += -DMSVC_DESKTOPCRT_DLL=$(MSVC_DESKTOPCRT_DLL)
endif
ifdef WIN_UCRT_REDIST_DIR
DEFINES += -DMOZ_PACKAGE_WIN_UCRT_DLLS=1
endif
endif

View File

@ -65,12 +65,10 @@
#if MOZ_PACKAGE_MSVC_DLLS
@BINPATH@/@MSVC_C_RUNTIME_DLL@
@BINPATH@/@MSVC_CXX_RUNTIME_DLL@
#ifdef MSVC_APPCRT_DLL
@BINPATH@/@MSVC_APPCRT_DLL@
#endif
#ifdef MSVC_DESKTOPCRT_DLL
@BINPATH@/@MSVC_DESKTOPCRT_DLL@
#endif
#if MOZ_PACKAGE_WIN_UCRT_DLLS
@BINPATH@/api-ms-win-*.dll
@BINPATH@/ucrtbase.dll
#endif
#endif
#ifndef MOZ_NATIVE_ICU

View File

@ -7,14 +7,6 @@ dist_dest = $(DIST)/$(MOZ_MACBUNDLE_NAME)
# hardcode en-US for the moment
AB_CD = en-US
DEFINES += \
-DFIREFOX_ICO='"$(DIST)/branding/firefox.ico"' \
-DDOCUMENT_ICO='"$(DIST)/branding/document.ico"' \
-DNEWWINDOW_ICO='"$(DIST)/branding/newwindow.ico"' \
-DNEWTAB_ICO='"$(DIST)/branding/newtab.ico"' \
-DPBMODE_ICO='"$(DIST)/branding/pbmode.ico"' \
$(NULL)
# Build a binary bootstrapping with XRE_main
ifndef MOZ_WINCONSOLE

View File

@ -73,3 +73,7 @@ if CONFIG['HAVE_CLOCK_MONOTONIC']:
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wshadow']
for icon in ('firefox', 'document', 'newwindow', 'newtab', 'pbmode'):
DEFINES[icon.upper() + '_ICO'] = '"%s/dist/branding/%s.ico"' % (
TOPOBJDIR, icon)

View File

@ -953,6 +953,10 @@ pref("browser.safebrowsing.downloads.enabled", true);
pref("browser.safebrowsing.downloads.remote.enabled", true);
pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000);
pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%");
pref("browser.safebrowsing.downloads.remote.block_dangerous", true);
pref("browser.safebrowsing.downloads.remote.block_dangerous_host", true);
pref("browser.safebrowsing.downloads.remote.block_potentially_unwanted", false);
pref("browser.safebrowsing.downloads.remote.block_uncommon", false);
pref("browser.safebrowsing.debug", false);
pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar");

View File

@ -1,33 +1,11 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
waitForExplicitFinish();
BrowserOpenTab();
let tab = gBrowser.selectedTab;
let browser = tab.linkedBrowser;
registerCleanupFunction(function () { gBrowser.removeTab(tab); });
whenBrowserLoaded(browser, function () {
browser.loadURI("http://example.com/");
whenBrowserLoaded(browser, function () {
ok(!gBrowser.canGoBack, "about:newtab wasn't added to the session history");
finish();
});
add_task(function* test() {
yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" },
function* (browser) {
BrowserTestUtils.loadURI(browser, "http://example.com");
yield BrowserTestUtils.browserLoaded(browser);
ok(!gBrowser.canGoBack, "about:newtab wasn't added to the session history");
});
}
function whenBrowserLoaded(aBrowser, aCallback) {
if (aBrowser.contentDocument.readyState == "complete") {
executeSoon(aCallback);
return;
}
aBrowser.addEventListener("load", function onLoad() {
aBrowser.removeEventListener("load", onLoad, true);
executeSoon(aCallback);
}, true);
}
});

View File

@ -42,9 +42,6 @@ tags = trackingprotection
[browser_privatebrowsing_ui.js]
[browser_privatebrowsing_urlbarfocus.js]
[browser_privatebrowsing_windowtitle.js]
skip-if = e10s
[browser_privatebrowsing_zoom.js]
skip-if = e10s
[browser_privatebrowsing_zoomrestore.js]
skip-if = e10s
[browser_privatebrowsing_newtab_from_popup.js]

View File

@ -5,10 +5,9 @@
// This test makes sure that the window title changes correctly while switching
// from and to private browsing mode.
function test() {
add_task(function test() {
const testPageURL = "http://mochi.test:8888/browser/" +
"browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle_page.html";
waitForExplicitFinish();
requestLongerTimeout(2);
// initialization of expected titles
@ -38,69 +37,41 @@ function test() {
pb_about_pb_title = "You're browsing privately - " + app_name + " (Private Browsing)";
}
function testTabTitle(aWindow, url, insidePB, expected_title, funcNext) {
executeSoon(function () {
let tab = aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab();
let browser = aWindow.gBrowser.selectedBrowser;
browser.stop();
// ensure that the test is run after the titlebar has been updated
browser.addEventListener("load", function () {
browser.removeEventListener("load", arguments.callee, true);
executeSoon(function () {
if (aWindow.document.title != expected_title) {
executeSoon(arguments.callee);
return;
}
is(aWindow.document.title, expected_title, "The window title for " + url +
" is correct (" + (insidePB ? "inside" : "outside") +
" private browsing mode)");
function* testTabTitle(aWindow, url, insidePB, expected_title) {
let tab = (yield BrowserTestUtils.openNewForegroundTab(aWindow.gBrowser));
yield BrowserTestUtils.loadURI(tab.linkedBrowser, url);
yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
let win = aWindow.gBrowser.replaceTabWithWindow(tab);
win.addEventListener("load", function() {
win.removeEventListener("load", arguments.callee, false);
executeSoon(function() {
if (win.document.title != expected_title) {
executeSoon(arguments.callee);
return;
}
is(win.document.title, expected_title, "The window title for " + url +
" detached tab is correct (" + (insidePB ? "inside" : "outside") +
" private browsing mode)");
win.close();
aWindow.close();
setTimeout(funcNext, 0);
});
}, false);
});
}, true);
browser.loadURI(url);
yield BrowserTestUtils.waitForCondition(() => {
return aWindow.document.title === expected_title;
});
is(aWindow.document.title, expected_title, "The window title for " + url +
" is correct (" + (insidePB ? "inside" : "outside") +
" private browsing mode)");
let win = aWindow.gBrowser.replaceTabWithWindow(tab);
yield BrowserTestUtils.waitForEvent(win, "load", false);
yield BrowserTestUtils.waitForCondition(() => {
return win.document.title === expected_title;
});
is(win.document.title, expected_title, "The window title for " + url +
" detached tab is correct (" + (insidePB ? "inside" : "outside") +
" private browsing mode)");
yield Promise.all([ BrowserTestUtils.closeWindow(win),
BrowserTestUtils.closeWindow(aWindow) ]);
}
whenNewWindowLoaded({private: false}, function(win) {
testTabTitle(win, "about:blank", false, page_without_title, function() {
whenNewWindowLoaded({private: false}, function(win) {
testTabTitle(win, testPageURL, false, page_with_title, function() {
whenNewWindowLoaded({private: false}, function(win) {
testTabTitle(win, "about:privatebrowsing", false, about_pb_title, function() {
whenNewWindowLoaded({private: true}, function(win) {
testTabTitle(win, "about:blank", true, pb_page_without_title, function() {
whenNewWindowLoaded({private: true}, function(win) {
testTabTitle(win, testPageURL, true, pb_page_with_title, function() {
whenNewWindowLoaded({private: true}, function(win) {
testTabTitle(win, "about:privatebrowsing", true, pb_about_pb_title, finish);
});
});
});
});
});
});
});
});
});
});
});
return;
}
function openWin(private) {
return BrowserTestUtils.openNewBrowserWindow({ private });
}
yield Task.spawn(testTabTitle((yield openWin(false)), "about:blank", false, page_without_title));
yield Task.spawn(testTabTitle((yield openWin(false)), testPageURL, false, page_with_title));
yield Task.spawn(testTabTitle((yield openWin(false)), "about:privatebrowsing", false, about_pb_title));
yield Task.spawn(testTabTitle((yield openWin(true)), "about:blank", true, pb_page_without_title));
yield Task.spawn(testTabTitle((yield openWin(true)), testPageURL, true, pb_page_with_title));
yield Task.spawn(testTabTitle((yield openWin(true)), "about:privatebrowsing", true, pb_about_pb_title));
});

View File

@ -5,56 +5,33 @@
// This test makes sure that private browsing turns off doesn't cause zoom
// settings to be reset on tab switch (bug 464962)
function test() {
waitForExplicitFinish();
add_task(function* test() {
let win = (yield BrowserTestUtils.openNewBrowserWindow({ private: true }));
let tabAbout = (yield BrowserTestUtils.openNewForegroundTab(win.gBrowser, "about:"));
let tabMozilla = (yield BrowserTestUtils.openNewForegroundTab(win.gBrowser, "about:"));
function testZoom(aWindow, aCallback) {
executeSoon(function() {
let tabAbout = aWindow.gBrowser.addTab();
aWindow.gBrowser.selectedTab = tabAbout;
let mozillaZoom = win.ZoomManager.zoom;
let aboutBrowser = aWindow.gBrowser.getBrowserForTab(tabAbout);
aboutBrowser.addEventListener("load", function onAboutBrowserLoad() {
aboutBrowser.removeEventListener("load", onAboutBrowserLoad, true);
let tabMozilla = aWindow.gBrowser.addTab();
aWindow.gBrowser.selectedTab = tabMozilla;
// change the zoom on the mozilla page
win.FullZoom.enlarge();
// make sure the zoom level has been changed
isnot(win.ZoomManager.zoom, mozillaZoom, "Zoom level can be changed");
mozillaZoom = win.ZoomManager.zoom;
let mozillaBrowser = aWindow.gBrowser.getBrowserForTab(tabMozilla);
mozillaBrowser.addEventListener("load", function onMozillaBrowserLoad() {
mozillaBrowser.removeEventListener("load", onMozillaBrowserLoad, true);
let mozillaZoom = aWindow.ZoomManager.zoom;
// switch to about: tab
yield BrowserTestUtils.switchTab(win.gBrowser, tabAbout);
// change the zoom on the mozilla page
aWindow.FullZoom.enlarge();
// make sure the zoom level has been changed
isnot(aWindow.ZoomManager.zoom, mozillaZoom, "Zoom level can be changed");
mozillaZoom = aWindow.ZoomManager.zoom;
// switch back to mozilla tab
yield BrowserTestUtils.switchTab(win.gBrowser, tabMozilla);
// switch to about: tab
aWindow.gBrowser.selectedTab = tabAbout;
// make sure the zoom level has not changed
is(win.ZoomManager.zoom, mozillaZoom,
"Entering private browsing should not reset the zoom on a tab");
// switch back to mozilla tab
aWindow.gBrowser.selectedTab = tabMozilla;
// cleanup
win.FullZoom.reset();
yield Promise.all([ BrowserTestUtils.removeTab(tabMozilla),
BrowserTestUtils.removeTab(tabAbout) ]);
// make sure the zoom level has not changed
is(aWindow.ZoomManager.zoom, mozillaZoom,
"Entering private browsing should not reset the zoom on a tab");
// cleanup
aWindow.FullZoom.reset();
aWindow.gBrowser.removeTab(tabMozilla);
aWindow.gBrowser.removeTab(tabAbout);
aWindow.close();
aCallback();
}, true);
mozillaBrowser.contentWindow.location = "about:mozilla";
}, true);
aboutBrowser.contentWindow.location = "about:";
});
}
whenNewWindowLoaded({private: true}, function(privateWindow) {
testZoom(privateWindow, finish);
});
}
yield BrowserTestUtils.closeWindow(win);
});

View File

@ -5,76 +5,60 @@
// This test makes sure that about:privatebrowsing does not appear zoomed in
// if there is already a zoom site pref for about:blank (bug 487656).
function test() {
add_task(function* test() {
// initialization
waitForExplicitFinish();
let windowsToClose = [];
let windowsToReset = [];
function doTestWhenReady(aIsZoomedWindow, aWindow, aCallback) {
function promiseLocationChange() {
return new Promise(resolve => {
Services.obs.addObserver(function onLocationChange(subj, topic, data) {
Services.obs.removeObserver(onLocationChange, topic);
resolve();
}, "browser-fullZoom:location-change", false);
});
}
function promiseTestReady(aIsZoomedWindow, aWindow) {
// Need to wait on two things, the ordering of which is not guaranteed:
// (1) the page load, and (2) FullZoom's update to the new page's zoom
// level. FullZoom broadcasts "browser-fullZoom:location-change" when its
// update is done. (See bug 856366 for details.)
let n = 0;
let browser = aWindow.gBrowser.selectedBrowser;
browser.addEventListener("load", function onLoad() {
browser.removeEventListener("load", onLoad, true);
if (++n == 2)
doTest(aIsZoomedWindow, aWindow, aCallback);
}, true);
Services.obs.addObserver(function onLocationChange(subj, topic, data) {
Services.obs.removeObserver(onLocationChange, topic);
if (++n == 2)
doTest(aIsZoomedWindow, aWindow, aCallback);
}, "browser-fullZoom:location-change", false);
browser.loadURI("about:blank");
return BrowserTestUtils.loadURI(browser, "about:blank").then(() => {
return Promise.all([ BrowserTestUtils.browserLoaded(browser),
promiseLocationChange() ]);
}).then(() => doTest(aIsZoomedWindow, aWindow));
}
function doTest(aIsZoomedWindow, aWindow, aCallback) {
function doTest(aIsZoomedWindow, aWindow) {
if (aIsZoomedWindow) {
is(aWindow.ZoomManager.zoom, 1,
"Zoom level for freshly loaded about:blank should be 1");
// change the zoom on the blank page
aWindow.FullZoom.enlarge();
isnot(aWindow.ZoomManager.zoom, 1, "Zoom level for about:blank should be changed");
aCallback();
return;
}
// make sure the zoom level is set to 1
is(aWindow.ZoomManager.zoom, 1, "Zoom level for about:privatebrowsing should be reset");
aCallback();
}
function finishTest() {
// cleanup
windowsToReset.forEach(function(win) {
win.FullZoom.reset();
});
windowsToClose.forEach(function(win) {
win.close();
});
finish();
}
function testOnWindow(options, callback) {
let win = whenNewWindowLoaded(options,
function(win) {
windowsToClose.push(win);
windowsToReset.push(win);
executeSoon(function() { callback(win); });
});
};
testOnWindow({}, function(win) {
doTestWhenReady(true, win, function() {
testOnWindow({private: true}, function(win) {
doTestWhenReady(false, win, finishTest);
});
return BrowserTestUtils.openNewBrowserWindow(options).then((win) => {
windowsToClose.push(win);
windowsToReset.push(win);
return win;
});
});
}
}
yield testOnWindow({}).then(win => promiseTestReady(true, win));
yield testOnWindow({private: true}).then(win => promiseTestReady(false, win));
// cleanup
windowsToReset.forEach((win) => win.FullZoom.reset());
yield Promise.all(windowsToClose.map(win => BrowserTestUtils.closeWindow(win)));
});

View File

@ -12,6 +12,6 @@ fi
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/macosx/mozconfig.rust"
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

View File

@ -20,6 +20,6 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/macosx/mozconfig.rust"
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

View File

@ -18,6 +18,6 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/macosx/mozconfig.rust"
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

View File

@ -13,7 +13,7 @@ ac_add_options --enable-warnings-as-errors
ac_add_options --enable-clang-plugin
. "$topsrcdir/build/macosx/mozconfig.rust"
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

View File

@ -53,7 +53,7 @@ whitelist['nightly']['macosx-universal'] += [
'ac_add_options --disable-install-strip',
'ac_add_options --enable-instruments',
'ac_add_options --enable-dtrace',
'. "$topsrcdir/build/macosx/mozconfig.rust"',
'. "$topsrcdir/build/mozconfig.rust"',
]
whitelist['nightly']['win32'] += [

View File

@ -47,5 +47,21 @@
"algorithm": "sha512",
"unpack": true,
"filename": "genisoimage.tar.xz"
},
{
"size": 60778437,
"visibility": "public",
"digest": "2d5d300dd0d829012953ca0dd70b0abfda4e848ff03450326cf0c10eac2a71e37275b824597641f0f536b97b754bc81b10f9dbbb73ff725412858a7c2b9df6a7",
"algorithm": "sha512",
"filename": "rust-std-lib.tar.bz2",
"unpack": true
},
{
"size": 36038146,
"visibility": "public",
"digest": "b967ba81cb08ce4c3a18e3f8411365ee775861df1ba7f60bcaccd03f940732ee9c4c622cd3163198abb36b2124cde550c61b5d153f1ae8a9107b382ddf660895",
"algorithm": "sha512",
"filename": "rustc-linux64.tar.bz2",
"unpack": true
}
]

View File

@ -58,17 +58,14 @@ endif
DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
# Set MSVC dlls version to package, if any.
ifdef WIN32_REDIST_DIR
ifdef MOZ_NO_DEBUG_RTL
ifdef WIN32_REDIST_DIR
DEFINES += -DMOZ_PACKAGE_MSVC_DLLS=1
DEFINES += -DMSVC_C_RUNTIME_DLL=$(MSVC_C_RUNTIME_DLL)
DEFINES += -DMSVC_CXX_RUNTIME_DLL=$(MSVC_CXX_RUNTIME_DLL)
ifdef MSVC_APPCRT_DLL
DEFINES += -DMSVC_APPCRT_DLL=$(MSVC_APPCRT_DLL)
endif
ifdef MSVC_DESKTOPCRT_DLL
DEFINES += -DMSVC_DESKTOPCRT_DLL=$(MSVC_DESKTOPCRT_DLL)
endif
ifdef WIN_UCRT_REDIST_DIR
DEFINES += -DMOZ_PACKAGE_WIN_UCRT_DLLS=1
endif
endif

View File

@ -91,12 +91,10 @@
#if MOZ_PACKAGE_MSVC_DLLS
@BINPATH@/@MSVC_C_RUNTIME_DLL@
@BINPATH@/@MSVC_CXX_RUNTIME_DLL@
#ifdef MSVC_APPCRT_DLL
@BINPATH@/@MSVC_APPCRT_DLL@
#endif
#ifdef MSVC_DESKTOPCRT_DLL
@BINPATH@/@MSVC_DESKTOPCRT_DLL@
#endif
#if MOZ_PACKAGE_WIN_UCRT_DLLS
@BINPATH@/api-ms-win-*.dll
@BINPATH@/ucrtbase.dll
#endif
#endif
#ifndef MOZ_NATIVE_ICU

View File

@ -15,14 +15,14 @@ XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
this.UserContextUI = {
getUserContextLabel(userContextId) {
switch (userContextId) {
switch (parseInt(userContextId)) {
// No UserContext:
case 0: return "";
case 1: return gBrowserBundle.GetStringFromName("usercontext.personal.label");
case 2: return gBrowserBundle.GetStringFromName("usercontext.work.label");
case 3: return gBrowserBundle.GetStringFromName("usercontext.shopping.label");
case 4: return gBrowserBundle.GetStringFromName("usercontext.banking.label");
case 3: return gBrowserBundle.GetStringFromName("usercontext.banking.label");
case 4: return gBrowserBundle.GetStringFromName("usercontext.shopping.label");
// Display the context IDs for values outside the pre-defined range.
// Used for debugging, no localization necessary.

View File

@ -32,5 +32,87 @@ AC_DEFUN([MOZ_RUST_SUPPORT], [
first in your path.
You can verify this by typing 'rustc --version'.])
fi
if test -n "$RUSTC" -a -n "$MOZ_RUST"; then
# Rust's --target options are similar to, but not exactly the same
# as, the autoconf-derived targets we use. An example would be that
# Rust uses distinct target triples for targetting the GNU C++ ABI
# and the MSVC C++ ABI on Win32, whereas autoconf has a single
# triple and relies on the user to ensure that everything is
# compiled for the appropriate ABI. We need to perform appropriate
# munging to get the correct option to rustc.
#
# The canonical list of targets supported can be derived from:
#
# https://github.com/rust-lang/rust/tree/master/mk/cfg
rust_target=
case "$target" in
# Linux
i*86*linux-gnu)
rust_target=i686-unknown-linux-gnu
;;
x86_64*linux-gnu)
rust_target=x86_64-unknown-linux-gnu
;;
# OS X and iOS
i*86-apple-darwin*)
rust_target=i686-apple-darwin
;;
i*86-apple-ios*)
rust_target=i386-apple-ios
;;
x86_64-apple-darwin*)
rust_target=x86_64-apple-darwin
;;
# Android
i*86*linux-android)
rust_target=i686-linux-android
;;
arm*linux-android*)
rust_target=arm-linux-androideabi
;;
# Windows
i*86-pc-mingw32)
# XXX better detection of CXX needed here, to figure out whether
# we need i686-pc-windows-gnu instead, since mingw32 builds work.
rust_target=i686-pc-windows-msvc
;;
x86_64-pc-mingw32)
# XXX and here as well
rust_target=x86_64-pc-windows-msvc
;;
*)
AC_ERROR([don't know how to translate $target for rustc])
esac
# Check to see whether we need to pass --target to RUSTC. This can
# happen when building Firefox on Windows: js's configure will receive
# a RUSTC from the toplevel configure that already has --target added to
# it.
rustc_target_arg=
case "$RUSTC" in
*--target=${rust_target}*)
;;
*)
rustc_target_arg=--target=${rust_target}
;;
esac
# Check to see whether our rustc has a reasonably functional stdlib
# for our chosen target.
echo 'pub extern fn hello() { println!("Hello world"); }' > conftest.rs
if AC_TRY_COMMAND(${RUSTC} --crate-type staticlib ${rustc_target_arg} -o conftest.rlib conftest.rs > /dev/null) && test -s conftest.rlib; then
RUSTC="${RUSTC} ${rustc_target_arg}"
else
AC_ERROR([cannot compile for ${rust_target} with ${RUSTC}])
fi
rm -f conftest.rs conftest.rlib
fi
# TODO: separate HOST_RUSTC and RUSTC variables
AC_SUBST(MOZ_RUST)
])

View File

@ -72,7 +72,6 @@ SEARCH_PATHS = [
'testing/luciddream',
'testing/marionette/client',
'testing/marionette/client/marionette/runner/mixins/browsermob-proxy-py',
'testing/marionette/transport',
'testing/marionette/driver',
'testing/mozbase/mozcrash',
'testing/mozbase/mozdebug',

View File

@ -1,6 +0,0 @@
# Options to enable rust in automation builds.
if test `uname -s` != Linux; then
RUSTC="$topsrcdir/rustc/bin/rustc"
ac_add_options --enable-rust
fi

View File

@ -1,9 +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/.
MODULES = stlport
include $(topsrcdir)/config/rules.mk
CXXFLAGS += -fuse-cxa-atexit

View File

@ -72,3 +72,7 @@ NO_EXPAND_LIBS = True
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
CXXFLAGS += [
'-fuse-cxa-atexit',
]

View File

@ -1,4 +1,3 @@
marionette_transport.pth:testing/marionette/transport
marionette_driver.pth:testing/marionette/driver
browsermobproxy.pth:testing/marionette/client/marionette/runner/mixins/browsermob-proxy-py
wptserve.pth:testing/web-platform/tests/tools/wptserve

View File

@ -4,23 +4,26 @@
include $(topsrcdir)/config/rules.mk
REDIST_FILES =
ifdef WIN32_REDIST_DIR
REDIST_FILES += '$(WIN32_REDIST_DIR)'/$(MSVC_C_RUNTIME_DLL)
REDIST_FILES += '$(WIN32_REDIST_DIR)'/$(MSVC_CXX_RUNTIME_DLL)
endif
REDIST_FILES = \
$(MSVC_C_RUNTIME_DLL) \
$(MSVC_CXX_RUNTIME_DLL) \
$(MSVC_APPCRT_DLL) \
$(MSVC_DESKTOPCRT_DLL) \
$(NULL)
ifdef WIN_UCRT_REDIST_DIR
REDIST_FILES += $(wildcard $(WIN_UCRT_REDIST_DIR)/api-ms-win-*.dll)
REDIST_FILES += '$(WIN_UCRT_REDIST_DIR)'/ucrtbase.dll
endif
ifdef REDIST_FILES
libs-preqs = \
$(call mkdir_deps,$(FINAL_TARGET)) \
$(NULL)
$(call mkdir_deps,$(FINAL_TARGET)) \
$(NULL)
libs:: $(libs-preqs)
install --preserve-timestamps $(foreach f,$(REDIST_FILES),'$(WIN32_REDIST_DIR)'/$(f)) $(FINAL_TARGET)
endif # WIN32_REDIST_DIR
install --preserve-timestamps $(REDIST_FILES) $(FINAL_TARGET)
endif
# run the binscope tool to make sure the binary and all libraries
# are using all available Windows OS-level security mechanisms

View File

@ -47,7 +47,7 @@ try:
proc = subprocess.Popen([binscope_path, "/target", binary_path,
"/output", log_file_path, "/sympath", symbol_path,
"/c", "ATLVersionCheck", "/c", "ATLVulnCheck", "/c", "SharedSectionCheck", "/c", "APTCACheck", "/c", "NXCheck",
"/c", "GSCheck", "/c", "GSFunctionSafeBuffersCheck", "/c", "GSFriendlyInitCheck",
"/c", "GSCheck", "/c", "GSFriendlyInitCheck",
"/c", "CompilerVersionCheck", "/c", "SafeSEHCheck", "/c", "SNCheck",
"/c", "DBCheck"], stdout=subprocess.PIPE)

View File

@ -396,19 +396,6 @@ endif # MOZ_DEBUG
endif # USE_STATIC_LIBS
endif # WINNT && !GNU_CC
ifeq ($(OS_ARCH),Darwin)
# Compiling ObjC requires an Apple compiler anyway, so it's ok to set
# host CMFLAGS here.
HOST_CMFLAGS += -fobjc-exceptions
HOST_CMMFLAGS += -fobjc-exceptions
OS_COMPILE_CMFLAGS += -fobjc-exceptions
OS_COMPILE_CMMFLAGS += -fobjc-exceptions
ifeq ($(MOZ_WIDGET_TOOLKIT),uikit)
OS_COMPILE_CMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
OS_COMPILE_CMMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch
endif
endif
COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS) $(_DEPEND_CFLAGS) $(CFLAGS) $(MOZBUILD_CFLAGS)
COMPILE_CXXFLAGS = $(if $(DISABLE_STL_WRAPPING),,$(STL_FLAGS)) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS) $(_DEPEND_CFLAGS) $(CXXFLAGS) $(MOZBUILD_CXXFLAGS)
COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS) $(MOZBUILD_CMFLAGS)

View File

@ -535,8 +535,6 @@ case "$target" in
MSVS_VERSION=2015
MSVC_C_RUNTIME_DLL=vcruntime140.dll
MSVC_CXX_RUNTIME_DLL=msvcp140.dll
MSVC_APPCRT_DLL=appcrt140.dll
MSVC_DESKTOPCRT_DLL=desktopcrt140.dll
# -Wv:18 disables all warnings introduced after VS2013
# See http://blogs.msdn.com/b/vcblog/archive/2014/11/12/improvements-to-warnings-in-the-c-compiler.aspx
@ -555,6 +553,13 @@ case "$target" in
# C4091: 'typedef ': ignored on left of '' when no variable is declared
CFLAGS="$CFLAGS -wd4091"
CXXFLAGS="$CXXFLAGS -wd4091"
if test -n "$WIN_UCRT_REDIST_DIR"; then
if test ! -d "$WIN_UCRT_REDIST_DIR"; then
AC_MSG_ERROR([Invalid Windows UCRT Redist directory: ${WIN_UCRT_REDIST_DIR}])
fi
WIN_UCRT_REDIST_DIR=`cd "$WIN_UCRT_REDIST_DIR" && pwd`
fi
else
AC_MSG_ERROR([This version (${_CC_MAJOR_VERSION}.${_CC_MINOR_VERSION}.${_CC_BUILD_VERSION}) of the MSVC compiler is unsupported.
You must install Visual C++ 2013 Update 3, Visual C++ 2015 Update 1, or newer in order to build.
@ -563,8 +568,6 @@ See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
AC_SUBST(MSVS_VERSION)
AC_SUBST(MSVC_C_RUNTIME_DLL)
AC_SUBST(MSVC_CXX_RUNTIME_DLL)
AC_SUBST(MSVC_APPCRT_DLL)
AC_SUBST(MSVC_DESKTOPCRT_DLL)
# Disable SEH on clang-cl because it doesn't implement them yet.
if test -z "$CLANG_CL"; then
@ -1634,7 +1637,6 @@ dnl ========================================================
if test -n "$MACOSX_DEPLOYMENT_TARGET" -a -n "$MOZ_RUST"; then
AC_MSG_CHECKING([if we're targeting 32-bit])
if test -z "$HAVE_64BIT_BUILD"; then
RUSTC="$RUSTC --target=i686-apple-darwin"
AC_MSG_RESULT([using $RUSTC])
else
AC_MSG_RESULT([no])
@ -2216,6 +2218,8 @@ ia64*-hpux*)
_USE_CPP_INCLUDE_FLAG=1
_DEFINES_CFLAGS='-FI $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT'
_DEFINES_CXXFLAGS='-FI $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT'
SSE_FLAGS="-arch:SSE"
SSE2_FLAGS="-arch:SSE2"
CFLAGS="$CFLAGS -W3 -Gy"
CXXFLAGS="$CXXFLAGS -W3 -Gy"
if test "$CPU_ARCH" = "x86"; then
@ -7216,14 +7220,16 @@ else
*-mingw*)
AC_DEFINE(MOZ_MEMORY_WINDOWS)
export MOZ_NO_DEBUG_RTL=1
WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
dnl Look for a broken crtdll.obj
WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
if grep -q '__imp__\{0,1\}free' crtdll.obj; then
MOZ_CRT=1
if test "$MSVS_VERSION" != "2015"; then
WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
dnl Look for a broken crtdll.obj
WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
if grep -q '__imp__\{0,1\}free' crtdll.obj; then
MOZ_CRT=1
fi
rm crtdll.obj
fi
rm crtdll.obj
;;
*)
AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
@ -8800,6 +8806,19 @@ AC_SUBST(MOZ_NATIVE_NSPR)
AC_SUBST(MOZ_NATIVE_NSS)
AC_SUBST(NSS_DISABLE_DBM)
HOST_CMFLAGS=-fobjc-exceptions
HOST_CMMFLAGS=-fobjc-exceptions
OS_COMPILE_CMFLAGS=-fobjc-exceptions
OS_COMPILE_CMMFLAGS=-fobjc-exceptions
if test "$MOZ_WIDGET_TOOLKIT" = uikit; then
OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
fi
AC_SUBST(HOST_CMFLAGS)
AC_SUBST(HOST_CMMFLAGS)
AC_SUBST(OS_COMPILE_CMFLAGS)
AC_SUBST(OS_COMPILE_CMMFLAGS)
OS_CFLAGS="$CFLAGS"
OS_CXXFLAGS="$CXXFLAGS"
OS_CPPFLAGS="$CPPFLAGS"

View File

@ -21,6 +21,8 @@ var ssm = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
const XUL_PRINCIPAL = ssm.createCodebasePrincipal(XUL_URI, {});
add_task(function*() {
requestLongerTimeout(2);
info("Checking stylesheets on HTML document");
yield addTab(TEST_URI_HTML);
let target = getNode("#target");

View File

@ -258,7 +258,7 @@ private:
nsCOMPtr<nsIX509Cert> certFromDB;
nsresult rv;
rv = certDB->FindCertByNickname(nullptr, NS_ConvertASCIItoUTF16(mNickname),
rv = certDB->FindCertByNickname(NS_ConvertASCIItoUTF16(mNickname),
getter_AddRefs(certFromDB));
if (NS_FAILED(rv)) {
return rv;

View File

@ -1688,7 +1688,7 @@ nsDocShell::FirePageHideNotification(bool aIsUnload)
mTiming->NotifyUnloadEventEnd();
}
nsAutoTArray<nsCOMPtr<nsIDocShell>, 8> kids;
AutoTArray<nsCOMPtr<nsIDocShell>, 8> kids;
uint32_t n = mChildList.Length();
kids.SetCapacity(n);
for (uint32_t i = 0; i < n; i++) {
@ -4396,7 +4396,7 @@ nsDocShell::RemoveFromSessionHistory()
int32_t index = 0;
sessionHistory->GetIndex(&index);
nsAutoTArray<uint64_t, 16> ids;
AutoTArray<uint64_t, 16> ids;
ids.AppendElement(mHistoryID);
internalHistory->RemoveEntries(ids, index);
return NS_OK;
@ -4487,7 +4487,7 @@ nsDocShell::ClearFrameHistory(nsISHEntry* aEntry)
int32_t count = 0;
shcontainer->GetChildCount(&count);
nsAutoTArray<uint64_t, 16> ids;
AutoTArray<uint64_t, 16> ids;
for (int32_t i = 0; i < count; ++i) {
nsCOMPtr<nsISHEntry> child;
shcontainer->GetChildAt(i, getter_AddRefs(child));
@ -14313,9 +14313,11 @@ nsDocShell::InFrameSwap()
NS_IMETHODIMP
nsDocShell::IssueWarning(uint32_t aWarning, bool aAsError)
{
nsCOMPtr<nsIDocument> doc = mContentViewer->GetDocument();
if (doc) {
doc->WarnOnceAbout(nsIDocument::DeprecatedOperations(aWarning), aAsError);
if (mContentViewer) {
nsCOMPtr<nsIDocument> doc = mContentViewer->GetDocument();
if (doc) {
doc->WarnOnceAbout(nsIDocument::DeprecatedOperations(aWarning), aAsError);
}
}
return NS_OK;
}

View File

@ -1405,7 +1405,7 @@ nsSHistory::RemoveDynEntries(int32_t aOldIndex, int32_t aNewIndex)
nsCOMPtr<nsISHEntry> originalSH;
GetEntryAtIndex(aOldIndex, false, getter_AddRefs(originalSH));
nsCOMPtr<nsISHContainer> originalContainer = do_QueryInterface(originalSH);
nsAutoTArray<uint64_t, 16> toBeRemovedEntries;
AutoTArray<uint64_t, 16> toBeRemovedEntries;
if (originalContainer) {
nsTArray<uint64_t> originalDynDocShellIDs;
GetDynamicChildren(originalContainer, originalDynDocShellIDs, true);

View File

@ -578,7 +578,7 @@ EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext,
nsCSSPropertySet&
aPropertiesOverridden)
{
nsAutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
AutoTArray<nsCSSProperty, LayerAnimationInfo::kRecords> propertiesToTrack;
{
nsCSSPropertySet propertiesToTrackAsSet;
for (KeyframeEffectReadOnly* effect : aEffectSet) {

View File

@ -1355,7 +1355,7 @@ BuildAnimationPropertyListFromKeyframeSequence(
{
// Convert the object in aIterator to sequence<Keyframe>, producing
// an array of OffsetIndexedKeyframe objects.
nsAutoTArray<OffsetIndexedKeyframe,4> keyframes;
AutoTArray<OffsetIndexedKeyframe,4> keyframes;
if (!ConvertKeyframeSequence(aCx, aIterator, keyframes)) {
aRv.Throw(NS_ERROR_FAILURE);
return;

View File

@ -81,7 +81,7 @@ waitForAllPaints(function() {
is(markers.length, 0,
'CSS animations running on the compositor should not update style ' +
'on the main thread');
div.remove(div);
div.remove();
});
add_task_if_omta_enabled(function* no_restyling_for_compositor_transitions() {
@ -98,7 +98,7 @@ waitForAllPaints(function() {
is(markers.length, 0,
'CSS transitions running on the compositor should not update style ' +
'on the main thread');
div.remove(div);
div.remove();
});
add_task_if_omta_enabled(function* no_restyling_when_animation_duration_is_changed() {
@ -114,7 +114,7 @@ waitForAllPaints(function() {
is(markers.length, 0,
'Animations running on the compositor should not update style ' +
'on the main thread');
div.remove(div);
div.remove();
});
add_task_if_omta_enabled(function* only_one_restyling_after_finish_is_called() {
@ -130,7 +130,7 @@ waitForAllPaints(function() {
is(markers.length, 1,
'Animations running on the compositor should only update style ' +
'once after finish() is called');
div.remove(div);
div.remove();
});
add_task(function* no_restyling_mouse_movement_on_finished_transition() {
@ -155,7 +155,7 @@ waitForAllPaints(function() {
is(markers.length, 0,
'Bug 1219236: Finished transitions should never cause restyles ' +
'when mouse is moved on the animations');
div.remove(div);
div.remove();
});
add_task(function* no_restyling_mouse_movement_on_finished_animation() {
@ -178,7 +178,7 @@ waitForAllPaints(function() {
is(markers.length, 0,
'Bug 1219236: Finished animations should never cause restyles ' +
'when mouse is moved on the animations');
div.remove(div);
div.remove();
});
add_task_if_omta_enabled(function* no_restyling_compositor_animations_out_of_view_element() {
@ -194,7 +194,7 @@ waitForAllPaints(function() {
todo_is(markers.length, 0,
'Bug 1166500: Animations running on the compositor in out of ' +
'view element should never cause restyles');
div.remove(div);
div.remove();
});
add_task(function* no_restyling_main_thread_animations_out_of_view_element() {
@ -208,7 +208,7 @@ waitForAllPaints(function() {
todo_is(markers.length, 0,
'Bug 1166500: Animations running on the main-thread in out of ' +
'view element should never cause restyles');
div.remove(div);
div.remove();
});
/*
@ -249,7 +249,7 @@ waitForAllPaints(function() {
todo_is(markers.length, 0,
'Bug 1166500: Animations running on the main-thread in elements ' +
'which are scrolled out should never cause restyles');
parentElement.remove(div);
parentElement.remove();
});
/*
@ -269,7 +269,7 @@ waitForAllPaints(function() {
todo_is(markers.length, 0,
'Bug 1237454: Animations running on the compositor in ' +
'visibility hidden element should never cause restyles');
div.remove(div);
div.remove();
});
*/
@ -284,7 +284,7 @@ waitForAllPaints(function() {
todo_is(markers.length, 0,
'Bug 1237454: Animations running on the main-thread in ' +
'visibility hidden element should never cause restyles');
div.remove(div);
div.remove();
});
add_task_if_omta_enabled(function* no_restyling_compositor_animations_after_pause_is_called() {
@ -302,10 +302,10 @@ waitForAllPaints(function() {
is(markers.length, 0,
'Bug 1232563: Paused animations running on the compositor should ' +
'never cause restyles once after pause() is called');
div.remove(div);
div.remove();
});
add_task(function* no_restyling_matn_thread_animations_after_pause_is_called() {
add_task(function* no_restyling_main_thread_animations_after_pause_is_called() {
var div = addDiv(null, { style: 'animation: background-color 100s' });
var animation = div.getAnimations()[0];
@ -319,7 +319,22 @@ waitForAllPaints(function() {
is(markers.length, 0,
'Bug 1232563: Paused animations running on the main-thread should ' +
'never cause restyles after pause() is called');
div.remove(div);
div.remove();
});
add_task_if_omta_enabled(function* only_one_restyling_when_current_time_is_set_to_middle_of_duration() {
var div = addDiv(null, { style: 'animation: opacity 100s' });
var animation = div.getAnimations()[0];
yield animation.ready;
animation.currentTime = 50000; // 50s
var markers = yield observeStyling(5);
is(markers.length, 1,
'Bug 1235478: Animations running on the compositor should only once ' +
'update style when currentTime is set to middle of duration time');
div.remove();
});
});

View File

@ -267,7 +267,7 @@ template <typename T> void GetDataFromMatrix(const DOMMatrixReadOnly* aMatrix, T
void
DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
{
nsAutoTArray<float, 16> arr;
AutoTArray<float, 16> arr;
arr.SetLength(16);
GetDataFromMatrix(this, arr.Elements());
JS::Rooted<JS::Value> value(aCx);
@ -281,7 +281,7 @@ DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle<JSObject*> a
void
DOMMatrixReadOnly::ToFloat64Array(JSContext* aCx, JS::MutableHandle<JSObject*> aResult, ErrorResult& aRv) const
{
nsAutoTArray<double, 16> arr;
AutoTArray<double, 16> arr;
arr.SetLength(16);
GetDataFromMatrix(this, arr.Elements());
JS::Rooted<JS::Value> value(aCx);

View File

@ -259,7 +259,7 @@ Blob::ToFile()
already_AddRefed<File>
Blob::ToFile(const nsAString& aName, ErrorResult& aRv) const
{
nsAutoTArray<RefPtr<BlobImpl>, 1> blobImpls;
AutoTArray<RefPtr<BlobImpl>, 1> blobImpls;
blobImpls.AppendElement(mImpl);
nsAutoString contentType;

View File

@ -308,7 +308,7 @@ nsIContent::GetBaseURI(bool aTryUseXHRDocBaseURI) const
// faster for the far more common case of there not being any such
// attributes.
// Also check for SVG elements which require special handling
nsAutoTArray<nsString, 5> baseAttrs;
AutoTArray<nsString, 5> baseAttrs;
nsString attr;
const nsIContent *elem = this;
do {
@ -1328,7 +1328,7 @@ public:
}
private:
nsAutoTArray<nsCOMPtr<nsIContent>,
AutoTArray<nsCOMPtr<nsIContent>,
SUBTREE_UNBINDINGS_PER_RUNNABLE> mSubtreeRoots;
RefPtr<ContentUnbinder> mNext;
ContentUnbinder* mLast;
@ -1528,11 +1528,11 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode)
// nodesToUnpurple contains nodes which will be removed
// from the purple buffer if the DOM tree is black.
nsAutoTArray<nsIContent*, 1020> nodesToUnpurple;
AutoTArray<nsIContent*, 1020> nodesToUnpurple;
// grayNodes need script traverse, so they aren't removed from
// the purple buffer, but are marked to be in black subtree so that
// traverse is faster.
nsAutoTArray<nsINode*, 1020> grayNodes;
AutoTArray<nsINode*, 1020> grayNodes;
bool foundBlack = root->IsBlack();
if (root != currentDoc) {
@ -1598,8 +1598,8 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode)
return !NeedsScriptTraverse(aNode);
}
nsAutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
nsAutoTArray<nsIContent*, 1020>* gNodesToUnbind = nullptr;
AutoTArray<nsINode*, 1020>* gPurpleRoots = nullptr;
AutoTArray<nsIContent*, 1020>* gNodesToUnbind = nullptr;
void ClearCycleCollectorCleanupData()
{
@ -1702,7 +1702,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
// nodesToClear contains nodes which are either purple or
// gray.
nsAutoTArray<nsIContent*, 1020> nodesToClear;
AutoTArray<nsIContent*, 1020> nodesToClear;
bool foundBlack = root->IsBlack();
bool domOnlyCycle = false;
@ -1751,7 +1751,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
root->SetIsPurpleRoot(true);
if (domOnlyCycle) {
if (!gNodesToUnbind) {
gNodesToUnbind = new nsAutoTArray<nsIContent*, 1020>();
gNodesToUnbind = new AutoTArray<nsIContent*, 1020>();
}
gNodesToUnbind->AppendElement(static_cast<nsIContent*>(root));
for (uint32_t i = 0; i < nodesToClear.Length(); ++i) {
@ -1763,7 +1763,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed)
return true;
} else {
if (!gPurpleRoots) {
gPurpleRoots = new nsAutoTArray<nsINode*, 1020>();
gPurpleRoots = new AutoTArray<nsINode*, 1020>();
}
gPurpleRoots->AppendElement(root);
}

View File

@ -871,7 +871,7 @@ Navigator::RemoveIdleObserver(MozIdleObserver& aIdleObserver, ErrorResult& aRv)
bool
Navigator::Vibrate(uint32_t aDuration)
{
nsAutoTArray<uint32_t, 1> pattern;
AutoTArray<uint32_t, 1> pattern;
pattern.AppendElement(aDuration);
return Vibrate(pattern);
}

View File

@ -155,7 +155,7 @@ protected:
nsCOMPtr<nsINode> mCommonParent;
// used by nsContentIterator to cache indices
nsAutoTArray<int32_t, 8> mIndexes;
AutoTArray<int32_t, 8> mIndexes;
// used by nsSubtreeIterator to cache indices. Why put them in the base
// class? Because otherwise I have to duplicate the routines GetNextSibling
@ -1058,8 +1058,8 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
// We can be at ANY node in the sequence. Need to regenerate the array of
// indexes back to the root or common parent!
nsAutoTArray<nsINode*, 8> oldParentStack;
nsAutoTArray<int32_t, 8> newIndexes;
AutoTArray<nsINode*, 8> oldParentStack;
AutoTArray<int32_t, 8> newIndexes;
// Get a list of the parents up to the root, then compare the new node with
// entries in that array until we find a match (lowest common ancestor). If
@ -1213,8 +1213,8 @@ protected:
RefPtr<nsRange> mRange;
// these arrays all typically are used and have elements
nsAutoTArray<nsIContent*, 8> mEndNodes;
nsAutoTArray<int32_t, 8> mEndOffsets;
AutoTArray<nsIContent*, 8> mEndNodes;
AutoTArray<int32_t, 8> mEndOffsets;
};
NS_IMPL_ADDREF_INHERITED(nsContentSubtreeIterator, nsContentIterator)

View File

@ -548,7 +548,7 @@ nsContentList::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
BringSelfUpToDate(true);
nsAutoTArray<nsIAtom*, 8> atoms;
AutoTArray<nsIAtom*, 8> atoms;
for (uint32_t i = 0; i < mElements.Length(); ++i) {
nsIContent *content = mElements.ElementAt(i);
if (content->HasID()) {

View File

@ -2286,7 +2286,7 @@ nsContentUtils::GetCommonAncestor(nsINode* aNode1,
}
// Build the chain of parents
nsAutoTArray<nsINode*, 30> parents1, parents2;
AutoTArray<nsINode*, 30> parents1, parents2;
do {
parents1.AppendElement(aNode1);
aNode1 = aNode1->GetParentNode();
@ -2335,7 +2335,7 @@ nsContentUtils::ComparePoints(nsINode* aParent1, int32_t aOffset1,
0;
}
nsAutoTArray<nsINode*, 32> parents1, parents2;
AutoTArray<nsINode*, 32> parents1, parents2;
nsINode* node1 = aParent1;
nsINode* node2 = aParent2;
do {
@ -4287,7 +4287,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode,
return frag.forget();
}
nsAutoTArray<nsString, 32> tagStack;
AutoTArray<nsString, 32> tagStack;
nsAutoString uriStr, nameStr;
nsCOMPtr<nsIContent> content = do_QueryInterface(aContextNode);
// just in case we have a text node
@ -6853,7 +6853,7 @@ nsContentUtils::FireMutationEventsForDirectParsing(nsIDocument* aDoc,
int32_t newChildCount = aDest->GetChildCount();
if (newChildCount && nsContentUtils::
HasMutationListeners(aDoc, NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
nsAutoTArray<nsCOMPtr<nsIContent>, 50> childNodes;
AutoTArray<nsCOMPtr<nsIContent>, 50> childNodes;
NS_ASSERTION(newChildCount - aOldChildCount >= 0,
"What, some unexpected dom mutation has happened?");
childNodes.SetCapacity(newChildCount - aOldChildCount);
@ -7920,7 +7920,7 @@ nsContentUtils::FirePageHideEvent(nsIDocShellTreeItem* aItem,
int32_t childCount = 0;
aItem->GetChildCount(&childCount);
nsAutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
kids.AppendElements(childCount);
for (int32_t i = 0; i < childCount; ++i) {
aItem->GetChildAt(i, getter_AddRefs(kids[i]));
@ -7945,7 +7945,7 @@ nsContentUtils::FirePageShowEvent(nsIDocShellTreeItem* aItem,
{
int32_t childCount = 0;
aItem->GetChildCount(&childCount);
nsAutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
AutoTArray<nsCOMPtr<nsIDocShellTreeItem>, 8> kids;
kids.AppendElements(childCount);
for (int32_t i = 0; i < childCount; ++i) {
aItem->GetChildAt(i, getter_AddRefs(kids[i]));
@ -8534,7 +8534,7 @@ private:
}
}
nsAutoTArray<Unit, STRING_BUFFER_UNITS> mUnits;
AutoTArray<Unit, STRING_BUFFER_UNITS> mUnits;
nsAutoPtr<StringBuilder> mNext;
StringBuilder* mLast;
// mLength is used only in the first StringBuilder object in the linked list.

View File

@ -22,7 +22,7 @@
using mozilla::dom::TreeOrderComparator;
using mozilla::dom::Animation;
nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
AutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
nsDOMMutationObserver::sScheduledMutationObservers = nullptr;
nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr;
@ -30,7 +30,7 @@ nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr;
uint32_t nsDOMMutationObserver::sMutationLevel = 0;
uint64_t nsDOMMutationObserver::sCount = 0;
nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
nsDOMMutationObserver::sCurrentlyHandlingObservers = nullptr;
nsINodeList*
@ -585,7 +585,7 @@ void
nsDOMMutationObserver::RescheduleForRun()
{
if (!sScheduledMutationObservers) {
sScheduledMutationObservers = new nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
sScheduledMutationObservers = new AutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
}
bool didInsert = false;
@ -882,7 +882,7 @@ nsDOMMutationObserver::HandleMutationsInternal()
nsTArray<RefPtr<nsDOMMutationObserver> >* suppressedObservers = nullptr;
while (sScheduledMutationObservers) {
nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>* observers =
AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* observers =
sScheduledMutationObservers;
sScheduledMutationObservers = nullptr;
for (uint32_t i = 0; i < observers->Length(); ++i) {
@ -995,7 +995,7 @@ nsDOMMutationObserver::AddCurrentlyHandlingObserver(nsDOMMutationObserver* aObse
if (!sCurrentlyHandlingObservers) {
sCurrentlyHandlingObservers =
new nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
new AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>;
}
while (sCurrentlyHandlingObservers->Length() < aMutationLevel) {

View File

@ -605,7 +605,7 @@ protected:
nsClassHashtable<nsISupportsHashKey,
nsCOMArray<nsMutationReceiver> > mTransientReceivers;
// MutationRecords which are being constructed.
nsAutoTArray<nsDOMMutationRecord*, 4> mCurrentMutations;
AutoTArray<nsDOMMutationRecord*, 4> mCurrentMutations;
// MutationRecords which will be handed to the callback at the end of
// the microtask.
RefPtr<nsDOMMutationRecord> mFirstPendingMutation;
@ -621,11 +621,11 @@ protected:
uint64_t mId;
static uint64_t sCount;
static nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
static AutoTArray<RefPtr<nsDOMMutationObserver>, 4>* sScheduledMutationObservers;
static nsDOMMutationObserver* sCurrentObserver;
static uint32_t sMutationLevel;
static nsAutoTArray<nsAutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
static AutoTArray<AutoTArray<RefPtr<nsDOMMutationObserver>, 4>, 4>*
sCurrentlyHandlingObservers;
};
@ -740,7 +740,7 @@ private:
static nsAutoMutationBatch* sCurrentBatch;
nsAutoMutationBatch* mPreviousBatch;
nsAutoTArray<BatchObserver, 2> mObservers;
AutoTArray<BatchObserver, 2> mObservers;
nsTArray<nsCOMPtr<nsIContent> > mRemovedNodes;
nsTArray<nsCOMPtr<nsIContent> > mAddedNodes;
nsINode* mBatchTarget;
@ -907,7 +907,7 @@ private:
};
static nsAutoAnimationMutationBatch* sCurrentBatch;
nsAutoTArray<nsDOMMutationObserver*, 2> mObservers;
AutoTArray<nsDOMMutationObserver*, 2> mObservers;
typedef nsTArray<Entry> EntryArray;
nsClassHashtable<nsPtrHashKey<nsINode>, EntryArray> mEntryTable;
// List of nodes referred to by mEntryTable so we can sort them

View File

@ -134,7 +134,7 @@ nsDOMTokenList::AddInternal(const nsAttrValue* aAttr,
}
bool oneWasAdded = false;
nsAutoTArray<nsString, 10> addedClasses;
AutoTArray<nsString, 10> addedClasses;
for (uint32_t i = 0, l = aTokens.Length(); i < l; ++i) {
const nsString& aToken = aTokens[i];
@ -175,7 +175,7 @@ nsDOMTokenList::Add(const nsTArray<nsString>& aTokens, ErrorResult& aError)
void
nsDOMTokenList::Add(const nsAString& aToken, mozilla::ErrorResult& aError)
{
nsAutoTArray<nsString, 1> tokens;
AutoTArray<nsString, 1> tokens;
tokens.AppendElement(aToken);
Add(tokens, aError);
}
@ -261,7 +261,7 @@ nsDOMTokenList::Remove(const nsTArray<nsString>& aTokens, ErrorResult& aError)
void
nsDOMTokenList::Remove(const nsAString& aToken, mozilla::ErrorResult& aError)
{
nsAutoTArray<nsString, 1> tokens;
AutoTArray<nsString, 1> tokens;
tokens.AppendElement(aToken);
Remove(tokens, aError);
}
@ -281,7 +281,7 @@ nsDOMTokenList::Toggle(const nsAString& aToken,
const bool forceOff = aForce.WasPassed() && !aForce.Value();
bool isPresent = attr && attr->Contains(aToken);
nsAutoTArray<nsString, 1> tokens;
AutoTArray<nsString, 1> tokens;
(*tokens.AppendElement()).Rebind(aToken.Data(), aToken.Length());
if (isPresent) {

View File

@ -3294,7 +3294,7 @@ nsDocument::ElementFromPointHelper(float aX, float aY,
bool aIgnoreRootScrollFrame,
bool aFlushLayout)
{
nsAutoTArray<RefPtr<Element>, 1> elementArray;
AutoTArray<RefPtr<Element>, 1> elementArray;
ElementsFromPointHelper(aX, aY,
((aIgnoreRootScrollFrame ? nsIDocument::IGNORE_ROOT_SCROLL_FRAME : 0) |
(aFlushLayout ? nsIDocument::FLUSH_LAYOUT : 0) |
@ -3416,7 +3416,7 @@ nsDocument::NodesFromRectHelper(float aX, float aY,
if (!rootFrame)
return NS_OK; // return nothing to premature XUL callers as a reminder to wait
nsAutoTArray<nsIFrame*,8> outFrames;
AutoTArray<nsIFrame*,8> outFrames;
nsLayoutUtils::GetFramesForArea(rootFrame, rect, outFrames,
nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC |
(aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0));
@ -8807,9 +8807,11 @@ nsDocument::CanSavePresentation(nsIRequest *aNewRequest)
}
#ifdef MOZ_WEBSPEECH
auto* globalWindow = nsGlobalWindow::Cast(win);
if (globalWindow->HasActiveSpeechSynthesis()) {
return false;
if (win) {
auto* globalWindow = nsGlobalWindow::Cast(win);
if (globalWindow->HasActiveSpeechSynthesis()) {
return false;
}
}
#endif
@ -11238,7 +11240,7 @@ nsDocument::RestorePreviousFullScreenState()
}
nsCOMPtr<nsIDocument> fullScreenDoc = GetFullscreenLeaf(this);
nsAutoTArray<nsDocument*, 8> exitDocs;
AutoTArray<nsDocument*, 8> exitDocs;
nsIDocument* doc = fullScreenDoc;
// Collect all subdocuments.
@ -11855,7 +11857,7 @@ nsDocument::ApplyFullscreen(const FullscreenRequest& aRequest)
// order, but we traverse the doctree in a leaf-to-root order, so we save
// references to the documents we must dispatch to so that we get the order
// as specified.
nsAutoTArray<nsIDocument*, 8> changed;
AutoTArray<nsIDocument*, 8> changed;
// Remember the root document, so that if a full-screen document is hidden
// we can reset full-screen state in the remaining visible full-screen documents.

View File

@ -162,11 +162,11 @@ protected:
uint32_t mEndDepth;
int32_t mStartRootIndex;
int32_t mEndRootIndex;
nsAutoTArray<nsINode*, 8> mCommonAncestors;
nsAutoTArray<nsIContent*, 8> mStartNodes;
nsAutoTArray<int32_t, 8> mStartOffsets;
nsAutoTArray<nsIContent*, 8> mEndNodes;
nsAutoTArray<int32_t, 8> mEndOffsets;
AutoTArray<nsINode*, 8> mCommonAncestors;
AutoTArray<nsIContent*, 8> mStartNodes;
AutoTArray<int32_t, 8> mStartOffsets;
AutoTArray<nsIContent*, 8> mEndNodes;
AutoTArray<int32_t, 8> mEndOffsets;
bool mHaltRangeHint;
// Used when context has already been serialized for
// table cell selections (where parent is <tr>)

View File

@ -1370,7 +1370,7 @@ nsFocusManager::GetCommonAncestor(nsPIDOMWindowOuter* aWindow1,
nsCOMPtr<nsIDocShellTreeItem> dsti2 = aWindow2->GetDocShell();
NS_ENSURE_TRUE(dsti2, nullptr);
nsAutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
AutoTArray<nsIDocShellTreeItem*, 30> parents1, parents2;
do {
parents1.AppendElement(dsti1);
nsCOMPtr<nsIDocShellTreeItem> parentDsti1;

View File

@ -399,7 +399,7 @@ protected:
bool InitChildGlobalInternal(nsISupports* aScope, const nsACString& aID);
nsCOMPtr<nsIXPConnectJSObjectHolder> mGlobal;
nsCOMPtr<nsIPrincipal> mPrincipal;
nsAutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
AutoTArray<JS::Heap<JSObject*>, 2> mAnonymousGlobalScopes;
static nsDataHashtable<nsStringHashKey, nsMessageManagerScriptHolder*>* sCachedScripts;
static nsScriptCacheCleaner* sScriptCacheCleaner;

View File

@ -931,6 +931,10 @@ GK_ATOM(onupgradeneeded, "onupgradeneeded")
GK_ATOM(onussdreceived, "onussdreceived")
GK_ATOM(onversionchange, "onversionchange")
GK_ATOM(onvoicechange, "onvoicechange")
GK_ATOM(onwebkitAnimationEnd, "onwebkitAnimationEnd")
GK_ATOM(onwebkitAnimationIteration, "onwebkitAnimationIteration")
GK_ATOM(onwebkitAnimationStart, "onwebkitAnimationStart")
GK_ATOM(onwebkitTransitionEnd, "onwebkitTransitionEnd")
GK_ATOM(onwheel, "onwheel")
GK_ATOM(open, "open")
GK_ATOM(optgroup, "optgroup")

View File

@ -1830,7 +1830,7 @@ public:
return mObservers;
}
protected:
nsAutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
AutoTArray< nsCOMPtr<nsIObserver>, 8 > mObservers;
};
/**

View File

@ -595,7 +595,7 @@ void
nsINode::Normalize()
{
// First collect list of nodes to be removed
nsAutoTArray<nsCOMPtr<nsIContent>, 50> nodes;
AutoTArray<nsCOMPtr<nsIContent>, 50> nodes;
bool canMerge = false;
for (nsIContent* node = this->GetFirstChild();
@ -864,7 +864,7 @@ nsINode::CompareDocumentPosition(nsINode& aOtherNode) const
return static_cast<uint16_t>(nsIDOMNode::DOCUMENT_POSITION_FOLLOWING);
}
nsAutoTArray<const nsINode*, 32> parents1, parents2;
AutoTArray<const nsINode*, 32> parents1, parents2;
const nsINode *node1 = &aOtherNode, *node2 = this;
@ -1992,7 +1992,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
nodeToInsertBefore = nodeToInsertBefore->GetNextSibling();
}
Maybe<nsAutoTArray<nsCOMPtr<nsIContent>, 50> > fragChildren;
Maybe<AutoTArray<nsCOMPtr<nsIContent>, 50> > fragChildren;
// Remove the new child from the old parent if one exists
nsIContent* newContent = aNewChild->AsContent();
@ -2702,7 +2702,7 @@ nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult)
nsCSSSelectorList* selectorList = ParseSelectorList(aSelector, aResult);
if (selectorList) {
FindMatchingElements<false, nsAutoTArray<Element*, 128>>(this,
FindMatchingElements<false, AutoTArray<Element*, 128>>(this,
selectorList,
*contentList,
aResult);

View File

@ -59,7 +59,7 @@ nsresult
nsLineBreaker::FlushCurrentWord()
{
uint32_t length = mCurrentWord.Length();
nsAutoTArray<uint8_t,4000> breakState;
AutoTArray<uint8_t,4000> breakState;
if (!breakState.AppendElements(length))
return NS_ERROR_OUT_OF_MEMORY;
@ -187,7 +187,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const char16_t* aText,
return rv;
}
nsAutoTArray<uint8_t,4000> breakState;
AutoTArray<uint8_t,4000> breakState;
if (aSink) {
if (!breakState.AppendElements(aLength))
return NS_ERROR_OUT_OF_MEMORY;
@ -313,7 +313,7 @@ nsLineBreaker::FindHyphenationPoints(nsHyphenator *aHyphenator,
uint8_t *aBreakState)
{
nsDependentSubstring string(aTextStart, aTextLimit);
AutoFallibleTArray<bool,200> hyphens;
AutoTArray<bool,200> hyphens;
if (NS_SUCCEEDED(aHyphenator->Hyphenate(string, hyphens))) {
for (uint32_t i = 0; i + 1 < string.Length(); ++i) {
if (hyphens[i]) {
@ -368,7 +368,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const uint8_t* aText, u
return rv;
}
nsAutoTArray<uint8_t,4000> breakState;
AutoTArray<uint8_t,4000> breakState;
if (aSink) {
if (!breakState.AppendElements(aLength))
return NS_ERROR_OUT_OF_MEMORY;

View File

@ -206,9 +206,9 @@ private:
const char16_t *aTextLimit,
uint8_t *aBreakState);
nsAutoTArray<char16_t,100> mCurrentWord;
AutoTArray<char16_t,100> mCurrentWord;
// All the items that contribute to mCurrentWord
nsAutoTArray<TextItem,2> mTextItems;
AutoTArray<TextItem,2> mTextItems;
nsIAtom* mCurrentWordLanguage;
bool mCurrentWordContainsMixedLang;
bool mCurrentWordContainsComplexChar;

View File

@ -125,7 +125,7 @@ nsIContent*
nsPIDOMWindow<T>::GetFocusedNode() const
{
if (IsOuterWindow()) {
return mInnerWindow->GetFocusedNode();
return mInnerWindow ? mInnerWindow->GetFocusedNode() : nullptr;
}
return mFocusedNode;

View File

@ -958,7 +958,7 @@ DOMHighResTimeStamp
PerformanceBase::ResolveTimestampFromName(const nsAString& aName,
ErrorResult& aRv)
{
nsAutoTArray<RefPtr<PerformanceEntry>, 1> arr;
AutoTArray<RefPtr<PerformanceEntry>, 1> arr;
DOMHighResTimeStamp ts;
Optional<nsAString> typeParam;
nsAutoString str;

View File

@ -199,10 +199,10 @@ private:
RefPtr<mozilla::dom::Element> mElement;
// For handling table rows
nsAutoTArray<bool, 8> mHasWrittenCellsForRow;
AutoTArray<bool, 8> mHasWrittenCellsForRow;
// Values gotten in OpenContainer that is (also) needed in CloseContainer
nsAutoTArray<bool, 8> mIsInCiteBlockquote;
AutoTArray<bool, 8> mIsInCiteBlockquote;
// The output data
nsAString* mOutputString;

View File

@ -152,7 +152,7 @@ protected:
};
// Stack to store one olState struct per <OL>.
nsAutoTArray<olState, 8> mOLStateStack;
AutoTArray<olState, 8> mOLStateStack;
bool HasNoChildren(nsIContent* aContent);
};

View File

@ -2070,10 +2070,10 @@ void DoTraceSequence(JSTracer* trc, InfallibleTArray<T>& seq);
namespace binding_detail {
template<typename T>
class AutoSequence : public AutoFallibleTArray<T, 16>
class AutoSequence : public AutoTArray<T, 16>
{
public:
AutoSequence() : AutoFallibleTArray<T, 16>()
AutoSequence() : AutoTArray<T, 16>()
{}
// Allow converting to const sequences as needed

View File

@ -4474,8 +4474,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
# reallocation behavior for arrays. In particular, if we use auto
# arrays for sequences and have a sequence of elements which are
# themselves sequences or have sequences as members, we have a problem.
# In that case, resizing the outermost nsAutoTarray to the right size
# will memmove its elements, but nsAutoTArrays are not memmovable and
# In that case, resizing the outermost AutoTArray to the right size
# will memmove its elements, but AutoTArrays are not memmovable and
# hence will end up with pointers to bogus memory, which is bad. To
# deal with this, we typically map WebIDL sequences to our Sequence
# type, which is in fact memmovable. The one exception is when we're
@ -8389,7 +8389,7 @@ class CGEnumerateHook(CGAbstractBindingMethod):
def generate_code(self):
return CGGeneric(dedent("""
nsAutoTArray<nsString, 8> names;
AutoTArray<nsString, 8> names;
ErrorResult rv;
self->GetOwnPropertyNames(cx, names, rv);
if (rv.MaybeSetPendingException(cx)) {
@ -10456,7 +10456,7 @@ class CGEnumerateOwnPropertiesViaGetOwnPropertyNames(CGAbstractBindingMethod):
def generate_code(self):
return CGGeneric(dedent("""
nsAutoTArray<nsString, 8> names;
AutoTArray<nsString, 8> names;
ErrorResult rv;
self->GetOwnPropertyNames(cx, names, rv);
if (rv.MaybeSetPendingException(cx)) {

View File

@ -94,7 +94,7 @@ GetAllBluetoothActors(InfallibleTArray<BluetoothParent*>& aActors)
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aActors.IsEmpty());
nsAutoTArray<ContentParent*, 20> contentActors;
AutoTArray<ContentParent*, 20> contentActors;
ContentParent::GetAll(contentActors);
for (uint32_t contentIndex = 0;
@ -102,7 +102,7 @@ GetAllBluetoothActors(InfallibleTArray<BluetoothParent*>& aActors)
contentIndex++) {
MOZ_ASSERT(contentActors[contentIndex]);
AutoInfallibleTArray<PBluetoothParent*, 5> bluetoothActors;
AutoTArray<PBluetoothParent*, 5> bluetoothActors;
contentActors[contentIndex]->ManagedPBluetoothParent(bluetoothActors);
for (uint32_t bluetoothIndex = 0;
@ -487,7 +487,7 @@ BluetoothService::SetEnabled(bool aEnabled)
{
MOZ_ASSERT(NS_IsMainThread());
AutoInfallibleTArray<BluetoothParent*, 10> childActors;
AutoTArray<BluetoothParent*, 10> childActors;
GetAllBluetoothActors(childActors);
for (uint32_t index = 0; index < childActors.Length(); index++) {
@ -571,7 +571,7 @@ BluetoothService::HandleShutdown()
Cleanup();
AutoInfallibleTArray<BluetoothParent*, 10> childActors;
AutoTArray<BluetoothParent*, 10> childActors;
GetAllBluetoothActors(childActors);
if (!childActors.IsEmpty()) {

View File

@ -1887,6 +1887,7 @@ BrowserElementChild.prototype = {
case Cr.NS_BINDING_ABORTED :
// Ignoring NS_BINDING_ABORTED, which is set when loading page is
// stopped.
case Cr.NS_ERROR_PARSED_DATA_CACHED:
return;
// TODO See nsDocShell::DisplayLoadError to see what extra

View File

@ -47,7 +47,7 @@ CleanupChildFds(CacheReadStream& aReadStream, CleanupAction aAction)
return;
}
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
FileDescriptorSetChild* fdSetActor =
static_cast<FileDescriptorSetChild*>(aReadStream.fds().get_PFileDescriptorSetChild());
@ -107,7 +107,7 @@ CleanupParentFds(CacheReadStream& aReadStream, CleanupAction aAction)
return;
}
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
FileDescriptorSetParent* fdSetActor =
static_cast<FileDescriptorSetParent*>(aReadStream.fds().get_PFileDescriptorSetParent());
@ -306,7 +306,7 @@ MatchInPutList(InternalRequest* aRequest,
RefPtr<InternalHeaders> cachedResponseHeaders =
TypeUtils::ToInternalHeaders(cachedResponse.headers());
nsAutoTArray<nsCString, 16> varyHeaders;
AutoTArray<nsCString, 16> varyHeaders;
ErrorResult rv;
cachedResponseHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
MOZ_ALWAYS_TRUE(!rv.Failed());

4
dom/cache/Cache.cpp vendored
View File

@ -114,7 +114,7 @@ public:
// an Array of Response objects. The following code unwraps these
// JS values back to an nsTArray<RefPtr<Response>>.
nsAutoTArray<RefPtr<Response>, 256> responseList;
AutoTArray<RefPtr<Response>, 256> responseList;
responseList.SetCapacity(mRequestList.Length());
bool isArray;
@ -571,7 +571,7 @@ Cache::AddAll(const GlobalObject& aGlobal,
return promise.forget();
}
nsAutoTArray<RefPtr<Promise>, 256> fetchList;
AutoTArray<RefPtr<Promise>, 256> fetchList;
fetchList.SetCapacity(aRequestList.Length());
// Begin fetching each request in parallel. For now, if an error occurs just

View File

@ -219,7 +219,7 @@ CacheOpChild::HandleResponse(const CacheResponseOrVoid& aResponseOrVoid)
void
CacheOpChild::HandleResponseList(const nsTArray<CacheResponse>& aResponseList)
{
nsAutoTArray<RefPtr<Response>, 256> responses;
AutoTArray<RefPtr<Response>, 256> responses;
responses.SetCapacity(aResponseList.Length());
for (uint32_t i = 0; i < aResponseList.Length(); ++i) {
@ -233,7 +233,7 @@ CacheOpChild::HandleResponseList(const nsTArray<CacheResponse>& aResponseList)
void
CacheOpChild::HandleRequestList(const nsTArray<CacheRequest>& aRequestList)
{
nsAutoTArray<RefPtr<Request>, 256> requests;
AutoTArray<RefPtr<Request>, 256> requests;
requests.SetCapacity(aRequestList.Length());
for (uint32_t i = 0; i < aRequestList.Length(); ++i) {

View File

@ -79,8 +79,8 @@ CacheOpParent::Execute(Manager* aManager)
const CachePutAllArgs& args = mOpArgs.get_CachePutAllArgs();
const nsTArray<CacheRequestResponse>& list = args.requestResponseList();
nsAutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
nsAutoTArray<nsCOMPtr<nsIInputStream>, 256> responseStreamList;
AutoTArray<nsCOMPtr<nsIInputStream>, 256> requestStreamList;
AutoTArray<nsCOMPtr<nsIInputStream>, 256> responseStreamList;
for (uint32_t i = 0; i < list.Length(); ++i) {
requestStreamList.AppendElement(
@ -221,7 +221,7 @@ CacheOpParent::DeserializeCacheStream(const CacheReadStreamOrVoid& aStreamOrVoid
}
// Option 3: A stream was serialized using normal methods.
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
if (readStream.fds().type() ==
OptionalFileDescriptorSet::TPFileDescriptorSetChild) {

View File

@ -588,11 +588,11 @@ DeleteCacheId(mozIStorageConnection* aConn, CacheId aCacheId,
// Delete the bodies explicitly as we need to read out the body IDs
// anyway. These body IDs must be deleted one-by-one as content may
// still be referencing them invidivually.
nsAutoTArray<EntryId, 256> matches;
AutoTArray<EntryId, 256> matches;
nsresult rv = QueryAll(aConn, aCacheId, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
nsAutoTArray<IdCount, 16> deletedSecurityIdList;
AutoTArray<IdCount, 16> deletedSecurityIdList;
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
deletedSecurityIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@ -720,7 +720,7 @@ CacheMatch(mozIStorageConnection* aConn, CacheId aCacheId,
*aFoundResponseOut = false;
nsAutoTArray<EntryId, 1> matches;
AutoTArray<EntryId, 1> matches;
nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches, 1);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@ -747,7 +747,7 @@ CacheMatchAll(mozIStorageConnection* aConn, CacheId aCacheId,
MOZ_ASSERT(aConn);
nsresult rv;
nsAutoTArray<EntryId, 256> matches;
AutoTArray<EntryId, 256> matches;
if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
rv = QueryAll(aConn, aCacheId, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@ -781,11 +781,11 @@ CachePut(mozIStorageConnection* aConn, CacheId aCacheId,
CacheQueryParams params(false, false, false, false,
NS_LITERAL_STRING(""));
nsAutoTArray<EntryId, 256> matches;
AutoTArray<EntryId, 256> matches;
nsresult rv = QueryCache(aConn, aCacheId, aRequest, params, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
nsAutoTArray<IdCount, 16> deletedSecurityIdList;
AutoTArray<IdCount, 16> deletedSecurityIdList;
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
deletedSecurityIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@ -814,7 +814,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId,
*aSuccessOut = false;
nsAutoTArray<EntryId, 256> matches;
AutoTArray<EntryId, 256> matches;
nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@ -822,7 +822,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId,
return rv;
}
nsAutoTArray<IdCount, 16> deletedSecurityIdList;
AutoTArray<IdCount, 16> deletedSecurityIdList;
rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut,
deletedSecurityIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@ -845,7 +845,7 @@ CacheKeys(mozIStorageConnection* aConn, CacheId aCacheId,
MOZ_ASSERT(aConn);
nsresult rv;
nsAutoTArray<EntryId, 256> matches;
AutoTArray<EntryId, 256> matches;
if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) {
rv = QueryAll(aConn, aCacheId, matches);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@ -912,7 +912,7 @@ StorageMatch(mozIStorageConnection* aConn,
rv = state->BindInt32ByName(NS_LITERAL_CSTRING("namespace"), aNamespace);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
nsAutoTArray<CacheId, 32> cacheIdList;
AutoTArray<CacheId, 32> cacheIdList;
bool hasMoreData = false;
while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {
@ -1218,7 +1218,7 @@ MatchByVaryHeader(mozIStorageConnection* aConn,
rv = state->BindInt32ByName(NS_LITERAL_CSTRING("entry_id"), entryId);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
nsAutoTArray<nsCString, 8> varyValues;
AutoTArray<nsCString, 8> varyValues;
bool hasMoreData = false;
while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) {

10
dom/cache/Manager.cpp vendored
View File

@ -74,12 +74,12 @@ public:
mozIStorageConnection::TRANSACTION_IMMEDIATE);
// Clean up orphaned Cache objects
nsAutoTArray<CacheId, 8> orphanedCacheIdList;
AutoTArray<CacheId, 8> orphanedCacheIdList;
nsresult rv = db::FindOrphanedCacheIds(aConn, orphanedCacheIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
for (uint32_t i = 0; i < orphanedCacheIdList.Length(); ++i) {
nsAutoTArray<nsID, 16> deletedBodyIdList;
AutoTArray<nsID, 16> deletedBodyIdList;
rv = db::DeleteCacheId(aConn, orphanedCacheIdList[i], deletedBodyIdList);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
@ -88,7 +88,7 @@ public:
}
// Clean up orphaned body objects
nsAutoTArray<nsID, 64> knownBodyIdList;
AutoTArray<nsID, 64> knownBodyIdList;
rv = db::GetKnownBodyIds(aConn, knownBodyIdList);
rv = BodyDeleteOrphanedFiles(aDBDir, knownBodyIdList);
@ -1373,7 +1373,7 @@ Manager::Listener::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult,
const SavedResponse& aSavedResponse,
StreamList* aStreamList)
{
nsAutoTArray<SavedResponse, 1> responseList;
AutoTArray<SavedResponse, 1> responseList;
responseList.AppendElement(aSavedResponse);
OnOpComplete(Move(aRv), aResult, INVALID_CACHE_ID, responseList,
nsTArray<SavedRequest>(), aStreamList);
@ -1902,7 +1902,7 @@ Manager::NoteOrphanedBodyIdList(const nsTArray<nsID>& aDeletedBodyIdList)
{
NS_ASSERT_OWNINGTHREAD(Manager);
nsAutoTArray<nsID, 64> deleteNowList;
AutoTArray<nsID, 64> deleteNowList;
deleteNowList.SetCapacity(aDeletedBodyIdList.Length());
for (uint32_t i = 0; i < aDeletedBodyIdList.Length(); ++i) {

View File

@ -222,7 +222,7 @@ ReadStream::Inner::Serialize(CacheReadStream* aReadStreamOut)
aReadStreamOut->id() = mId;
mControl->SerializeControl(aReadStreamOut);
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
SerializeInputStream(mStream, aReadStreamOut->params(), fds);
mControl->SerializeFds(aReadStreamOut, fds);
@ -451,7 +451,7 @@ ReadStream::Create(const CacheReadStream& aReadStream)
}
MOZ_ASSERT(control);
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
control->DeserializeFds(aReadStream, fds);
nsCOMPtr<nsIInputStream> stream =

View File

@ -44,7 +44,7 @@ namespace {
static bool
HasVaryStar(mozilla::dom::InternalHeaders* aHeaders)
{
nsAutoTArray<nsCString, 16> varyHeaders;
AutoTArray<nsCString, 16> varyHeaders;
ErrorResult rv;
aHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv);
MOZ_ALWAYS_TRUE(!rv.Failed());
@ -67,7 +67,7 @@ HasVaryStar(mozilla::dom::InternalHeaders* aHeaders)
void
SerializeNormalStream(nsIInputStream* aStream, CacheReadStream& aReadStreamOut)
{
nsAutoTArray<FileDescriptor, 4> fds;
AutoTArray<FileDescriptor, 4> fds;
SerializeInputStream(aStream, aReadStreamOut.params(), fds);
PFileDescriptorSetChild* fdSet = nullptr;
@ -94,7 +94,7 @@ ToHeadersEntryList(nsTArray<HeadersEntry>& aOut, InternalHeaders* aHeaders)
{
MOZ_ASSERT(aHeaders);
nsAutoTArray<InternalHeaders::Entry, 16> entryList;
AutoTArray<InternalHeaders::Entry, 16> entryList;
aHeaders->GetEntries(entryList);
for (uint32_t i = 0; i < entryList.Length(); ++i) {

View File

@ -247,7 +247,7 @@ nsGonkCameraControl::Initialize()
DOM_CAMERA_LOGI(" - flash: NOT supported\n");
}
nsAutoTArray<Size, 16> sizes;
AutoTArray<Size, 16> sizes;
mParams.Get(CAMERA_PARAM_SUPPORTED_VIDEOSIZES, sizes);
if (sizes.Length() > 0) {
mSeparateVideoAndPreviewSizesSupported = true;
@ -264,7 +264,7 @@ nsGonkCameraControl::Initialize()
mLastRecorderSize = mCurrentConfiguration.mPreviewSize;
}
nsAutoTArray<nsString, 8> modes;
AutoTArray<nsString, 8> modes;
mParams.Get(CAMERA_PARAM_SUPPORTED_METERINGMODES, modes);
if (!modes.IsEmpty()) {
nsString mode;
@ -302,7 +302,7 @@ nsGonkCameraControl::~nsGonkCameraControl()
nsresult
nsGonkCameraControl::ValidateConfiguration(const Configuration& aConfig, Configuration& aValidatedConfig)
{
nsAutoTArray<Size, 16> supportedSizes;
AutoTArray<Size, 16> supportedSizes;
Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
nsresult rv = GetSupportedSize(aConfig.mPictureSize, supportedSizes,
@ -923,7 +923,7 @@ nsGonkCameraControl::SetThumbnailSizeImpl(const Size& aSize)
uint32_t smallestDeltaIndex = UINT32_MAX;
int targetArea = aSize.width * aSize.height;
nsAutoTArray<Size, 8> supportedSizes;
AutoTArray<Size, 8> supportedSizes;
Get(CAMERA_PARAM_SUPPORTED_JPEG_THUMBNAIL_SIZES, supportedSizes);
for (uint32_t i = 0; i < supportedSizes.Length(); ++i) {
@ -1028,7 +1028,7 @@ nsGonkCameraControl::SetPictureSizeImpl(const Size& aSize)
return NS_OK;
}
nsAutoTArray<Size, 8> supportedSizes;
AutoTArray<Size, 8> supportedSizes;
Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes);
Size best;
@ -1727,7 +1727,7 @@ nsGonkCameraControl::SelectCaptureAndPreviewSize(const Size& aPreviewSize,
aPreviewSize.width, aPreviewSize.height,
aMaxSize.width, aMaxSize.height);
nsAutoTArray<Size, 16> sizes;
AutoTArray<Size, 16> sizes;
nsresult rv = Get(CAMERA_PARAM_SUPPORTED_PREVIEWSIZES, sizes);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;

View File

@ -1034,7 +1034,7 @@ protected:
bool fontExplicitLanguage;
};
nsAutoTArray<ContextState, 3> mStyleStack;
AutoTArray<ContextState, 3> mStyleStack;
inline ContextState& CurrentState() {
return mStyleStack[mStyleStack.Length() - 1];

View File

@ -239,7 +239,7 @@ ImageBitmapRenderingContext::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
imageLayer->SetContainer(imageContainer);
}
nsAutoTArray<ImageContainer::NonOwningImage, 1> imageList;
AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
RefPtr<layers::Image> image = ClipToIntrinsicSize();
imageList.AppendElement(ImageContainer::NonOwningImage(image));
imageContainer->SetCurrentImages(imageList);

View File

@ -30,6 +30,7 @@ namespace mozilla {
namespace dom {
class EventTarget;
class EventMessageAutoOverride;
class WantsPopupControlCheck;
#define GENERATED_EVENT(EventClass_) class EventClass_;
#include "mozilla/dom/GeneratedEventList.h"
@ -239,6 +240,7 @@ protected:
void SetEventType(const nsAString& aEventTypeArg);
already_AddRefed<nsIContent> GetTargetFromFrame();
friend class EventMessageAutoOverride;
friend class WantsPopupControlCheck;
void SetWantsPopupControlCheck(bool aCheck)
{
@ -268,6 +270,48 @@ protected:
bool mWantsPopupControlCheck;
};
/**
* RAII helper-class to override an event's message (i.e. its DOM-exposed
* type), for as long as the object is alive. Restores the original
* EventMessage when destructed.
*
* Notable requirements:
* - The original & overriding messages must be known (not eUnidentifiedEvent).
* - The original & overriding messages must be different.
* - The passed-in nsIDOMEvent must outlive this RAII helper.
*/
class MOZ_RAII EventMessageAutoOverride
{
public:
explicit EventMessageAutoOverride(nsIDOMEvent* aEvent,
EventMessage aOverridingMessage)
: mEvent(aEvent->InternalDOMEvent()),
mOrigMessage(mEvent->mEvent->mMessage)
{
MOZ_ASSERT(aOverridingMessage != mOrigMessage,
"Don't use this class if you're not actually overriding");
MOZ_ASSERT(aOverridingMessage != eUnidentifiedEvent,
"Only use this class with a valid overriding EventMessage");
MOZ_ASSERT(mOrigMessage != eUnidentifiedEvent &&
mEvent->mEvent->typeString.IsEmpty(),
"Only use this class on events whose overridden type is "
"known (so we can restore it properly)");
mEvent->mEvent->mMessage = aOverridingMessage;
}
~EventMessageAutoOverride()
{
mEvent->mEvent->mMessage = mOrigMessage;
}
protected:
// Non-owning ref, which should be safe since we're a stack-allocated object
// with limited lifetime. Whoever creates us should keep mEvent alive.
Event* const MOZ_NON_OWNING_REF mEvent;
const EventMessage mOrigMessage;
};
class MOZ_STACK_CLASS WantsPopupControlCheck
{
public:

View File

@ -19,7 +19,9 @@
#include "mozilla/HalSensor.h"
#include "mozilla/InternalMutationEvent.h"
#include "mozilla/JSEventHandler.h"
#include "mozilla/Maybe.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/Event.h"
@ -95,6 +97,21 @@ MutationBitForEventType(EventMessage aEventType)
uint32_t EventListenerManager::sMainThreadCreatedCount = 0;
static bool
IsWebkitPrefixSupportEnabled()
{
static bool sIsWebkitPrefixSupportEnabled;
static bool sIsPrefCached = false;
if (!sIsPrefCached) {
sIsPrefCached = true;
Preferences::AddBoolVarCache(&sIsWebkitPrefixSupportEnabled,
"layout.css.prefixes.webkit");
}
return sIsWebkitPrefixSupportEnabled;
}
EventListenerManagerBase::EventListenerManagerBase()
: mNoListenerForEvent(eVoidEvent)
, mMayHavePaintEventListener(false)
@ -603,9 +620,15 @@ EventListenerManager::RemoveEventListenerInternal(
}
bool
EventListenerManager::ListenerCanHandle(Listener* aListener,
WidgetEvent* aEvent)
EventListenerManager::ListenerCanHandle(const Listener* aListener,
const WidgetEvent* aEvent,
EventMessage aEventMessage) const
{
MOZ_ASSERT(aEventMessage == aEvent->mMessage ||
aEventMessage == GetLegacyEventMessage(aEvent->mMessage),
"aEvent and aEventMessage should agree, modulo legacyness");
// This is slightly different from EVENT_TYPE_EQUALS in that it returns
// true even when aEvent->mMessage == eUnidentifiedEvent and
// aListener=>mEventMessage != eUnidentifiedEvent as long as the atoms are
@ -620,7 +643,7 @@ EventListenerManager::ListenerCanHandle(Listener* aListener,
return aListener->mTypeString.Equals(aEvent->typeString);
}
MOZ_ASSERT(mIsMainThreadELM);
return aListener->mEventMessage == aEvent->mMessage;
return aListener->mEventMessage == aEventMessage;
}
void
@ -1048,6 +1071,30 @@ EventListenerManager::HandleEventSubType(Listener* aListener,
return result;
}
EventMessage
EventListenerManager::GetLegacyEventMessage(EventMessage aEventMessage) const
{
// (If we're off-main-thread, we can't check the pref; so we just behave as
// if it's disabled.)
if (mIsMainThreadELM && IsWebkitPrefixSupportEnabled()) {
// webkit-prefixed legacy events:
if (aEventMessage == eTransitionEnd) {
return eWebkitTransitionEnd;
}
if (aEventMessage == eAnimationStart) {
return eWebkitAnimationStart;
}
if (aEventMessage == eAnimationEnd) {
return eWebkitAnimationEnd;
}
if (aEventMessage == eAnimationIteration) {
return eWebkitAnimationIteration;
}
}
return aEventMessage;
}
nsIDocShell*
EventListenerManager::GetDocShellForTarget()
{
@ -1104,77 +1151,107 @@ EventListenerManager::HandleEventInternal(nsPresContext* aPresContext,
aEvent->mFlags.mDefaultPrevented = true;
}
nsAutoTObserverArray<Listener, 2>::EndLimitedIterator iter(mListeners);
Maybe<nsAutoPopupStatePusher> popupStatePusher;
if (mIsMainThreadELM) {
popupStatePusher.emplace(Event::GetEventPopupControlState(aEvent, *aDOMEvent));
}
bool hasListener = false;
while (iter.HasMore()) {
if (aEvent->mFlags.mImmediatePropagationStopped) {
break;
}
Listener* listener = &iter.GetNext();
// Check that the phase is same in event and event listener.
// Handle only trusted events, except when listener permits untrusted events.
if (ListenerCanHandle(listener, aEvent)) {
hasListener = true;
if (listener->IsListening(aEvent) &&
(aEvent->mFlags.mIsTrusted ||
listener->mFlags.mAllowUntrustedEvents)) {
if (!*aDOMEvent) {
// This is tiny bit slow, but happens only once per event.
nsCOMPtr<EventTarget> et =
do_QueryInterface(aEvent->originalTarget);
RefPtr<Event> event = EventDispatcher::CreateEvent(et, aPresContext,
bool usingLegacyMessage = false;
EventMessage eventMessage = aEvent->mMessage;
while (true) {
nsAutoTObserverArray<Listener, 2>::EndLimitedIterator iter(mListeners);
Maybe<EventMessageAutoOverride> legacyAutoOverride;
while (iter.HasMore()) {
if (aEvent->mFlags.mImmediatePropagationStopped) {
break;
}
Listener* listener = &iter.GetNext();
// Check that the phase is same in event and event listener.
// Handle only trusted events, except when listener permits untrusted events.
if (ListenerCanHandle(listener, aEvent, eventMessage)) {
hasListener = true;
if (listener->IsListening(aEvent) &&
(aEvent->mFlags.mIsTrusted ||
listener->mFlags.mAllowUntrustedEvents)) {
if (!*aDOMEvent) {
// This is tiny bit slow, but happens only once per event.
nsCOMPtr<EventTarget> et =
do_QueryInterface(aEvent->originalTarget);
RefPtr<Event> event = EventDispatcher::CreateEvent(et, aPresContext,
aEvent,
EmptyString());
event.forget(aDOMEvent);
}
if (*aDOMEvent) {
if (!aEvent->currentTarget) {
aEvent->currentTarget = aCurrentTarget->GetTargetForDOMEvent();
if (!aEvent->currentTarget) {
break;
}
event.forget(aDOMEvent);
}
// Maybe add a marker to the docshell's timeline, but only
// bother with all the logic if some docshell is recording.
nsDocShell* docShell;
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
bool needsEndEventMarker = false;
if (mIsMainThreadELM &&
listener->mListenerType != Listener::eNativeListener) {
nsCOMPtr<nsIDocShell> docShellComPtr = GetDocShellForTarget();
if (docShellComPtr) {
docShell = static_cast<nsDocShell*>(docShellComPtr.get());
if (timelines && timelines->HasConsumer(docShell)) {
needsEndEventMarker = true;
nsAutoString typeStr;
(*aDOMEvent)->GetType(typeStr);
uint16_t phase;
(*aDOMEvent)->GetEventPhase(&phase);
timelines->AddMarkerForDocShell(docShell, Move(
MakeUnique<EventTimelineMarker>(
typeStr, phase, MarkerTracingType::START)));
if (*aDOMEvent) {
if (!aEvent->currentTarget) {
aEvent->currentTarget = aCurrentTarget->GetTargetForDOMEvent();
if (!aEvent->currentTarget) {
break;
}
}
}
if (usingLegacyMessage && !legacyAutoOverride) {
// Override the aDOMEvent's event-message (its .type) until we
// finish traversing listeners (when legacyAutoOverride destructs)
legacyAutoOverride.emplace(*aDOMEvent, eventMessage);
}
if (NS_FAILED(HandleEventSubType(listener, *aDOMEvent, aCurrentTarget))) {
aEvent->mFlags.mExceptionHasBeenRisen = true;
}
// Maybe add a marker to the docshell's timeline, but only
// bother with all the logic if some docshell is recording.
nsDocShell* docShell;
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
bool needsEndEventMarker = false;
if (needsEndEventMarker) {
timelines->AddMarkerForDocShell(
docShell, "DOMEvent", MarkerTracingType::END);
if (mIsMainThreadELM &&
listener->mListenerType != Listener::eNativeListener) {
nsCOMPtr<nsIDocShell> docShellComPtr = GetDocShellForTarget();
if (docShellComPtr) {
docShell = static_cast<nsDocShell*>(docShellComPtr.get());
if (timelines && timelines->HasConsumer(docShell)) {
needsEndEventMarker = true;
nsAutoString typeStr;
(*aDOMEvent)->GetType(typeStr);
uint16_t phase;
(*aDOMEvent)->GetEventPhase(&phase);
timelines->AddMarkerForDocShell(docShell, Move(
MakeUnique<EventTimelineMarker>(
typeStr, phase, MarkerTracingType::START)));
}
}
}
if (NS_FAILED(HandleEventSubType(listener, *aDOMEvent, aCurrentTarget))) {
aEvent->mFlags.mExceptionHasBeenRisen = true;
}
if (needsEndEventMarker) {
timelines->AddMarkerForDocShell(
docShell, "DOMEvent", MarkerTracingType::END);
}
}
}
}
}
// If we didn't find any matching listeners, and our event has a legacy
// version, we'll now switch to looking for that legacy version and we'll
// recheck our listeners.
if (hasListener || usingLegacyMessage) {
// (No need to recheck listeners, because we already found a match, or we
// already rechecked them.)
break;
}
EventMessage legacyEventMessage = GetLegacyEventMessage(eventMessage);
if (legacyEventMessage == eventMessage) {
break; // There's no legacy version of our event; no need to recheck.
}
MOZ_ASSERT(GetLegacyEventMessage(legacyEventMessage) == legacyEventMessage,
"Legacy event messages should not themselves have legacy versions");
// Recheck our listeners, using the legacy event message we just looked up:
eventMessage = legacyEventMessage;
usingLegacyMessage = true;
}
aEvent->currentTarget = nullptr;

Some files were not shown because too many files have changed in this diff Show More