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

Issue 8693005: Remove potentially many static initializers. (Closed)

Created:
9 years ago by Nico
Modified:
9 years ago
Reviewers:
Ryan Sleevi
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, mihaip+watch_chromium.org
Visibility:
Public.

Description

Remove potentially many static initializers. |const char* kFoo| marks the memory pointed to by kFoo as constant, but the pointer itself can be changed - some function might do `kFoo = "me!";`. Because of that, every global that's initialized with `myglobal = kFoo;` needs a static initializer. Fix this by making the pointer const as well. BUG=94925 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=111559

Patch Set 1 #

Patch Set 2 : . #

Patch Set 3 : . #

Patch Set 4 : . #

Total comments: 4

Patch Set 5 : STREQ #

Patch Set 6 : no streq #

Unified diffs Side-by-side diffs Delta from patch set Stats (+553 lines, -548 lines) Patch
M chrome/common/extensions/extension_constants.h View 1 5 chunks +271 lines, -271 lines 0 comments Download
M chrome/common/extensions/extension_constants.cc View 1 2 4 chunks +269 lines, -269 lines 0 comments Download
M chrome/common/extensions/extension_l10n_util_unittest.cc View 1 2 3 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/extension_manifests_unittest.cc View 1 2 3 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/extension_unpacker_unittest.cc View 1 2 3 5 3 chunks +11 lines, -6 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Ryan Sleevi
LGTM. I suppose alternatively the "const char* const kFoo" approach would have worked, but I ...
9 years ago (2011-11-24 20:13:58 UTC) #1
Nico
Much nicer, thanks! Let's see if this compiles :-) http://codereview.chromium.org/8693005/diff/5001/chrome/common/extensions/extension_unpacker_unittest.cc File chrome/common/extensions/extension_unpacker_unittest.cc (right): http://codereview.chromium.org/8693005/diff/5001/chrome/common/extensions/extension_unpacker_unittest.cc#newcode51 chrome/common/extensions/extension_unpacker_unittest.cc:51: ...
9 years ago (2011-11-24 20:18:11 UTC) #2
Nico
As discussed on IRC, CmpHelperSTREQ() doesn't have a char*, string override. So back to patch ...
9 years ago (2011-11-24 20:31:59 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/thakis@chromium.org/8693005/3003
9 years ago (2011-11-24 20:32:14 UTC) #4
commit-bot: I haz the power
9 years ago (2011-11-24 21:37:03 UTC) #5
Change committed as 111559

Powered by Google App Engine
This is Rietveld 408576698