Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Issue 800883004: XFA: merge patch from CL 831903002, m_sTimeMap fixes (Closed)

Created:
5 years, 11 months ago by brucedawson
Modified:
5 years, 11 months ago
Reviewers:
Tom Sepez, Bo Xu
CC:
pdfium-reviews_googlegroups.com, Bo Xu
Base URL:
https://pdfium.googlesource.com/pdfium.git@xfa
Target Ref:
refs/heads/xfa
Visibility:
Public.

Description

XFA: 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -4 lines) Patch
M fpdfsdk/include/javascript/JS_Object.h View 4 chunks +4 lines, -4 lines 2 comments Download
M fpdfsdk/src/javascript/JS_Object.cpp View 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
brucedawson
Committed patchset #1 (id:1) manually as b4649dc9c0f8f64c335d4ed61a82976f25e19a70 (presubmit successful).
5 years, 11 months ago (2015-01-05 21:26:21 UTC) #1
Bo Xu
https://codereview.chromium.org/800883004/diff/1/fpdfsdk/include/javascript/JS_Object.h File fpdfsdk/include/javascript/JS_Object.h (right): https://codereview.chromium.org/800883004/diff/1/fpdfsdk/include/javascript/JS_Object.h#newcode201 fpdfsdk/include/javascript/JS_Object.h:201: m_sTimeMap.RemoveAt(m_nTimerID); This one is not fixed?
5 years, 11 months ago (2015-01-05 22:05:39 UTC) #3
brucedawson
5 years, 11 months ago (2015-01-05 22:18:20 UTC) #4
Message was sent while issue was closed.
https://codereview.chromium.org/800883004/diff/1/fpdfsdk/include/javascript/J...
File fpdfsdk/include/javascript/JS_Object.h (right):

https://codereview.chromium.org/800883004/diff/1/fpdfsdk/include/javascript/J...
fpdfsdk/include/javascript/JS_Object.h:201: m_sTimeMap.RemoveAt(m_nTimerID);
Good catch. I guess I'm merging over without enough double-checking. Fixing.

Powered by Google App Engine
This is Rietveld 408576698