Move logic for computing retained sizes into RetainedSizes::create