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