Modified: trunk/Source/WebCore/ChangeLog (234685 => 234686)
--- trunk/Source/WebCore/ChangeLog 2018-08-08 02:39:12 UTC (rev 234685)
+++ trunk/Source/WebCore/ChangeLog 2018-08-08 04:41:29 UTC (rev 234686)
@@ -1,3 +1,18 @@
+2018-08-07 Saam Barati <[email protected]>
+
+ ResourceUsageOverlay should use physical footprint for its "Footprint" label
+ https://bugs.webkit.org/show_bug.cgi?id=188395
+
+ Reviewed by Simon Fraser.
+
+ Let's use physical footprint on Cocoa for the number we say is "footprint".
+ Before, we were just using the number of dirty pages multiplies by
+ page size. This number was an upper bound on footprint since it
+ doesn't take into account compressed memory.
+
+ * page/cocoa/ResourceUsageOverlayCocoa.mm:
+ (WebCore::ResourceUsageOverlay::platformDraw):
+
2018-08-05 Darin Adler <[email protected]>
[Cocoa] More tweaks and refactoring to prepare for ARC
Modified: trunk/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm (234685 => 234686)
--- trunk/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm 2018-08-08 02:39:12 UTC (rev 234685)
+++ trunk/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm 2018-08-08 04:41:29 UTC (rev 234686)
@@ -39,6 +39,7 @@
#include <QuartzCore/CATransaction.h>
#include <wtf/MainThread.h>
#include <wtf/MathExtras.h>
+#include <wtf/MemoryFootprint.h>
#include <wtf/NeverDestroyed.h>
using WebCore::ResourceUsageOverlay;
@@ -457,7 +458,10 @@
static CGColorRef colorForLabels = createColor(0.9, 0.9, 0.9, 1);
showText(context, 10, 20, colorForLabels, String::format(" CPU: %g", data.cpu.last()));
- showText(context, 10, 30, colorForLabels, " Footprint: " + formatByteNumber(data.totalDirtySize.last()));
+ if (auto footprint = memoryFootprint())
+ showText(context, 10, 30, colorForLabels, " Footprint: " + formatByteNumber(*footprint));
+ else
+ showText(context, 10, 30, colorForLabels, " Footprint: " + formatByteNumber(data.totalDirtySize.last()));
showText(context, 10, 40, colorForLabels, " External: " + formatByteNumber(data.totalExternalSize.last()));
float y = 55;