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 #include "chrome/browser/performance_monitor/performance_monitor_util.h" | 5 #include "chrome/browser/performance_monitor/performance_monitor_util.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 scoped_ptr<Event> CreateCrashEvent(const base::Time& time, | 188 scoped_ptr<Event> CreateCrashEvent(const base::Time& time, |
189 const EventType& type) { | 189 const EventType& type) { |
190 events::RendererCrash event; | 190 events::RendererCrash event; |
191 event.event_type = type; | 191 event.event_type = type; |
192 event.time = static_cast<double>(time.ToInternalValue()); | 192 event.time = static_cast<double>(time.ToInternalValue()); |
193 scoped_ptr<base::DictionaryValue> value = event.ToValue(); | 193 scoped_ptr<base::DictionaryValue> value = event.ToValue(); |
194 return scoped_ptr<Event>(new Event(type, time, value.Pass())); | 194 return scoped_ptr<Event>(new Event(type, time, value.Pass())); |
195 } | 195 } |
196 | 196 |
197 scoped_ptr<Event> CreateUncleanShutdownEvent(const base::Time& time) { | 197 scoped_ptr<Event> CreateUncleanExitEvent(const base::Time& time, |
198 events::UncleanShutdown event; | 198 const std::string& profile_name) { |
199 event.event_type = EVENT_UNCLEAN_SHUTDOWN; | 199 events::UncleanExit event; |
| 200 event.event_type = EVENT_UNCLEAN_EXIT; |
200 event.time = static_cast<double>(time.ToInternalValue()); | 201 event.time = static_cast<double>(time.ToInternalValue()); |
| 202 event.profile_name = profile_name; |
201 scoped_ptr<base::DictionaryValue> value = event.ToValue(); | 203 scoped_ptr<base::DictionaryValue> value = event.ToValue(); |
202 return scoped_ptr<Event>(new Event( | 204 return scoped_ptr<Event>(new Event( |
203 EVENT_UNCLEAN_SHUTDOWN, time, value.Pass())); | 205 EVENT_UNCLEAN_EXIT, time, value.Pass())); |
204 } | 206 } |
205 | 207 |
206 scoped_ptr<Event> CreateChromeUpdateEvent(const base::Time& time, | 208 scoped_ptr<Event> CreateChromeUpdateEvent(const base::Time& time, |
207 const std::string& previous_version, | 209 const std::string& previous_version, |
208 const std::string& current_version) { | 210 const std::string& current_version) { |
209 events::ChromeUpdate event; | 211 events::ChromeUpdate event; |
210 event.event_type = EVENT_CHROME_UPDATE; | 212 event.event_type = EVENT_CHROME_UPDATE; |
211 event.time = static_cast<double>(time.ToInternalValue()); | 213 event.time = static_cast<double>(time.ToInternalValue()); |
212 event.previous_version = previous_version; | 214 event.previous_version = previous_version; |
213 event.current_version = current_version; | 215 event.current_version = current_version; |
214 scoped_ptr<base::DictionaryValue> value = event.ToValue(); | 216 scoped_ptr<base::DictionaryValue> value = event.ToValue(); |
215 return scoped_ptr<Event>(new Event( | 217 return scoped_ptr<Event>(new Event( |
216 EVENT_CHROME_UPDATE, time, value.Pass())); | 218 EVENT_CHROME_UPDATE, time, value.Pass())); |
217 } | 219 } |
218 | 220 |
219 } // namespace util | 221 } // namespace util |
220 } // namespace performance_monitor | 222 } // namespace performance_monitor |
OLD | NEW |