Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_EVENT_H_ | 5 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_EVENT_H_ |
| 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_EVENT_H_ | 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_EVENT_H_ |
| 7 | 7 |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 | 11 |
| 12 namespace performance_monitor { | 12 namespace performance_monitor { |
| 13 | 13 |
| 14 // IMPORTANT: To add new events, please | 14 // IMPORTANT: To add new events, please |
| 15 // - Place the new event above EVENT_NUMBER_OF_EVENTS. | 15 // - Place the new event above EVENT_NUMBER_OF_EVENTS. |
| 16 // - Add a member to the EventKeyChar enum in key_builder.cc. | 16 // - Add a member to the EventKeyChar enum in key_builder.cc. |
| 17 // - Add the appropriate messages in generated_resources.grd. | 17 // - Add the appropriate messages in generated_resources.grd. |
| 18 // - Add the appropriate functions in | 18 // - Add the appropriate functions in |
| 19 // chrome/browser/ui/webui/performance_monitor/performance_monitor_l10n.h. | 19 // chrome/browser/ui/webui/performance_monitor/performance_monitor_l10n.h. |
| 20 enum EventType { | 20 enum EventType { |
| 21 // Used only to indicate invalid events and to generate database keys. | |
|
Yoyo Zhou
2012/09/27 19:18:27
I don't think this is needed.
Devlin
2012/09/28 02:33:23
Done.
| |
| 21 EVENT_UNDEFINED, | 22 EVENT_UNDEFINED, |
| 23 | |
| 24 // Extension-Related events | |
| 22 EVENT_EXTENSION_INSTALL, | 25 EVENT_EXTENSION_INSTALL, |
| 23 EVENT_EXTENSION_UNINSTALL, | 26 EVENT_EXTENSION_UNINSTALL, |
| 24 EVENT_EXTENSION_UPDATE, | 27 EVENT_EXTENSION_UPDATE, |
| 25 EVENT_EXTENSION_ENABLE, | 28 EVENT_EXTENSION_ENABLE, |
| 26 EVENT_EXTENSION_DISABLE, | 29 EVENT_EXTENSION_DISABLE, |
| 30 | |
| 31 // Chrome's version has changed. | |
| 27 EVENT_CHROME_UPDATE, | 32 EVENT_CHROME_UPDATE, |
| 28 EVENT_RENDERER_FREEZE, | 33 |
| 34 // Renderer-Failure related events; these correspond to the RENDERER_HANG | |
| 35 // event, and the two termination statuses ABNORMAL_EXIT and PROCESS_KILLED, | |
| 36 // respectively. | |
| 37 EVENT_RENDERER_HANG, | |
| 29 EVENT_RENDERER_CRASH, | 38 EVENT_RENDERER_CRASH, |
| 30 EVENT_KILLED_BY_OS_CRASH, | 39 EVENT_RENDERER_KILLED, |
| 40 | |
| 41 // Chrome did not shut down correctly. | |
| 31 EVENT_UNCLEAN_EXIT, | 42 EVENT_UNCLEAN_EXIT, |
| 43 | |
| 44 // Used only to indicate the number of events (including the undefined type) | |
|
Yoyo Zhou
2012/09/27 19:18:27
I don't think you need this comment.
Devlin
2012/09/28 02:33:23
Done.
| |
| 45 // and to generate database keys. | |
| 32 EVENT_NUMBER_OF_EVENTS | 46 EVENT_NUMBER_OF_EVENTS |
| 33 }; | 47 }; |
| 34 | 48 |
| 35 const char* EventTypeToString(EventType event_type); | 49 const char* EventTypeToString(EventType event_type); |
| 36 | 50 |
| 37 // The wrapper class for the JSON-generated event classes for the performance | 51 // The wrapper class for the JSON-generated event classes for the performance |
| 38 // monitor. This class is used so we can pass around events in a single class, | 52 // monitor. This class is used so we can pass around events in a single class, |
| 39 // rather than having a variety of different types (since JSON does not | 53 // rather than having a variety of different types (since JSON does not |
| 40 // currently support inheritance). Since the class will occasionally need to | 54 // currently support inheritance). Since the class will occasionally need to |
| 41 // be compared against other events, we construct it with type and time. Other | 55 // be compared against other events, we construct it with type and time. Other |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 64 // The time at which the event was recorded. | 78 // The time at which the event was recorded. |
| 65 base::Time time_; | 79 base::Time time_; |
| 66 // The full JSON-generated value representing the information of the event; | 80 // The full JSON-generated value representing the information of the event; |
| 67 // these data are described in chrome/browser/performance_monitor/events.json. | 81 // these data are described in chrome/browser/performance_monitor/events.json. |
| 68 scoped_ptr<base::DictionaryValue> data_; | 82 scoped_ptr<base::DictionaryValue> data_; |
| 69 }; | 83 }; |
| 70 | 84 |
| 71 } // namespace performance_monitor | 85 } // namespace performance_monitor |
| 72 | 86 |
| 73 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_EVENT_H_ | 87 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_EVENT_H_ |
| OLD | NEW |