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

Side by Side Diff: components/domain_reliability/bake_in_configs.py

Issue 571973002: Domain Reliability: Update/add configs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 6
7 """Takes the JSON files in components/domain_reliability/baked_in_configs and 7 """Takes the JSON files in components/domain_reliability/baked_in_configs and
8 encodes their contents as an array of C strings that gets compiled in to Chrome 8 encodes their contents as an array of C strings that gets compiled in to Chrome
9 and loaded at runtime.""" 9 and loaded at runtime."""
10 10
11 11
12 import json 12 import json
13 import os 13 import os
14 import sys 14 import sys
15 15
16 16
17 # A whitelist of domains that the script will accept when baking configs in to 17 # A whitelist of domains that the script will accept when baking configs in to
18 # Chrome, to ensure incorrect ones are not added accidentally. Subdomains of 18 # Chrome, to ensure incorrect ones are not added accidentally. Subdomains of
19 # whitelist entries are also allowed (e.g. maps.google.com, ssl.gstatic.com). 19 # whitelist entries are also allowed (e.g. maps.google.com, ssl.gstatic.com).
20 DOMAIN_WHITELIST = ('2mdn.net', 'admob.com', 'doubleclick.net', 'ggpht.com', 20 DOMAIN_WHITELIST = ('2mdn.net', 'admob.com', 'doubleclick.net', 'ggpht.com',
21 'google.com', 'googleadservices.com', 'googleapis.com', 21 'google.cn', 'google.co.uk', 'google.com', 'google.com.au',
22 'googlesyndication.com', 'googleusercontent.com', 22 'google.de', 'google.fr', 'google.it', 'google.jp',
23 'googlevideo.com', 'gstatic.com', 'gvt1.com', 'youtube.com') 23 'google.org', 'google.ru', 'googleadservices.com',
24 'googleapis.com', 'googlesyndication.com',
25 'googleusercontent.com', 'googlevideo.com', 'gstatic.com',
26 'gvt1.com', 'youtube.com', 'ytimg.com')
24 27
25 28
26 CC_HEADER = """// Copyright (C) 2014 The Chromium Authors. All rights reserved. 29 CC_HEADER = """// Copyright (C) 2014 The Chromium Authors. All rights reserved.
27 // Use of this source code is governed by a BSD-style license that can be 30 // Use of this source code is governed by a BSD-style license that can be
28 // found in the LICENSE file. 31 // found in the LICENSE file.
29 32
30 // AUTOGENERATED FILE. DO NOT EDIT. 33 // AUTOGENERATED FILE. DO NOT EDIT.
31 // 34 //
32 // (Update configs in components/domain_reliability/baked_in_configs and list 35 // (Update configs in components/domain_reliability/baked_in_configs and list
33 // configs in components/domain_reliability.gypi instead.) 36 // configs in components/domain_reliability.gypi instead.)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 return 1 108 return 1
106 109
107 with open(sys.argv[-1], 'wb') as f: 110 with open(sys.argv[-1], 'wb') as f:
108 f.write(cpp_code) 111 f.write(cpp_code)
109 112
110 return 0 113 return 0
111 114
112 115
113 if __name__ == '__main__': 116 if __name__ == '__main__':
114 sys.exit(main()) 117 sys.exit(main())
OLDNEW
« no previous file with comments | « components/domain_reliability.gypi ('k') | components/domain_reliability/baked_in_configs/accounts_google_com.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698