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

Side by Side Diff: appengine/findit/model/crash/fracas_crash_analysis.py

Issue 2322133002: [Findit] Add cracas_crash_analysis (Closed)
Patch Set: Rebase. Created 4 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
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import hashlib
6 import json
7
8 from google.appengine.ext import ndb 5 from google.appengine.ext import ndb
9 6
10 from model.crash.crash_analysis import CrashAnalysis 7 from model.crash.chrome_crash_analysis import ChromeCrashAnalysis
11 8
12 9
13 class FracasCrashAnalysis(CrashAnalysis): 10 class FracasCrashAnalysis(ChromeCrashAnalysis):
14 """Represents an analysis of a Chrome crash.""" 11 """Represents an analysis of a Chrome crash on Fracas."""
15 # Customized properties for Fracas crash. 12 pass
16 historical_metadata = ndb.JsonProperty(indexed=False)
17 channel = ndb.StringProperty(indexed=False)
18
19 def Reset(self):
20 super(FracasCrashAnalysis, self).Reset()
21 self.historical_metadata = None
22 self.channel = None
23
24 @staticmethod
25 def _CreateKey(crash_identifiers):
26 return ndb.Key('FracasCrashAnalysis', hashlib.sha1(
27 json.dumps(crash_identifiers, sort_keys=True)).hexdigest())
28
29 @classmethod
30 def Get(cls, crash_identifiers):
31 return cls._CreateKey(crash_identifiers).get()
32
33 @classmethod
34 def Create(cls, crash_identifiers):
35 analysis = cls(key=cls._CreateKey(crash_identifiers))
36 return analysis
OLDNEW
« no previous file with comments | « appengine/findit/model/crash/crash_analysis.py ('k') | appengine/findit/model/crash/test/chrome_crash_analysis_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698