Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29332665: Issue #3391 - Initialize themed drawing variables using DetachedInitializer

Created:
Dec. 14, 2015, 6:06 p.m. by Eric
Modified:
Dec. 14, 2015, 7:27 p.m.
Reviewers:
sergei, Oleksandr
CC:
Felix Dahlke
Visibility:
Public.

Description

Issue #3391 - Initialize themed drawing variables using DetachedInitializer Add static 'Initializer()' function to 'CPluginClass'. Also add static detached initializer member to control execution of that function. Spawn an initializer thread in the constructor. Add convenience method EnsureInitialized() which simply forwards to the detached initializer. Move declarations for themed drawing entry point variables into an anonymous namespace. Move their initialization into 'Initializer()'. Convert 's_hUxtheme' into a local variable, since we no longer need to rely on its value to guard against multiple execution. Similarly, remove now-unneeded synchronization around these initializations, since that facility is now provided by 'DetachedInitialization'. Call EnsureInitialized() before using themed drawing variables. This eliminates possible race conditions with using these variables before they have had a chance to initialize. Refactored the body of 'CloseTheme()' into that of its one calling function. ----- This review depends upon another one. https://codereview.adblockplus.org/29332660/

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -62 lines) Patch
M src/plugin/PluginClass.h View 4 chunks +6 lines, -3 lines 0 comments Download
M src/plugin/PluginClass.cpp View 7 chunks +61 lines, -59 lines 2 comments Download

Messages

Total messages: 2
Eric
This is the second in the series of detached initialization change sets. The ultimate goal ...
Dec. 14, 2015, 6:46 p.m. (2015-12-14 18:46:02 UTC) #1
Eric
Dec. 14, 2015, 7:27 p.m. (2015-12-14 19:27:28 UTC) #2
Oops. Sent initial mail before I added reviewers.

Please expand and read the first message. It's important, but isn't properly
part of the description.

Powered by Google App Engine
This is Rietveld