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

Side by Side Diff: chrome/browser/PRESUBMIT.py

Issue 2264983002: MD History: Lazily load element files which are not needed for first paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor tweaks and rebase Created 4 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 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Presubmit script for Chromium browser code. 5 """Presubmit script for Chromium browser code.
6 6
7 This script currently checks HTML/CSS/JS files in resources/ and ui/webui/. 7 This script currently checks HTML/CSS/JS files in resources/ and ui/webui/.
8 8
9 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 9 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
10 for more details about the presubmit API built into depot_tools, and see 10 for more details about the presubmit API built into depot_tools, and see
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 try: 49 try:
50 sys.path = [cwd] + old_path 50 sys.path = [cwd] + old_path
51 from web_dev_style import (resource_checker, css_checker, html_checker, 51 from web_dev_style import (resource_checker, css_checker, html_checker,
52 js_checker) 52 js_checker)
53 53
54 search_dirs = (resources, webui) 54 search_dirs = (resources, webui)
55 def _html_css_js_resource(p): 55 def _html_css_js_resource(p):
56 return p.endswith(('.html', '.css', '.js')) and p.startswith(search_dirs) 56 return p.endswith(('.html', '.css', '.js')) and p.startswith(search_dirs)
57 57
58 BLACKLIST = ['chrome/browser/resources/md_downloads/crisper.js', 58 BLACKLIST = [
59 'chrome/browser/resources/md_downloads/vulcanized.html', 59 'chrome/browser/resources/md_downloads/crisper.js',
60 'chrome/browser/resources/md_history/app.crisper.js', 60 'chrome/browser/resources/md_downloads/vulcanized.html',
61 'chrome/browser/resources/md_history/app.vulcanized.html', 61 'chrome/browser/resources/md_history/app.crisper.js',
62 'chrome/browser/resources/pdf/index.html', 62 'chrome/browser/resources/md_history/app.vulcanized.html',
63 'chrome/browser/resources/pdf/index.js'] 63 'chrome/browser/resources/md_history/lazy_load.crisper.js',
64 'chrome/browser/resources/md_history/lazy_load.vulcanized.html',
65 'chrome/browser/resources/pdf/index.html',
66 'chrome/browser/resources/pdf/index.js'
67 ]
64 def is_resource(maybe_resource): 68 def is_resource(maybe_resource):
65 return (maybe_resource.LocalPath() not in BLACKLIST and 69 return (maybe_resource.LocalPath() not in BLACKLIST and
calamity 2016/09/22 04:00:09 May just want to filter all *.vulcanized.html and
tsergeant 2016/09/22 04:27:57 Done.
66 _html_css_js_resource(maybe_resource.AbsoluteLocalPath())) 70 _html_css_js_resource(maybe_resource.AbsoluteLocalPath()))
67 71
68 results.extend(resource_checker.ResourceChecker( 72 results.extend(resource_checker.ResourceChecker(
69 input_api, output_api, file_filter=is_resource).RunChecks()) 73 input_api, output_api, file_filter=is_resource).RunChecks())
70 results.extend(css_checker.CSSChecker( 74 results.extend(css_checker.CSSChecker(
71 input_api, output_api, file_filter=is_resource).RunChecks()) 75 input_api, output_api, file_filter=is_resource).RunChecks())
72 results.extend(html_checker.HtmlChecker( 76 results.extend(html_checker.HtmlChecker(
73 input_api, output_api, file_filter=is_resource).RunChecks()) 77 input_api, output_api, file_filter=is_resource).RunChecks())
74 results.extend(js_checker.JSChecker( 78 results.extend(js_checker.JSChecker(
75 input_api, output_api, file_filter=is_resource).RunChecks()) 79 input_api, output_api, file_filter=is_resource).RunChecks())
76 finally: 80 finally:
77 sys.path = old_path 81 sys.path = old_path
78 82
79 return results 83 return results
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browser_resources.grd » ('j') | chrome/browser/resources/md_history/lazy_load.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698