Skip to content

Commit 77681b7

Browse files
committed
Backed out 2 changesets (bug 1575479) for build bustage at build/src/gfx/thebes/gfxFT2Fonts.h on a CLOSED TREE
Backed out changeset dcbc7c69fb64 (bug 1575479) Backed out changeset 6d54a8115393 (bug 1575479)
1 parent f41bfba commit 77681b7

13 files changed

+40
-282
lines changed

toolkit/components/telemetry/core/Telemetry.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -561,13 +561,13 @@ bool TelemetryImpl::ReflectSQL(const SlowSQLEntryType* entry, const Stat* stat,
561561

562562
bool TelemetryImpl::ReflectMainThreadSQL(SlowSQLEntryType* entry, JSContext* cx,
563563
JS::Handle<JSObject*> obj) {
564-
return ReflectSQL(entry, &entry->GetModifiableData()->mainThread, cx, obj);
564+
return ReflectSQL(entry, &entry->mData.mainThread, cx, obj);
565565
}
566566

567567
bool TelemetryImpl::ReflectOtherThreadsSQL(SlowSQLEntryType* entry,
568568
JSContext* cx,
569569
JS::Handle<JSObject*> obj) {
570-
return ReflectSQL(entry, &entry->GetModifiableData()->otherThreads, cx, obj);
570+
return ReflectSQL(entry, &entry->mData.otherThreads, cx, obj);
571571
}
572572

573573
bool TelemetryImpl::AddSQLInfo(JSContext* cx, JS::Handle<JSObject*> rootObj,
@@ -1262,18 +1262,18 @@ void TelemetryImpl::StoreSlowSQL(const nsACString& sql, uint32_t delay,
12621262
if (!entry) {
12631263
entry = slowSQLMap->PutEntry(sql);
12641264
if (MOZ_UNLIKELY(!entry)) return;
1265-
entry->GetModifiableData()->mainThread.hitCount = 0;
1266-
entry->GetModifiableData()->mainThread.totalTime = 0;
1267-
entry->GetModifiableData()->otherThreads.hitCount = 0;
1268-
entry->GetModifiableData()->otherThreads.totalTime = 0;
1265+
entry->mData.mainThread.hitCount = 0;
1266+
entry->mData.mainThread.totalTime = 0;
1267+
entry->mData.otherThreads.hitCount = 0;
1268+
entry->mData.otherThreads.totalTime = 0;
12691269
}
12701270

12711271
if (NS_IsMainThread()) {
1272-
entry->GetModifiableData()->mainThread.hitCount++;
1273-
entry->GetModifiableData()->mainThread.totalTime += delay;
1272+
entry->mData.mainThread.hitCount++;
1273+
entry->mData.mainThread.totalTime += delay;
12741274
} else {
1275-
entry->GetModifiableData()->otherThreads.hitCount++;
1276-
entry->GetModifiableData()->otherThreads.totalTime += delay;
1275+
entry->mData.otherThreads.hitCount++;
1276+
entry->mData.otherThreads.totalTime += delay;
12771277
}
12781278
}
12791279

toolkit/components/telemetry/core/TelemetryScalar.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,7 @@ nsresult internal_GetEnumByScalarName(const StaticMutexAutoLock& lock,
14091409
if (!entry) {
14101410
return NS_ERROR_INVALID_ARG;
14111411
}
1412-
*aId = entry->GetData();
1412+
*aId = entry->mData;
14131413
return NS_OK;
14141414
}
14151415

@@ -1921,7 +1921,7 @@ void internal_RegisterScalars(const StaticMutexAutoLock& lock,
19211921
// Change the scalar to expired if needed.
19221922
if (scalarInfo.mDynamicExpiration && !scalarInfo.builtin) {
19231923
DynamicScalarInfo& scalarData =
1924-
(*gDynamicScalarInfo)[existingKey->GetData().id];
1924+
(*gDynamicScalarInfo)[existingKey->mData.id];
19251925
scalarData.mDynamicExpiration = true;
19261926
}
19271927
continue;
@@ -1930,7 +1930,7 @@ void internal_RegisterScalars(const StaticMutexAutoLock& lock,
19301930
gDynamicScalarInfo->AppendElement(scalarInfo);
19311931
uint32_t scalarId = gDynamicScalarInfo->Length() - 1;
19321932
CharPtrEntryType* entry = gScalarNameIDMap.PutEntry(scalarInfo.name());
1933-
entry->SetData(ScalarKey{scalarId, true});
1933+
entry->mData = ScalarKey{scalarId, true};
19341934
}
19351935
}
19361936

@@ -2415,7 +2415,7 @@ void TelemetryScalar::InitializeGlobalState(bool aCanRecordBase,
24152415
static_cast<uint32_t>(mozilla::Telemetry::ScalarID::ScalarCount);
24162416
for (uint32_t i = 0; i < scalarCount; i++) {
24172417
CharPtrEntryType* entry = gScalarNameIDMap.PutEntry(gScalars[i].name());
2418-
entry->SetData(ScalarKey{i, false});
2418+
entry->mData = ScalarKey{i, false};
24192419
}
24202420

24212421
// To summarize dynamic events we need a dynamic scalar.

toolkit/components/telemetry/other/TelemetryIOInterposeObserver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void TelemetryIOInterposeObserver::Observe(Observation& aOb) {
7575
// Create a new entry or retrieve the existing one
7676
FileIOEntryType* entry = mFileStats.PutEntry(processedName);
7777
if (entry) {
78-
FileStats& stats = entry->GetModifiableData()->mStats[mCurStage];
78+
FileStats& stats = entry->mData.mStats[mCurStage];
7979
// Update the statistics
8080
stats.totalTime += (double)aOb.Duration().ToMilliseconds();
8181
switch (aOb.ObservedOperation()) {
@@ -105,7 +105,7 @@ bool TelemetryIOInterposeObserver::ReflectFileStats(FileIOEntryType* entry,
105105
JS::Handle<JSObject*> obj) {
106106
JS::AutoValueArray<NUM_STAGES> stages(cx);
107107

108-
FileStatsByStage& statsByStage = *entry->GetModifiableData();
108+
FileStatsByStage& statsByStage = entry->mData;
109109
for (int s = STAGE_STARTUP; s < NUM_STAGES; ++s) {
110110
FileStats& fileStats = statsByStage.mStats[s];
111111

toolkit/components/telemetry/other/WebrtcTelemetry.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ void WebrtcTelemetry::RecordIceCandidateMask(const uint32_t iceCandidateBitmask,
2020
}
2121

2222
if (success) {
23-
entry->GetModifiableData()->webrtc.successCount++;
23+
entry->mData.webrtc.successCount++;
2424
} else {
25-
entry->GetModifiableData()->webrtc.failureCount++;
25+
entry->mData.webrtc.failureCount++;
2626
}
2727
}
2828

@@ -55,7 +55,7 @@ bool ReflectIceEntry(const WebrtcTelemetry::WebrtcIceCandidateType* entry,
5555

5656
bool ReflectIceWebrtc(WebrtcTelemetry::WebrtcIceCandidateType* entry,
5757
JSContext* cx, JS::Handle<JSObject*> obj) {
58-
return ReflectIceEntry(entry, &entry->GetData().webrtc, cx, obj);
58+
return ReflectIceEntry(entry, &entry->mData.webrtc, cx, obj);
5959
}
6060

6161
bool WebrtcTelemetry::AddIceInfo(JSContext* cx, JS::Handle<JSObject*> iceObj) {

xpcom/ds/PLDHashTable.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -729,36 +729,6 @@ PLDHashTable::Iterator::Iterator(PLDHashTable* aTable)
729729
}
730730
}
731731

732-
PLDHashTable::Iterator::Iterator(PLDHashTable* aTable, EndIteratorTag aTag)
733-
: mTable(aTable),
734-
mCurrent(mTable->mEntryStore.SlotForIndex(0, mTable->mEntrySize,
735-
mTable->Capacity())),
736-
mNexts(mTable->EntryCount()),
737-
mNextsLimit(mTable->EntryCount()),
738-
mHaveRemoved(false),
739-
mEntrySize(aTable->mEntrySize) {
740-
#ifdef DEBUG
741-
mTable->mChecker.StartReadOp();
742-
#endif
743-
744-
MOZ_ASSERT(Done());
745-
}
746-
747-
PLDHashTable::Iterator::Iterator(const Iterator& aOther)
748-
: mTable(aOther.mTable),
749-
mCurrent(aOther.mCurrent),
750-
mNexts(aOther.mNexts),
751-
mNextsLimit(aOther.mNextsLimit),
752-
mHaveRemoved(aOther.mHaveRemoved),
753-
mEntrySize(aOther.mEntrySize) {
754-
// TODO: Is this necessary?
755-
MOZ_ASSERT(!mHaveRemoved);
756-
757-
#ifdef DEBUG
758-
mTable->mChecker.StartReadOp();
759-
#endif
760-
}
761-
762732
PLDHashTable::Iterator::~Iterator() {
763733
if (mTable) {
764734
if (mHaveRemoved) {

xpcom/ds/PLDHashTable.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,6 @@ class PLDHashTable {
571571
class Iterator {
572572
public:
573573
explicit Iterator(PLDHashTable* aTable);
574-
struct EndIteratorTag {};
575-
Iterator(PLDHashTable* aTable, EndIteratorTag aTag);
576574
Iterator(Iterator&& aOther);
577575
~Iterator();
578576

@@ -593,13 +591,6 @@ class PLDHashTable {
593591
// must not be called on that entry afterwards.
594592
void Remove();
595593

596-
bool operator==(const Iterator& aOther) const {
597-
MOZ_ASSERT(mTable == aOther.mTable);
598-
return mNexts == aOther.mNexts;
599-
}
600-
601-
Iterator Clone() const { return {*this}; }
602-
603594
protected:
604595
PLDHashTable* mTable; // Main table pointer.
605596

@@ -616,7 +607,7 @@ class PLDHashTable {
616607
void MoveToNextLiveEntry();
617608

618609
Iterator() = delete;
619-
Iterator(const Iterator&);
610+
Iterator(const Iterator&) = delete;
620611
Iterator& operator=(const Iterator&) = delete;
621612
Iterator& operator=(const Iterator&&) = delete;
622613
};

xpcom/ds/nsBaseHashtable.h

Lines changed: 1 addition & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,10 @@ class nsBaseHashtable; // forward declaration
2323
template <class KeyClass, class DataType>
2424
class nsBaseHashtableET : public KeyClass {
2525
public:
26-
const DataType& GetData() const { return mData; }
27-
DataType* GetModifiableData() { return &mData; }
28-
template <typename U>
29-
void SetData(U&& aData) {
30-
mData = std::forward<U>(aData);
31-
}
32-
33-
private:
3426
DataType mData;
3527
friend class nsTHashtable<nsBaseHashtableET<KeyClass, DataType>>;
36-
template <typename KeyClassX, typename DataTypeX, typename UserDataTypeX>
37-
friend class nsBaseHashtable;
3828

29+
private:
3930
typedef typename KeyClass::KeyType KeyType;
4031
typedef typename KeyClass::KeyTypePointer KeyTypePointer;
4132

@@ -396,91 +387,6 @@ class nsBaseHashtable
396387
return Iterator(const_cast<nsBaseHashtable*>(this));
397388
}
398389

399-
// STL-style iterators to allow the use in range-based for loops, e.g.
400-
template <typename T>
401-
class base_iterator
402-
: public std::iterator<std::forward_iterator_tag, T, int32_t> {
403-
public:
404-
using typename std::iterator<std::forward_iterator_tag, T,
405-
int32_t>::value_type;
406-
using typename std::iterator<std::forward_iterator_tag, T,
407-
int32_t>::difference_type;
408-
409-
using iterator_type = base_iterator;
410-
using const_iterator_type = base_iterator<const T>;
411-
412-
using EndIteratorTag = PLDHashTable::Iterator::EndIteratorTag;
413-
414-
base_iterator(base_iterator&& aOther) = default;
415-
416-
base_iterator& operator=(base_iterator&& aOther) {
417-
// User-defined because the move assignment operator is deleted in
418-
// PLDHashtable::Iterator.
419-
return operator=(static_cast<const base_iterator&>(aOther));
420-
}
421-
422-
base_iterator(const base_iterator& aOther)
423-
: mIterator{aOther.mIterator.Clone()} {}
424-
base_iterator& operator=(const base_iterator& aOther) {
425-
// Since PLDHashTable::Iterator has no assignment operator, we destroy and
426-
// recreate mIterator.
427-
mIterator.~Iterator();
428-
new (&mIterator) PLDHashTable::Iterator(aOther.mIterator.Clone());
429-
return *this;
430-
}
431-
432-
explicit base_iterator(PLDHashTable::Iterator aFrom)
433-
: mIterator{std::move(aFrom)} {}
434-
435-
explicit base_iterator(const nsBaseHashtable* aTable)
436-
: mIterator{&const_cast<nsBaseHashtable*>(aTable)->mTable} {}
437-
438-
base_iterator(const nsBaseHashtable* aTable, EndIteratorTag aTag)
439-
: mIterator{&const_cast<nsBaseHashtable*>(aTable)->mTable, aTag} {}
440-
441-
bool operator==(const iterator_type& aRhs) const {
442-
return mIterator == aRhs.mIterator;
443-
}
444-
bool operator!=(const iterator_type& aRhs) const {
445-
return !(*this == aRhs);
446-
}
447-
448-
value_type* operator->() const {
449-
return static_cast<value_type*>(mIterator.Get());
450-
}
451-
value_type& operator*() const {
452-
return *static_cast<value_type*>(mIterator.Get());
453-
}
454-
455-
iterator_type& operator++() {
456-
mIterator.Next();
457-
return *this;
458-
}
459-
iterator_type operator++(int) {
460-
iterator_type it = *this;
461-
++*this;
462-
return it;
463-
}
464-
465-
operator const_iterator_type() const {
466-
return const_iterator_type{mIterator.Clone()};
467-
}
468-
469-
private:
470-
PLDHashTable::Iterator mIterator;
471-
};
472-
using const_iterator = base_iterator<const EntryType>;
473-
using iterator = base_iterator<EntryType>;
474-
475-
iterator begin() { return iterator{this}; }
476-
const_iterator begin() const { return const_iterator{this}; }
477-
const_iterator cbegin() const { return begin(); }
478-
iterator end() { return iterator{this, typename iterator::EndIteratorTag{}}; }
479-
const_iterator end() const {
480-
return const_iterator{this, typename const_iterator::EndIteratorTag{}};
481-
}
482-
const_iterator cend() const { return end(); }
483-
484390
/**
485391
* reset the hashtable, removing all entries
486392
*/

xpcom/ds/nsClassHashtable.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ T* nsClassHashtable<KeyClass, T>::LookupOrAdd(KeyType aKey,
8080
auto count = this->Count();
8181
typename base_type::EntryType* ent = this->PutEntry(aKey);
8282
if (count != this->Count()) {
83-
ent->SetData(nsAutoPtr<T>(new T(std::forward<Args>(aConstructionArgs)...)));
83+
ent->mData = new T(std::forward<Args>(aConstructionArgs)...);
8484
}
85-
return ent->GetData();
85+
return ent->mData;
8686
}
8787

8888
template <class KeyClass, class T>
@@ -91,7 +91,7 @@ bool nsClassHashtable<KeyClass, T>::Get(KeyType aKey, T** aRetVal) const {
9191

9292
if (ent) {
9393
if (aRetVal) {
94-
*aRetVal = ent->GetData();
94+
*aRetVal = ent->mData;
9595
}
9696

9797
return true;
@@ -111,7 +111,7 @@ T* nsClassHashtable<KeyClass, T>::Get(KeyType aKey) const {
111111
return nullptr;
112112
}
113113

114-
return ent->GetData();
114+
return ent->mData;
115115
}
116116

117117
#endif // nsClassHashtable_h__

xpcom/ds/nsDataHashtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class nsDataHashtable : public nsBaseHashtable<KeyClass, DataType, DataType> {
4040
*/
4141
DataType* GetValue(KeyType aKey) {
4242
if (EntryType* ent = this->GetEntry(aKey)) {
43-
return ent->GetModifiableData();
43+
return &ent->mData;
4444
}
4545
return nullptr;
4646
}
@@ -56,7 +56,7 @@ class nsDataHashtable : public nsBaseHashtable<KeyClass, DataType, DataType> {
5656
mozilla::Maybe<DataType> GetAndRemove(KeyType aKey) {
5757
mozilla::Maybe<DataType> value;
5858
if (EntryType* ent = this->GetEntry(aKey)) {
59-
value.emplace(std::move(*ent->GetModifiableData()));
59+
value.emplace(std::move(ent->mData));
6060
this->RemoveEntry(ent);
6161
}
6262
return value;

xpcom/ds/nsInterfaceHashtable.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ bool nsInterfaceHashtable<KeyClass, Interface>::Get(
104104

105105
if (ent) {
106106
if (aInterface) {
107-
*aInterface = ent->GetData();
107+
*aInterface = ent->mData;
108108

109109
NS_IF_ADDREF(*aInterface);
110110
}
@@ -129,7 +129,7 @@ already_AddRefed<Interface> nsInterfaceHashtable<KeyClass, Interface>::Get(
129129
return nullptr;
130130
}
131131

132-
nsCOMPtr<Interface> copy = ent->GetData();
132+
nsCOMPtr<Interface> copy = ent->mData;
133133
return copy.forget();
134134
}
135135

@@ -143,7 +143,7 @@ Interface* nsInterfaceHashtable<KeyClass, Interface>::GetWeak(
143143
*aFound = true;
144144
}
145145

146-
return ent->GetData();
146+
return ent->mData;
147147
}
148148

149149
// Key does not exist, return nullptr and set aFound to false
@@ -162,7 +162,7 @@ bool nsInterfaceHashtable<KeyClass, Interface>::Put(
162162
return false;
163163
}
164164

165-
ent->SetData(std::move(aValue));
165+
ent->mData = aValue;
166166
return true;
167167
}
168168

@@ -173,7 +173,7 @@ bool nsInterfaceHashtable<KeyClass, Interface>::Remove(KeyType aKey,
173173

174174
if (ent) {
175175
if (aData) {
176-
ent->GetModifiableData()->forget(aData);
176+
ent->mData.forget(aData);
177177
}
178178
this->RemoveEntry(ent);
179179
return true;

0 commit comments

Comments
 (0)