forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland of Deduplicate Monochrome locale .paks
Instead of using system webview's resource whitelist, now uses a generated list of resource IDs that are actually packed into Webview's locale paks. This fixes the missing strings issue. Original issue: https://codereview.chromium.org/2980773002/ TBR=agrieve@chromium.org,dpranke@chromium.org,thestig@chromium.org,sadrul@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=724110, 742388 Review-Url: https://codereview.chromium.org/2977993002 Cr-Commit-Position: refs/heads/master@{#487176}
- Loading branch information
zpeng
authored and
Commit Bot
committed
Jul 17, 2017
1 parent
7d1476b
commit 368afac
Showing
13 changed files
with
307 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
per-file generate_resource_whitelist.*=agrieve@chromium.org | ||
per-file generate_resource_whitelist.*=estevenson@chromium.org | ||
per-file filter_resource_whitelist.*=agrieve@chromium.org | ||
per-file filter_resource_whitelist.*=zpeng@chromium.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env python | ||
# Copyright 2017 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
"""filter_resource_whitelist.py [-h] [--input INPUT] [--filter FILTER] | ||
[--output OUTPUT] | ||
INPUT specifies a resource whitelist file containing resource IDs that should | ||
be whitelisted, where each line of INPUT contains a single resource ID. | ||
FILTER specifies a resource whitelist file containing resource IDs that should | ||
not be whitelisted, where each line of FILTER contains a single resource ID. | ||
Filters a resource whitelist by removing resource IDs that are contained in a | ||
another resource whitelist. | ||
This script is used to generate Monochrome's locale paks. | ||
""" | ||
|
||
import argparse | ||
import sys | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(usage=__doc__) | ||
parser.add_argument( | ||
'--input', type=argparse.FileType('r'), required=True, | ||
help='A resource whitelist where each line contains one resource ID. ' | ||
'These IDs, excluding the ones in FILTER, are to be included.') | ||
parser.add_argument( | ||
'--filter', type=argparse.FileType('r'), required=True, | ||
help='A resource whitelist where each line contains one resource ID. ' | ||
'These IDs are to be excluded.') | ||
parser.add_argument( | ||
'--output', type=argparse.FileType('w'), default=sys.stdout, | ||
help='The resource list path to write (default stdout)') | ||
|
||
args = parser.parse_args() | ||
|
||
input_resources = list(int(resource_id) for resource_id in args.input) | ||
filter_resources = set(int(resource_id) for resource_id in args.filter) | ||
output_resources = [resource_id for resource_id in input_resources | ||
if resource_id not in filter_resources] | ||
|
||
for resource_id in sorted(output_resources): | ||
args.output.write('%d\n' % resource_id) | ||
|
||
if __name__ == '__main__': | ||
main() |
Oops, something went wrong.