OLD | NEW |
| (Empty) |
1 // Copyright 2008-2009 Google Inc. | |
2 // | |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 // you may not use this file except in compliance with the License. | |
5 // You may obtain a copy of the License at | |
6 // | |
7 // http://www.apache.org/licenses/LICENSE-2.0 | |
8 // | |
9 // Unless required by applicable law or agreed to in writing, software | |
10 // distributed under the License is distributed on an "AS IS" BASIS, | |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 // See the License for the specific language governing permissions and | |
13 // limitations under the License. | |
14 // ======================================================================== | |
15 | |
16 #ifndef OMAHA_COMMON_PING_EVENT_H_ | |
17 #define OMAHA_COMMON_PING_EVENT_H_ | |
18 | |
19 #include <atlstr.h> | |
20 #include <vector> | |
21 #include "base/basictypes.h" | |
22 #include "omaha/base/debug.h" | |
23 #include "third_party/bar/shared_ptr.h" | |
24 | |
25 namespace omaha { | |
26 | |
27 class PingEvent { | |
28 public: | |
29 // The extra code represents the file order as defined by the setup. | |
30 static const int kSetupFilesExtraCodeMask = 0x00000100; | |
31 | |
32 // The extra code represents a state of the app state machine. | |
33 static const int kAppStateExtraCodeMask = 0x10000000; | |
34 | |
35 // When updating this enum, also update the protocol file on the server. | |
36 // These values get reported to the server, so do not change existing ones. | |
37 // | |
38 // Checkpoints: | |
39 // "EVENT_INSTALL_*" events report the progress of initial installs. | |
40 // "EVENT_UPDATE_*" events report the progress of silent updates. | |
41 // These checkpoints represent the "START" or "FINISH" of a phase. | |
42 // Actions: | |
43 // "EVENT_*_BEGIN" events report the start of a specific action (i.e. job). | |
44 // "EVENT_*_COMPLETE" events represent the end of such actions and report | |
45 // successful completion or the error that occurred during the action. | |
46 enum Types { | |
47 EVENT_UNKNOWN = 0, | |
48 EVENT_INSTALL_DOWNLOAD_FINISH = 1, | |
49 EVENT_INSTALL_COMPLETE = 2, | |
50 EVENT_UPDATE_COMPLETE = 3, | |
51 EVENT_UNINSTALL = 4, | |
52 EVENT_INSTALL_DOWNLOAD_START = 5, | |
53 EVENT_INSTALL_INSTALLER_START = 6, | |
54 // Never used = 7 | |
55 // No longer used - EVENT_INSTALLED_GOOPDATE_STARTED = 8, | |
56 EVENT_INSTALL_APPLICATION_BEGIN = 9, | |
57 | |
58 // Install Setup events. | |
59 // No longer used - EVENT_SETUP_INSTALL_BEGIN = 10, | |
60 // No longer used - EVENT_SETUP_INSTALL_COMPLETE = 11, | |
61 | |
62 // Update Events. | |
63 // The Update Event = 3 above is used for update completion. | |
64 EVENT_UPDATE_APPLICATION_BEGIN = 12, | |
65 EVENT_UPDATE_DOWNLOAD_START = 13, | |
66 EVENT_UPDATE_DOWNLOAD_FINISH = 14, | |
67 EVENT_UPDATE_INSTALLER_START = 15, | |
68 | |
69 // Self-update Setup events. | |
70 // No longer used - EVENT_SETUP_UPDATE_BEGIN = 16, | |
71 // No longer used - EVENT_SETUP_UPDATE_COMPLETE = 17, | |
72 | |
73 // Ping when installed via /registerproduct. | |
74 EVENT_REGISTER_PRODUCT_COMPLETE = 20, | |
75 | |
76 // Ping when an end user first boots a new system with an OEM-installed app. | |
77 EVENT_INSTALL_OEM_FIRST_CHECK = 30, | |
78 | |
79 // App Command Events | |
80 EVENT_APP_COMMAND_BEGIN = 40, | |
81 EVENT_APP_COMMAND_COMPLETE = 41, | |
82 | |
83 // Failure report events - not part of the normal flow. | |
84 // No longer used - EVENT_SETUP_INSTALL_FAILURE = 100, | |
85 // No longer used - EVENT_GOOPDATE_DLL_FAILURE = 101, | |
86 // No longer used - EVENT_SETUP_COM_SERVER_FAILURE = 102, | |
87 // No longer used - EVENT_SETUP_UPDATE_FAILURE = 103, | |
88 }; | |
89 | |
90 // When updating this enum, also update the identical one in | |
91 // omaha_extensions.proto. | |
92 // These values get reported to the server, so do not change existing ones. | |
93 enum Results { | |
94 EVENT_RESULT_ERROR = 0, | |
95 EVENT_RESULT_SUCCESS = 1, | |
96 EVENT_RESULT_SUCCESS_REBOOT = 2, | |
97 // EVENT_RESULT_SUCCESS_RESTART_BROWSER = 3, | |
98 EVENT_RESULT_CANCELLED = 4, | |
99 EVENT_RESULT_INSTALLER_ERROR_MSI = 5, | |
100 EVENT_RESULT_INSTALLER_ERROR_OTHER = 6, | |
101 // EVENT_RESULT_NOUPDATE = 7, | |
102 EVENT_RESULT_INSTALLER_ERROR_SYSTEM = 8, | |
103 EVENT_RESULT_UPDATE_DEFERRED = 9, | |
104 EVENT_RESULT_HANDOFF_ERROR = 10, | |
105 }; | |
106 | |
107 PingEvent(Types type, | |
108 Results result, | |
109 int error_code, | |
110 int extra_code1) | |
111 : event_type_(type), | |
112 event_result_(result), | |
113 error_code_(error_code), | |
114 extra_code1_(extra_code1) { | |
115 ASSERT1(EVENT_UNKNOWN != event_type_); | |
116 } | |
117 virtual ~PingEvent() {} | |
118 | |
119 virtual HRESULT ToXml(IXMLDOMNode* parent_node) const; | |
120 virtual CString ToString() const; | |
121 | |
122 private: | |
123 const Types event_type_; | |
124 const Results event_result_; | |
125 const int error_code_; | |
126 const int extra_code1_; | |
127 }; | |
128 | |
129 typedef shared_ptr<const PingEvent> PingEventPtr; | |
130 typedef std::vector<PingEventPtr> PingEventVector; | |
131 | |
132 } // namespace omaha | |
133 | |
134 #endif // OMAHA_COMMON_PING_EVENT_H_ | |
135 | |
OLD | NEW |