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

Issue 156443002: Provide defines as local variables in if-expressions. (Closed)

Created:
6 years, 10 months ago by newt (away)
Modified:
6 years, 10 months ago
Reviewers:
Nico, Jói
CC:
grit-developer_googlegroups.com
Visibility:
Public.

Description

Provide defines as local variables in if-expressions. If-expressions can now access the values of variables defined at the command line (using -D or -E). Undefined variables default to False. This enables many if-expressions to be simplified, e.g.: Before: <if expr="pp_ifdef('enable_foo')"> After: <if expr="enable_foo"> Before: <if expr="defs['foo'] == 'bar'"> After: <if expr="foo == 'bar'"> This also improves evaluation performance by caching compiled code objects, leading to a 3x evaluation speedup while processing generated_resources.grd (0.35 -> 0.12 sec on my machine). R=joi@chromium.org Committed: https://code.google.com/p/grit-i18n/source/detail?r=150

Patch Set 1 #

Total comments: 2

Patch Set 2 : fixed non-boolean expression #

Total comments: 1

Patch Set 3 : rebased past is_posix fix, fixed is_posix again and updated unittests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -74 lines) Patch
M grit/format/resource_map_unittest.py View 1 1 chunk +2 lines, -2 lines 0 comments Download
M grit/grd_reader_unittest.py View 2 chunks +2 lines, -10 lines 0 comments Download
M grit/node/base.py View 1 2 4 chunks +65 lines, -62 lines 0 comments Download
M grit/node/base_unittest.py View 1 2 1 chunk +61 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
newt (away)
joi: base.py and base_unittest.py thakis: grd_reader_unittest.py (I'm not 100% certain of the intent of testEarlyEnoughPlatformSpecification(), ...
6 years, 10 months ago (2014-02-06 04:24:12 UTC) #1
Jói
LGTM with a question. https://codereview.chromium.org/156443002/diff/1/grit/grd_reader_unittest.py File grit/grd_reader_unittest.py (right): https://codereview.chromium.org/156443002/diff/1/grit/grd_reader_unittest.py#newcode307 grit/grd_reader_unittest.py:307: </grit>''' % sys.platform This test ...
6 years, 10 months ago (2014-02-07 10:53:06 UTC) #2
newt (away)
https://codereview.chromium.org/156443002/diff/1/grit/grd_reader_unittest.py File grit/grd_reader_unittest.py (right): https://codereview.chromium.org/156443002/diff/1/grit/grd_reader_unittest.py#newcode307 grit/grd_reader_unittest.py:307: </grit>''' % sys.platform On 2014/02/07 10:53:12, Jói wrote: > ...
6 years, 10 months ago (2014-02-07 17:24:45 UTC) #3
newt (away)
https://codereview.chromium.org/156443002/diff/50002/grit/format/resource_map_unittest.py File grit/format/resource_map_unittest.py (right): https://codereview.chromium.org/156443002/diff/50002/grit/format/resource_map_unittest.py#newcode112 grit/format/resource_map_unittest.py:112: <if expr="True"> This test was failing since I added ...
6 years, 10 months ago (2014-02-07 17:33:41 UTC) #4
newt (away)
6 years, 10 months ago (2014-02-07 21:01:17 UTC) #5
Message was sent while issue was closed.
Committed patchset #3 manually as r150 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698