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 #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 30 matching lines...) Expand all Loading... | |
| 41 event.extension_name = name; | 41 event.extension_name = name; |
| 42 event.extension_url = url; | 42 event.extension_url = url; |
| 43 event.extension_location = location; | 43 event.extension_location = location; |
| 44 event.extension_version = version; | 44 event.extension_version = version; |
| 45 event.extension_description = description; | 45 event.extension_description = description; |
| 46 scoped_ptr<base::DictionaryValue> value = event.ToValue(); | 46 scoped_ptr<base::DictionaryValue> value = event.ToValue(); |
| 47 return scoped_ptr<Event>(new Event( | 47 return scoped_ptr<Event>(new Event( |
| 48 type, time, value.Pass())); | 48 type, time, value.Pass())); |
| 49 } | 49 } |
| 50 | 50 |
| 51 scoped_ptr<Event> CreateRendererFreezeEvent(const base::Time& time, | 51 scoped_ptr<Event> CreateRendererFailureEvent(const base::Time& time, |
| 52 const std::string& url) { | 52 const EventType& type, |
| 53 events::RendererFreeze event; | 53 const std::string& url) { |
| 54 event.event_type = EVENT_RENDERER_FREEZE; | 54 events::RendererFailure event; |
| 55 event.event_type = type; | |
| 55 event.time = static_cast<double>(time.ToInternalValue()); | 56 event.time = static_cast<double>(time.ToInternalValue()); |
| 56 event.url = url; | 57 event.url = url; |
| 57 scoped_ptr<base::DictionaryValue> value = event.ToValue(); | 58 LOG(WARNING) << "URL: " << url; |
|
Yoyo Zhou
2012/09/29 01:19:25
Won't this be spammy? Plus it's getting logged as
Devlin
2012/10/02 23:34:32
Whoops; that wasn't supposed to stay in....
| |
| 58 return scoped_ptr<Event>(new Event( | |
| 59 EVENT_RENDERER_FREEZE, time, value.Pass())); | |
| 60 } | |
| 61 | |
| 62 scoped_ptr<Event> CreateCrashEvent(const base::Time& time, | |
| 63 const EventType& type) { | |
| 64 events::RendererCrash event; | |
| 65 event.event_type = type; | |
| 66 event.time = static_cast<double>(time.ToInternalValue()); | |
| 67 scoped_ptr<base::DictionaryValue> value = event.ToValue(); | 59 scoped_ptr<base::DictionaryValue> value = event.ToValue(); |
| 68 return scoped_ptr<Event>(new Event(type, time, value.Pass())); | 60 return scoped_ptr<Event>(new Event(type, time, value.Pass())); |
| 69 } | 61 } |
| 70 | 62 |
| 71 scoped_ptr<Event> CreateUncleanExitEvent(const base::Time& time, | 63 scoped_ptr<Event> CreateUncleanExitEvent(const base::Time& time, |
| 72 const std::string& profile_name) { | 64 const std::string& profile_name) { |
| 73 events::UncleanExit event; | 65 events::UncleanExit event; |
| 74 event.event_type = EVENT_UNCLEAN_EXIT; | 66 event.event_type = EVENT_UNCLEAN_EXIT; |
| 75 event.time = static_cast<double>(time.ToInternalValue()); | 67 event.time = static_cast<double>(time.ToInternalValue()); |
| 76 event.profile_name = profile_name; | 68 event.profile_name = profile_name; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 87 event.time = static_cast<double>(time.ToInternalValue()); | 79 event.time = static_cast<double>(time.ToInternalValue()); |
| 88 event.previous_version = previous_version; | 80 event.previous_version = previous_version; |
| 89 event.current_version = current_version; | 81 event.current_version = current_version; |
| 90 scoped_ptr<base::DictionaryValue> value = event.ToValue(); | 82 scoped_ptr<base::DictionaryValue> value = event.ToValue(); |
| 91 return scoped_ptr<Event>(new Event( | 83 return scoped_ptr<Event>(new Event( |
| 92 EVENT_CHROME_UPDATE, time, value.Pass())); | 84 EVENT_CHROME_UPDATE, time, value.Pass())); |
| 93 } | 85 } |
| 94 | 86 |
| 95 } // namespace util | 87 } // namespace util |
| 96 } // namespace performance_monitor | 88 } // namespace performance_monitor |
| OLD | NEW |