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

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

Issue 2607813002: [Predator] Make ``CallStackDetector`` return a namedtuple. (Closed)
Patch Set: Rebase and fix nit. Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: appengine/findit/crash/stacktrace.py
diff --git a/appengine/findit/crash/stacktrace.py b/appengine/findit/crash/stacktrace.py
index 7c2e95b6ee400d2d7ebaafc72d67a2bf2aa1e599..a6fe2e7890cd5c1215fa4f351a438c20e0ef50d4 100644
--- a/appengine/findit/crash/stacktrace.py
+++ b/appengine/findit/crash/stacktrace.py
@@ -275,6 +275,18 @@ class CallStackBuffer(object):
return CallStack(self.priority, tuple(self.frames),
self.format_type, self.language_type)
+ @staticmethod
+ def FromStartOfCallStack(start_of_callstack):
+ """Constructs a ``CallStackBuffer`` from a ``StartOfCallStack``."""
+ if not start_of_callstack:
+ return None
+
+ return CallStackBuffer(
+ priority=start_of_callstack.priority,
+ format_type=start_of_callstack.format_type,
+ language_type=start_of_callstack.language_type,
+ metadata=start_of_callstack.metadata)
+
# N.B., because ``list`` is mutable it isn't hashable, thus cannot be
# used as a key in a dict. Because we want to usecallstacks as keys (for
« no previous file with comments | « appengine/findit/crash/clusterfuzz_parser.py ('k') | appengine/findit/crash/test/callstack_detectors_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698