mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1626570 - Improve handling of copying arrays in layout/base/. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D72354
This commit is contained in:
parent
40a765717d
commit
37c0751e92
@ -341,8 +341,7 @@ class RefreshDriverTimer {
|
||||
return;
|
||||
}
|
||||
|
||||
nsTArray<RefPtr<nsRefreshDriver>> drivers(aDrivers);
|
||||
for (nsRefreshDriver* driver : drivers) {
|
||||
for (nsRefreshDriver* driver : aDrivers.Clone()) {
|
||||
// don't poke this driver if it's in test mode
|
||||
if (driver->IsTestControllingRefreshesEnabled()) {
|
||||
continue;
|
||||
@ -979,7 +978,7 @@ class InactiveRefreshDriverTimer final
|
||||
|
||||
mLastFireTime = now;
|
||||
|
||||
nsTArray<RefPtr<nsRefreshDriver>> drivers(mContentRefreshDrivers);
|
||||
nsTArray<RefPtr<nsRefreshDriver>> drivers(mContentRefreshDrivers.Clone());
|
||||
drivers.AppendElements(mRootRefreshDrivers);
|
||||
size_t index = mNextDriverIndex;
|
||||
|
||||
|
@ -155,8 +155,7 @@ nsStyleSheetService::LoadAndRegisterSheet(nsIURI* aSheetURI,
|
||||
rv = LoadAndRegisterSheetInternal(aSheetURI, aSheetType);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// Hold on to a copy of the registered PresShells.
|
||||
nsTArray<RefPtr<PresShell>> toNotify(mPresShells);
|
||||
for (PresShell* presShell : toNotify) {
|
||||
for (PresShell* presShell : mPresShells.Clone()) {
|
||||
StyleSheet* sheet = mSheets[aSheetType].LastElement();
|
||||
presShell->NotifyStyleSheetServiceSheetAdded(sheet, aSheetType);
|
||||
}
|
||||
@ -307,8 +306,7 @@ nsStyleSheetService::UnregisterSheet(nsIURI* aSheetURI, uint32_t aSheetType) {
|
||||
}
|
||||
|
||||
// Hold on to a copy of the registered PresShells.
|
||||
nsTArray<RefPtr<PresShell>> toNotify(mPresShells);
|
||||
for (PresShell* presShell : toNotify) {
|
||||
for (PresShell* presShell : mPresShells.Clone()) {
|
||||
if (presShell->StyleSet()) {
|
||||
if (sheet) {
|
||||
presShell->NotifyStyleSheetServiceSheetRemoved(sheet, aSheetType);
|
||||
|
Loading…
Reference in New Issue
Block a user