Chromium Code Reviews
DescriptionXFA: merge patch from CL 831903002, m_sTimeMap fixes
Get rid of fifteen copies of m_sTimeMap and their initializers.
m_sTimeMap is a global variable with a constructor and destructor, which
is not allowed. This change moves it to a function with a static pointer
so that it is constructed on demand and then leaked, thus avoiding
having startup and shutdown code.
This also fixes a worrisome bug caused by having m_sTimeMap defined in
a header file. Because m_sTimeMap was defined (and marked as static) in
a header file there were fifteen separate copies of it, one for each
source file which included the header file. This could easily lead to
bugs because a timer that was added from one source file would be
invisible to other source files.
Each instance of m_sTimeMap added four entries to the
dump-static-initializers.py report, for a total of sixty, so this fix
significantly cleans up that report.
BUG=441899
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/831903002
Committed: https://pdfium.googlesource.com/pdfium/+/b4649dc9c0f8f64c335d4ed61a82976f25e19a70
Patch Set 1 #
Total comments: 2
Messages
Total messages: 4 (1 generated)
|
||||||||||||||||||||||||||||