New issue
Advanced search Search tips

Issue 909894 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 1
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 910689



Sign in to add a comment

refactor cache_storage UMA macros to reduce code bloat

Project Member Reported by wanderview@chromium.org, Nov 28

Issue description

The UMA macros in cache_storage cause a large amount of code bloat at the moment.  We could reduce this by wrapping the macro in a top level function so that the bloat is not duplicated at every call site.  This will require a small additional amount of code to select the correct UMA_HISTOGRAM_* macro.
 
Not sure I understand the context, but you might want to use the functions in histogram_functions.h instead of the macros.

Note that the macros cache their result, so the string passed to the macro has to be constant.
Thanks!  That's exactly what I need.
Blocking: 910689
Project Member

Comment 4 by bugdroid1@chromium.org, Dec 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/90b52ca347662faa95b0a273952f480575e1840a

commit 90b52ca347662faa95b0a273952f480575e1840a
Author: Ben Kelly <wanderview@chromium.org>
Date: Sat Dec 01 00:09:58 2018

CacheStorage: Refactor scheduler UMA recording to reduce code size.

Previously CacheStorage used some very large macros to record a number
of scheduler related histograms.  These macros produce a lot of code
bloat and are difficult to read.  This CL addresses those issues by
replacing the macros with functions.

Bug:  909894 
Change-Id: Icc3adc91d72de2aeaac0f927c13f3e2bfb557e77
Reviewed-on: https://chromium-review.googlesource.com/c/1357400
Commit-Queue: Ben Kelly <wanderview@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612864}
[modify] https://crrev.com/90b52ca347662faa95b0a273952f480575e1840a/content/browser/cache_storage/cache_storage_histogram_utils.cc
[modify] https://crrev.com/90b52ca347662faa95b0a273952f480575e1840a/content/browser/cache_storage/cache_storage_histogram_utils.h
[modify] https://crrev.com/90b52ca347662faa95b0a273952f480575e1840a/content/browser/cache_storage/cache_storage_operation.cc
[modify] https://crrev.com/90b52ca347662faa95b0a273952f480575e1840a/content/browser/cache_storage/cache_storage_operation.h
[modify] https://crrev.com/90b52ca347662faa95b0a273952f480575e1840a/content/browser/cache_storage/cache_storage_scheduler.cc

Status: Fixed (was: Assigned)

Sign in to add a comment