diff options
author | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 20:46:40 +0000 |
---|---|---|
committer | nsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 20:46:40 +0000 |
commit | 6470ee8f59dba5eecfce4a64d7ff3930ae716095 (patch) | |
tree | 86e020619f32c56f5796a0ea20975c71607ac91f /chrome/browser/metrics/metrics_log.cc | |
parent | 409993dec55a874e0659acf421a87070d450a262 (diff) | |
download | chromium_src-6470ee8f59dba5eecfce4a64d7ff3930ae716095.zip chromium_src-6470ee8f59dba5eecfce4a64d7ff3930ae716095.tar.gz chromium_src-6470ee8f59dba5eecfce4a64d7ff3930ae716095.tar.bz2 |
Revert dsh's change 10818
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10821 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/metrics/metrics_log.cc')
-rw-r--r-- | chrome/browser/metrics/metrics_log.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc index 57da551..a504b11 100644 --- a/chrome/browser/metrics/metrics_log.cc +++ b/chrome/browser/metrics/metrics_log.cc @@ -383,24 +383,24 @@ void MetricsLog::WritePluginStabilityElements(PrefService* pref) { } DictionaryValue* plugin_dict = static_cast<DictionaryValue*>(*iter); - string16 plugin_name; - plugin_dict->GetString(WideToUTF16Hack(prefs::kStabilityPluginName), &plugin_name); + std::wstring plugin_name; + plugin_dict->GetString(prefs::kStabilityPluginName, &plugin_name); OPEN_ELEMENT_FOR_SCOPE("pluginstability"); // Use "filename" instead of "name", otherwise we need to update the // UMA servers. - WriteAttribute("filename", CreateBase64Hash(UTF16ToUTF8(plugin_name))); + WriteAttribute("filename", CreateBase64Hash(WideToUTF8(plugin_name))); int launches = 0; - plugin_dict->GetInteger(WideToUTF16Hack(prefs::kStabilityPluginLaunches), &launches); + plugin_dict->GetInteger(prefs::kStabilityPluginLaunches, &launches); WriteIntAttribute("launchcount", launches); int instances = 0; - plugin_dict->GetInteger(WideToUTF16Hack(prefs::kStabilityPluginInstances), &instances); + plugin_dict->GetInteger(prefs::kStabilityPluginInstances, &instances); WriteIntAttribute("instancecount", instances); int crashes = 0; - plugin_dict->GetInteger(WideToUTF16Hack(prefs::kStabilityPluginCrashes), &crashes); + plugin_dict->GetInteger(prefs::kStabilityPluginCrashes, &crashes); WriteIntAttribute("crashcount", crashes); } @@ -568,11 +568,10 @@ void MetricsLog::WriteAllProfilesMetrics( const std::wstring profile_prefix(prefs::kProfilePrefix); for (DictionaryValue::key_iterator i = all_profiles_metrics.begin_keys(); i != all_profiles_metrics.end_keys(); ++i) { - const string16 key_name16 = *i; - const std::wstring& key_name = UTF16ToWideHack(key_name16); + const std::wstring& key_name = *i; if (key_name.compare(0, profile_prefix.size(), profile_prefix) == 0) { DictionaryValue* profile; - if (all_profiles_metrics.GetDictionary(key_name16, &profile)) + if (all_profiles_metrics.GetDictionary(key_name, &profile)) WriteProfileMetrics(key_name.substr(profile_prefix.size()), *profile); } } @@ -586,13 +585,13 @@ void MetricsLog::WriteProfileMetrics(const std::wstring& profileidhash, i != profile_metrics.end_keys(); ++i) { Value* value; if (profile_metrics.Get(*i, &value)) { - DCHECK(*i != LIT16("id")); + DCHECK(*i != L"id"); switch (value->GetType()) { case Value::TYPE_STRING: { std::string string_value; if (value->GetAsString(&string_value)) { OPEN_ELEMENT_FOR_SCOPE("profileparam"); - WriteAttribute("name", UTF16ToUTF8(*i)); + WriteAttribute("name", WideToUTF8(*i)); WriteAttribute("value", string_value); } break; @@ -602,7 +601,7 @@ void MetricsLog::WriteProfileMetrics(const std::wstring& profileidhash, bool bool_value; if (value->GetAsBoolean(&bool_value)) { OPEN_ELEMENT_FOR_SCOPE("profileparam"); - WriteAttribute("name", UTF16ToUTF8(*i)); + WriteAttribute("name", WideToUTF8(*i)); WriteIntAttribute("value", bool_value ? 1 : 0); } break; @@ -612,7 +611,7 @@ void MetricsLog::WriteProfileMetrics(const std::wstring& profileidhash, int int_value; if (value->GetAsInteger(&int_value)) { OPEN_ELEMENT_FOR_SCOPE("profileparam"); - WriteAttribute("name", UTF16ToUTF8(*i)); + WriteAttribute("name", WideToUTF8(*i)); WriteIntAttribute("value", int_value); } break; |