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

Issue 669763002: Apply whitelist file to structure elements. (Closed)

Created:
6 years, 2 months ago by lliabraa
Modified:
6 years, 1 month ago
CC:
grit-developer_googlegroups.com, rohitrao (ping after 24h), stuartmorgan, aurimas (slooooooooow)
Base URL:
https://chromium.googlesource.com/external/grit-i18n.git@master
Visibility:
Public.

Description

Apply whitelist file to structure elements. Resources specified with structure elements were being included in .pak and .h files even if they were not included in a specified whitelist file. The .pak file issue is fixed in build.py by including structure nodes in the collection of node types that are checked against the whitelist. This seems to be an oversight as the code has a comment like "Apply the same trick that data_pack.py uses" but the corresponding code in data_pack.py was updated to include structure noded in [1]. This method that contained this code is no longer in data_pack.py. The .h file issue is fixed in rc_header.py by treating structure nodes in the same manner as message nodes (i.e. only output them if they're active). The correct fix seems to be to set output_all_resource_defines to true in all the .grd files, but until then a structure element should not generate an entry in a header file if it's not in the whitelist. https://chromiumcodereview.appspot.com/10386189/diff/29002/grit/format/data_pack.py BUG=None R=joaodasilva@chromium.org, newt@chromium.org Committed: https://code.google.com/p/grit-i18n/source/detail?r=179

Patch Set 1 #

Patch Set 2 : add unit test, remove rc_header change #

Patch Set 3 : remove last bits of diff in rc_header #

Patch Set 4 : remove debug print statement #

Total comments: 2

Patch Set 5 : fix indent #

Unified diffs Side-by-side diffs Delta from patch set Stats (+178 lines, -1 line) Patch
A grit/testdata/whitelist.txt View 1 1 chunk +4 lines, -0 lines 0 comments Download
A grit/testdata/whitelist_resources.grd View 1 2 3 4 1 chunk +54 lines, -0 lines 0 comments Download
A grit/testdata/whitelist_strings.grd View 1 1 chunk +23 lines, -0 lines 0 comments Download
M grit/tool/build.py View 1 1 chunk +3 lines, -1 line 0 comments Download
M grit/tool/build_unittest.py View 1 2 3 2 chunks +94 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (2 generated)
lliabraa
@joaodasilva - This is the first time I've touched grit, so not sure what unintended ...
6 years, 2 months ago (2014-10-20 18:53:54 UTC) #2
lliabraa
6 years, 2 months ago (2014-10-20 18:54:11 UTC) #3
Joao da Silva
I'm more familiar with the code in grit/format/policy_templates but this looks sane, so lgtm. I ...
6 years, 2 months ago (2014-10-21 09:48:33 UTC) #5
lliabraa
+stuartmorgan FYI
6 years, 2 months ago (2014-10-21 11:36:34 UTC) #6
newt (away)
lgtm, though I'm also only somewhat familiar with these files
6 years, 2 months ago (2014-10-21 15:43:27 UTC) #7
lliabraa
On 2014/10/21 15:43:27, newt wrote: > lgtm, though I'm also only somewhat familiar with these ...
6 years, 2 months ago (2014-10-22 14:10:59 UTC) #8
newt (away)
On 2014/10/22 14:10:59, lliabraa wrote: > On 2014/10/21 15:43:27, newt wrote: > > lgtm, though ...
6 years, 2 months ago (2014-10-22 16:38:03 UTC) #9
newt (away)
On 2014/10/22 16:38:03, newt wrote: > On 2014/10/22 14:10:59, lliabraa wrote: > > On 2014/10/21 ...
6 years, 2 months ago (2014-10-22 16:38:53 UTC) #10
newt (away)
Hmmm, Chrome for Android doesn't compile with this CL: ../../ui/native_theme/common_theme.cc:137:15: error: use of undeclared identifier ...
6 years, 2 months ago (2014-10-22 21:18:03 UTC) #11
lliabraa
On 2014/10/22 21:18:03, newt wrote: > Hmmm, Chrome for Android doesn't compile with this CL: ...
6 years, 2 months ago (2014-10-23 11:49:13 UTC) #12
newt (away)
On 2014/10/23 11:49:13, lliabraa wrote: > On 2014/10/22 21:18:03, newt wrote: > > Hmmm, Chrome ...
6 years, 1 month ago (2014-10-23 16:19:41 UTC) #13
newt (away)
cc: Aurimas, who worked on excluding unused resources on Android (using lots of <if> tags) ...
6 years, 1 month ago (2014-10-23 16:24:39 UTC) #14
newt (away)
On 2014/10/23 16:24:39, newt wrote: > cc: Aurimas, who worked on excluding unused resources on ...
6 years, 1 month ago (2014-10-24 01:21:13 UTC) #15
newt (away)
Side note: What's the motivation for this CL? Is it that the whitelist used on ...
6 years, 1 month ago (2014-10-24 01:24:42 UTC) #16
lliabraa
On 2014/10/24 01:24:42, newt wrote: > Side note: What's the motivation for this CL? Is ...
6 years, 1 month ago (2014-10-29 15:22:07 UTC) #17
newt (away)
On 2014/10/29 15:22:07, lliabraa wrote: > On 2014/10/24 01:24:42, newt wrote: > > Side note: ...
6 years, 1 month ago (2014-10-30 03:22:12 UTC) #18
newt (away)
I've uploaded a CL showing what fixes are needed to get Android to compile with ...
6 years, 1 month ago (2014-10-30 03:32:14 UTC) #19
lliabraa
I've removed the changes to header_rc so this CL should only affect what resources are ...
6 years, 1 month ago (2014-10-31 11:35:19 UTC) #20
newt (away)
lgtm Chrome for Android builds with this patch. https://chromiumcodereview.appspot.com/669763002/diff/60001/grit/testdata/whitelist_resources.grd File grit/testdata/whitelist_resources.grd (right): https://chromiumcodereview.appspot.com/669763002/diff/60001/grit/testdata/whitelist_resources.grd#newcode18 grit/testdata/whitelist_resources.grd:18: <release ...
6 years, 1 month ago (2014-10-31 15:58:16 UTC) #21
lliabraa
Thanks for you help on this. Can you land it for me? https://codereview.chromium.org/669763002/diff/60001/grit/testdata/whitelist_resources.grd File grit/testdata/whitelist_resources.grd ...
6 years, 1 month ago (2014-10-31 16:05:53 UTC) #22
newt (away)
6 years, 1 month ago (2014-10-31 16:24:55 UTC) #23
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as 179 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698