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

Unified Diff: appengine/findit/crash/component_classifier.py

Issue 2588513002: [Predator] renamed "Result" to "Suspect" (Closed)
Patch Set: Removing redundant import Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/crash/changelist_classifier.py ('k') | appengine/findit/crash/culprit.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/crash/component_classifier.py
diff --git a/appengine/findit/crash/component_classifier.py b/appengine/findit/crash/component_classifier.py
index b9ab4e6ba9f20d40560f9e3a92b61714ed6ecb87..5e6c8287cdbf2260a2c4bad489a6c097d63f70f6 100644
--- a/appengine/findit/crash/component_classifier.py
+++ b/appengine/findit/crash/component_classifier.py
@@ -40,15 +40,15 @@ class ComponentClassifier(object):
return ''
- # TODO(wrengr): refactor this into a method on Result which returns
+ # TODO(wrengr): refactor this into a method on Suspect which returns
# the cannonical frame (and documents why it's the one we return).
- def GetClassFromResult(self, result):
- """Determine which component is responsible for this result.
+ def GetClassFromSuspect(self, suspect):
+ """Determine which component is responsible for this suspect.
- Note that Findit assumes files that the culprit result touched come from
+ Note that Findit assumes files that the culprit suspect touched come from
the same component.
"""
- if result.file_to_stack_infos:
+ if suspect.file_to_stack_infos:
# file_to_stack_infos is a dict mapping file_path to stack_infos,
# where stack_infos is a list of (frame, callstack_priority)
# pairs. So ``.values()`` returns a list of the stack_infos in an
@@ -56,27 +56,27 @@ class ComponentClassifier(object):
# the second ``[0]`` grabs the first pair from the list; and
# the third ``[0]`` grabs the ``frame`` from the pair.
# TODO(wrengr): why is that the right frame to look at?
- frame = result.file_to_stack_infos.values()[0][0][0]
+ frame = suspect.file_to_stack_infos.values()[0][0][0]
return self.GetClassFromStackFrame(frame)
return ''
# TODO(http://crbug.com/657177): return the Component objects
# themselves, rather than strings naming them.
- def Classify(self, results, crash_stack):
+ def Classify(self, suspects, crash_stack):
"""Classifies component of a crash.
Args:
- results (list of Result): Culprit results.
+ suspects (list of Suspect): Culprit suspects.
crash_stack (CallStack): The callstack that caused the crash.
Returns:
List of top 2 components.
"""
- # If ``results`` are available, we use the components from there since
+ # If ``suspects`` are available, we use the components from there since
# they're more reliable than the ones from the ``crash_stack``.
- if results:
- classes = map(self.GetClassFromResult, results[:self.top_n])
+ if suspects:
+ classes = map(self.GetClassFromSuspect, suspects[:self.top_n])
else:
classes = map(self.GetClassFromStackFrame,
crash_stack.frames[:self.top_n])
« no previous file with comments | « appengine/findit/crash/changelist_classifier.py ('k') | appengine/findit/crash/culprit.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698