Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: chrome/browser/metrics/metrics_log.cc

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nat_policy.cc Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/metrics/metrics_log.h" 5 #include "chrome/browser/metrics/metrics_log.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 149
150 void MetricsLog::WritePluginStabilityElements(PrefService* pref) { 150 void MetricsLog::WritePluginStabilityElements(PrefService* pref) {
151 // Now log plugin stability info. 151 // Now log plugin stability info.
152 const ListValue* plugin_stats_list = pref->GetList( 152 const ListValue* plugin_stats_list = pref->GetList(
153 prefs::kStabilityPluginStats); 153 prefs::kStabilityPluginStats);
154 if (plugin_stats_list) { 154 if (plugin_stats_list) {
155 OPEN_ELEMENT_FOR_SCOPE("plugins"); 155 OPEN_ELEMENT_FOR_SCOPE("plugins");
156 for (ListValue::const_iterator iter = plugin_stats_list->begin(); 156 for (ListValue::const_iterator iter = plugin_stats_list->begin();
157 iter != plugin_stats_list->end(); ++iter) { 157 iter != plugin_stats_list->end(); ++iter) {
158 if (!(*iter)->IsType(Value::TYPE_DICTIONARY)) { 158 if (!(*iter)->IsDictionary()) {
159 NOTREACHED(); 159 NOTREACHED();
160 continue; 160 continue;
161 } 161 }
162 DictionaryValue* plugin_dict = static_cast<DictionaryValue*>(*iter); 162 DictionaryValue* plugin_dict = static_cast<DictionaryValue*>(*iter);
163 163
164 std::string plugin_name; 164 std::string plugin_name;
165 plugin_dict->GetString(prefs::kStabilityPluginName, &plugin_name); 165 plugin_dict->GetString(prefs::kStabilityPluginName, &plugin_name);
166 166
167 OPEN_ELEMENT_FOR_SCOPE("pluginstability"); 167 OPEN_ELEMENT_FOR_SCOPE("pluginstability");
168 // Use "filename" instead of "name", otherwise we need to update the 168 // Use "filename" instead of "name", otherwise we need to update the
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); 486 const std::string result_type(AutocompleteMatch::TypeToString(i->type));
487 if (!result_type.empty()) 487 if (!result_type.empty())
488 WriteAttribute("resulttype", result_type); 488 WriteAttribute("resulttype", result_type);
489 WriteIntAttribute("relevance", i->relevance); 489 WriteIntAttribute("relevance", i->relevance);
490 WriteIntAttribute("isstarred", i->starred ? 1 : 0); 490 WriteIntAttribute("isstarred", i->starred ? 1 : 0);
491 } 491 }
492 } 492 }
493 493
494 ++num_events_; 494 ++num_events_;
495 } 495 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698