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

Issue 9477001: Allow callers of CommandLine::Init to know whether they were the first caller. (Closed)

Created:
8 years, 10 months ago by erikwright (departed)
Modified:
8 years, 10 months ago
Reviewers:
brettw
CC:
chromium-reviews, brettw-cc_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Allow callers of CommandLine::Init to know whether they were the first caller. If there are multiple callers to Init, only one should call Reset. The boolean return value tells the caller whether they are the one responsible for the destruction. As long as the lifetimes of clients are strictly nested (i.e., a client X who uses CommandLine after client Y has initialized it always ceases its use before client Y destroys it) this secures access to this singleton object. One client in particular is updated to follow this model. I will submit follow-up CLs for remaining clients (at least, those who currently do call Reset). This is motivated by a crash in the chrome_frame_net_tests. This test executable nests a TestSuite within the lifetime of a ContentMainRunner (i.e., the engine that is typically used to run Chrome). The content layer initializes CommandLine and Resets it, but the TestSuite also resets it, leading to a DCHECK. This is currently the last remaining issue keeping the chrome_frame_net_tests off the waterfall, and I am very eager to get them back there to reduce the likelihood of further issues being introduced. BUG=114369 TEST=A test has been modified to reflect this change. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=123763

Patch Set 1 #

Patch Set 2 : Comment clarification. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -9 lines) Patch
M base/command_line.h View 1 1 chunk +4 lines, -2 lines 0 comments Download
M base/command_line.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M base/command_line_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/test/test_suite.h View 1 chunk +2 lines, -0 lines 0 comments Download
M base/test/test_suite.cc View 2 chunks +6 lines, -4 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
erikwright (departed)
Hi Brett, This is a bit of a high priority as it is the last ...
8 years, 10 months ago (2012-02-27 15:03:55 UTC) #1
brettw
lgtm
8 years, 10 months ago (2012-02-27 16:58:40 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/erikwright@chromium.org/9477001/7
8 years, 10 months ago (2012-02-27 17:00:29 UTC) #3
commit-bot: I haz the power
8 years, 10 months ago (2012-02-27 18:38:15 UTC) #4
Change committed as 123763

Powered by Google App Engine
This is Rietveld 408576698