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

Side by Side Diff: appengine/findit/crash/crash_match.py

Issue 2704843002: [Predator] Add TouchCrashedDirectory feature. (Closed)
Patch Set: . Created 3 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
« no previous file with comments | « appengine/findit/crash/crash_data.py ('k') | appengine/findit/crash/crash_util.py » ('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 2017 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 from collections import namedtuple
6
7
8 # TODO(wrengr): it's not clear why the ``priority`` is stored at all,
9 # given that every use in this file discards it. ``Result.file_to_stack_infos``
10 # should just store pointers directly to the frames themselves rather
11 # than needing this intermediate object.
12 # TODO(http://crbug.com/644476): this class needs a better name.
13 class FrameInfo(namedtuple('FrameInfo', ['frame', 'priority'])):
14 """Represents a frame and information of the ``CallStack`` it belongs to."""
15
16 __slots__ = ()
17
18 def __str__(self): # pragma: no cover
19 return '%s(frame = %s, priority = %d)' % (
20 self.__class__.__name__, str(self.frame), self.priority)
21
22
23 class CrashMatch(namedtuple('CrashMatch',
24 ['crashed_group', 'touched_files', 'frame_infos'])):
25
26 """Represents a match between touched files with frames in stacktrace.
27
28 The ``touched_files`` and ``frame_infos`` are matched under the same
29 ``crashed_group``, for example, CrashedFile('file.cc') or
30 CrashedDirectory('dir/').
31 """
32 __slots__ = ()
33
34 def __str__(self): # pragma: no cover
35 return '%s(crashed_group = %s, touched_files = %s, frame_infos = %s)' % (
36 self.__class__.__name__,
37 self.crashed_group.value,
38 ', '.join([str(touched_file) for touched_file in self.touched_files]),
39 ', '.join([str(frame_info) for frame_info in self.frame_infos]))
OLDNEW
« no previous file with comments | « appengine/findit/crash/crash_data.py ('k') | appengine/findit/crash/crash_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698