| OLD | NEW |
| 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 from collections import namedtuple | 5 from collections import namedtuple |
| 6 from collections import OrderedDict | 6 from collections import OrderedDict |
| 7 | 7 |
| 8 from common import constants | 8 from common import constants |
| 9 from crash.type_enums import CallStackLanguageType | 9 from crash.type_enums import CallStackLanguageType |
| 10 from model.crash.crash_config import CrashConfig | 10 from model.crash.crash_config import CrashConfig |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 if class_name not in infos: | 84 if class_name not in infos: |
| 85 infos[class_name] = ClassOccurrenceInfo(class_name, [index]) | 85 infos[class_name] = ClassOccurrenceInfo(class_name, [index]) |
| 86 else: | 86 else: |
| 87 infos[class_name].occurrences.append(index) | 87 infos[class_name].occurrences.append(index) |
| 88 | 88 |
| 89 return infos.values() | 89 return infos.values() |
| 90 | 90 |
| 91 class_infos = _GetClassOccurrenceInfos() | 91 class_infos = _GetClassOccurrenceInfos() |
| 92 class_infos = sorted(class_infos, key=rank_function) | 92 class_infos = sorted(class_infos, key=rank_function) |
| 93 | 93 |
| 94 classes = [info.name for info in class_infos] | 94 # Filter all empty class. |
| 95 classes = [info.name for info in class_infos if info.name] |
| 95 | 96 |
| 96 return classes[:max_classes] | 97 return classes[:max_classes] |
| 97 | 98 |
| 98 def Classify(self, results, crash_stack): # pragma: no cover. | 99 def Classify(self, results, crash_stack): # pragma: no cover. |
| 99 raise NotImplementedError() | 100 raise NotImplementedError() |
| OLD | NEW |