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

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: tony review 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
« no previous file with comments | « chrome/browser/history/top_sites.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 151
152 void MetricsLog::WritePluginStabilityElements(PrefService* pref) { 152 void MetricsLog::WritePluginStabilityElements(PrefService* pref) {
153 // Now log plugin stability info. 153 // Now log plugin stability info.
154 const ListValue* plugin_stats_list = pref->GetList( 154 const ListValue* plugin_stats_list = pref->GetList(
155 prefs::kStabilityPluginStats); 155 prefs::kStabilityPluginStats);
156 if (plugin_stats_list) { 156 if (plugin_stats_list) {
157 OPEN_ELEMENT_FOR_SCOPE("plugins"); 157 OPEN_ELEMENT_FOR_SCOPE("plugins");
158 for (ListValue::const_iterator iter = plugin_stats_list->begin(); 158 for (ListValue::const_iterator iter = plugin_stats_list->begin();
159 iter != plugin_stats_list->end(); ++iter) { 159 iter != plugin_stats_list->end(); ++iter) {
160 if (!(*iter)->IsType(Value::TYPE_DICTIONARY)) { 160 if (!(*iter)->IsDictionary()) {
161 NOTREACHED(); 161 NOTREACHED();
162 continue; 162 continue;
163 } 163 }
164 DictionaryValue* plugin_dict = static_cast<DictionaryValue*>(*iter); 164 DictionaryValue* plugin_dict = static_cast<DictionaryValue*>(*iter);
165 165
166 std::string plugin_name; 166 std::string plugin_name;
167 plugin_dict->GetString(prefs::kStabilityPluginName, &plugin_name); 167 plugin_dict->GetString(prefs::kStabilityPluginName, &plugin_name);
168 168
169 OPEN_ELEMENT_FOR_SCOPE("pluginstability"); 169 OPEN_ELEMENT_FOR_SCOPE("pluginstability");
170 // Use "filename" instead of "name", otherwise we need to update the 170 // Use "filename" instead of "name", otherwise we need to update the
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 const std::string result_type(AutocompleteMatch::TypeToString(i->type)); 492 const std::string result_type(AutocompleteMatch::TypeToString(i->type));
493 if (!result_type.empty()) 493 if (!result_type.empty())
494 WriteAttribute("resulttype", result_type); 494 WriteAttribute("resulttype", result_type);
495 WriteIntAttribute("relevance", i->relevance); 495 WriteIntAttribute("relevance", i->relevance);
496 WriteIntAttribute("isstarred", i->starred ? 1 : 0); 496 WriteIntAttribute("isstarred", i->starred ? 1 : 0);
497 } 497 }
498 } 498 }
499 499
500 ++num_events_; 500 ++num_events_;
501 } 501 }
OLDNEW
« no previous file with comments | « chrome/browser/history/top_sites.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698