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

Side by Side Diff: core/frame/PRESUBMIT.py

Issue 540533002: Roll IDL to Dartium37 (r181268) (Closed) Base URL: https://dart.googlecode.com/svn/third_party/WebCore
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 | Annotate | Revision Log
« no previous file with comments | « core/frame/NavigatorOnLine.idl ('k') | core/frame/Screen.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 # found in the LICENSE file.
4
5 """Blink frame presubmit script
6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into gcl.
9 """
10
11
12 def _RunUseCounterChecks(input_api, output_api):
13 for f in input_api.AffectedFiles():
14 if f.LocalPath().endswith('UseCounter.cpp'):
15 useCounterCpp = f
16 break
17 else:
18 return []
19
20 largestFoundBucket = 0
21 maximumBucket = 0
22 # Looking for a line like "case CSSPropertyGrid: return 453;"
23 bucketFinder = input_api.re.compile(r'.*CSSProperty.*return\s*([0-9]+).*')
24 # Looking for a line like "static int maximumCSSSampleId() { return 452; }"
25 maximumFinder = input_api.re.compile(
26 r'static int maximumCSSSampleId\(\) { return ([0-9]+)')
27 for line in useCounterCpp.NewContents():
28 bucketMatch = bucketFinder.match(line)
29 if bucketMatch:
30 bucket = int(bucketMatch.group(1))
31 largestFoundBucket = max(largestFoundBucket, bucket)
32 else:
33 maximumMatch = maximumFinder.match(line)
34 if maximumMatch:
35 maximumBucket = int(maximumMatch.group(1))
36
37 if largestFoundBucket != maximumBucket:
38 if input_api.is_committing:
39 message_type = output_api.PresubmitError
40 else:
41 message_type = output_api.PresubmitPromptWarning
42
43 return [message_type(
44 'Largest found CSSProperty bucket Id (%d) does not match '
45 'maximumCSSSampleId (%d)' %
46 (largestFoundBucket, maximumBucket),
47 items=[useCounterCpp.LocalPath()])]
48
49 return []
50
51
52 def CheckChangeOnUpload(input_api, output_api):
53 return _RunUseCounterChecks(input_api, output_api)
54
55
56 def CheckChangeOnCommit(input_api, output_api):
57 return _RunUseCounterChecks(input_api, output_api)
OLDNEW
« no previous file with comments | « core/frame/NavigatorOnLine.idl ('k') | core/frame/Screen.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698