| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
| 6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
| 7 // | 7 // |
| 8 // OVERVIEW | 8 // OVERVIEW |
| 9 // | 9 // |
| 10 // A MetricsService instance is typically created at application startup. It | 10 // A MetricsService instance is typically created at application startup. It |
| (...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1584 ScheduleNextStateSave(); | 1584 ScheduleNextStateSave(); |
| 1585 } | 1585 } |
| 1586 | 1586 |
| 1587 void MetricsService::RecordPluginChanges(PrefService* pref) { | 1587 void MetricsService::RecordPluginChanges(PrefService* pref) { |
| 1588 ListPrefUpdate update(pref, prefs::kStabilityPluginStats); | 1588 ListPrefUpdate update(pref, prefs::kStabilityPluginStats); |
| 1589 ListValue* plugins = update.Get(); | 1589 ListValue* plugins = update.Get(); |
| 1590 DCHECK(plugins); | 1590 DCHECK(plugins); |
| 1591 | 1591 |
| 1592 for (ListValue::iterator value_iter = plugins->begin(); | 1592 for (ListValue::iterator value_iter = plugins->begin(); |
| 1593 value_iter != plugins->end(); ++value_iter) { | 1593 value_iter != plugins->end(); ++value_iter) { |
| 1594 if (!(*value_iter)->IsType(Value::TYPE_DICTIONARY)) { | 1594 if (!(*value_iter)->IsDictionary()) { |
| 1595 NOTREACHED(); | 1595 NOTREACHED(); |
| 1596 continue; | 1596 continue; |
| 1597 } | 1597 } |
| 1598 | 1598 |
| 1599 DictionaryValue* plugin_dict = static_cast<DictionaryValue*>(*value_iter); | 1599 DictionaryValue* plugin_dict = static_cast<DictionaryValue*>(*value_iter); |
| 1600 std::string plugin_name; | 1600 std::string plugin_name; |
| 1601 plugin_dict->GetString(prefs::kStabilityPluginName, &plugin_name); | 1601 plugin_dict->GetString(prefs::kStabilityPluginName, &plugin_name); |
| 1602 if (plugin_name.empty()) { | 1602 if (plugin_name.empty()) { |
| 1603 NOTREACHED(); | 1603 NOTREACHED(); |
| 1604 continue; | 1604 continue; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1693 thread_id = base::PlatformThread::CurrentId(); | 1693 thread_id = base::PlatformThread::CurrentId(); |
| 1694 return base::PlatformThread::CurrentId() == thread_id; | 1694 return base::PlatformThread::CurrentId() == thread_id; |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 #if defined(OS_CHROMEOS) | 1697 #if defined(OS_CHROMEOS) |
| 1698 void MetricsService::StartExternalMetrics() { | 1698 void MetricsService::StartExternalMetrics() { |
| 1699 external_metrics_ = new chromeos::ExternalMetrics; | 1699 external_metrics_ = new chromeos::ExternalMetrics; |
| 1700 external_metrics_->Start(); | 1700 external_metrics_->Start(); |
| 1701 } | 1701 } |
| 1702 #endif | 1702 #endif |
| OLD | NEW |