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

Side by Side Diff: tools/telemetry/third_party/webpagereplay/rules/rule.py

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2015 Google Inc. All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16
17 class Rule(object):
18 """An optional base class for rule implementations.
19
20 The rule_parser looks for the 'IsType' and 'ApplyRule' methods by name, so
21 rules are not strictly required to extend this class.
22 """
23
24 def IsType(self, rule_type_name):
25 """Returns True if the name matches this rule."""
26 raise NotImplementedError
27
28 def ApplyRule(self, return_value, request, response):
29 """Invokes this rule with the given args.
30
31 Args:
32 return_value: the prior rule's return_value (if any).
33 request: the httparchive ArchivedHttpRequest.
34 response: the httparchive ArchivedHttpResponse, which may be None.
35 Returns:
36 A (should_stop, return_value) tuple. Typically the request and response
37 are treated as immutable, so it's the caller's job to apply the
38 return_value (e.g., set response fields).
39 """
40 raise NotImplementedError
OLDNEW
« no previous file with comments | « tools/telemetry/third_party/webpagereplay/rules/log_url.py ('k') | tools/telemetry/third_party/webpagereplay/rules_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698