Bug 1389335 - Only check APZTestDataEnabled when APZPaintLogHelper is created. r?botond
MozReview-Commit-ID: 50JCZSIcLIn
--- a/gfx/layers/apz/testutil/APZTestData.h
+++ b/gfx/layers/apz/testutil/APZTestData.h
@@ -81,17 +81,16 @@ private:
DataStore mPaints;
DataStore mRepaintRequests;
void LogTestDataImpl(DataStore& aDataStore,
SequenceNumber aSequenceNumber,
ViewID aScrollId,
const std::string& aKey,
const std::string& aValue) {
- MOZ_ASSERT(gfxPrefs::APZTestLoggingEnabled(), "don't call me");
auto bucketIterator = aDataStore.find(aSequenceNumber);
if (bucketIterator == aDataStore.end()) {
MOZ_ASSERT(false, "LogTestDataImpl called with nonexistent sequence number");
return;
}
Bucket& bucket = bucketIterator->second;
ScrollFrameData& scrollFrameData = bucket[aScrollId]; // create if doesn't exist
MOZ_ASSERT(scrollFrameData.find(aKey) == scrollFrameData.end()
@@ -100,18 +99,19 @@ private:
}
};
// A helper class for logging data for a paint.
class APZPaintLogHelper {
public:
APZPaintLogHelper(APZTestData* aTestData, SequenceNumber aPaintSequenceNumber)
: mTestData(aTestData),
- mPaintSequenceNumber(aPaintSequenceNumber)
- {}
+ mPaintSequenceNumber(aPaintSequenceNumber) {
+ MOZ_ASSERT(gfxPrefs::APZTestLoggingEnabled(), "don't call me");
+ }
template <typename Value>
void LogTestData(FrameMetrics::ViewID aScrollId,
const std::string& aKey,
const Value& aValue) const {
if (mTestData) { // avoid stringifying if mTestData == nullptr
LogTestData(aScrollId, aKey, ToString(aValue));
}