summaryrefslogtreecommitdiffstats
path: root/chrome/browser/metrics
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-30 19:47:47 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-30 19:47:47 +0000
commite7b418bc2ddad0832b849de9e9594745ee180d03 (patch)
tree16ad06a92cbfc71e1bc5a4e3254abcb54c40f3c3 /chrome/browser/metrics
parent813fd51fbd13972fb52b46ef7c1606be80af0fd4 (diff)
downloadchromium_src-e7b418bc2ddad0832b849de9e9594745ee180d03.zip
chromium_src-e7b418bc2ddad0832b849de9e9594745ee180d03.tar.gz
chromium_src-e7b418bc2ddad0832b849de9e9594745ee180d03.tar.bz2
Convert DictionaryValue's keys to std::string (from wstring).
Everything now needs to be changed to avoid the deprecated wstring methods; this includes the unit tests. BUG=23581 TEST=all our tests still pass Review URL: http://codereview.chromium.org/3075010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/metrics')
-rw-r--r--chrome/browser/metrics/metrics_log.cc16
-rw-r--r--chrome/browser/metrics/metrics_log.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index 7384a2a..9b51cfa 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -354,10 +354,10 @@ void MetricsLog::RecordEnvironment(
void MetricsLog::WriteAllProfilesMetrics(
const DictionaryValue& all_profiles_metrics) {
- const std::wstring profile_prefix(prefs::kProfilePrefix);
+ const std::string profile_prefix(WideToUTF8(prefs::kProfilePrefix));
for (DictionaryValue::key_iterator i = all_profiles_metrics.begin_keys();
i != all_profiles_metrics.end_keys(); ++i) {
- const std::wstring& key_name = *i;
+ const std::string& key_name = *i;
if (key_name.compare(0, profile_prefix.size(), profile_prefix) == 0) {
DictionaryValue* profile;
if (all_profiles_metrics.GetDictionaryWithoutPathExpansion(key_name,
@@ -367,21 +367,21 @@ void MetricsLog::WriteAllProfilesMetrics(
}
}
-void MetricsLog::WriteProfileMetrics(const std::wstring& profileidhash,
+void MetricsLog::WriteProfileMetrics(const std::string& profileidhash,
const DictionaryValue& profile_metrics) {
OPEN_ELEMENT_FOR_SCOPE("userprofile");
- WriteAttribute("profileidhash", WideToUTF8(profileidhash));
+ WriteAttribute("profileidhash", profileidhash);
for (DictionaryValue::key_iterator i = profile_metrics.begin_keys();
i != profile_metrics.end_keys(); ++i) {
Value* value;
if (profile_metrics.GetWithoutPathExpansion(*i, &value)) {
- DCHECK(*i != L"id");
+ DCHECK(*i != "id");
switch (value->GetType()) {
case Value::TYPE_STRING: {
std::string string_value;
if (value->GetAsString(&string_value)) {
OPEN_ELEMENT_FOR_SCOPE("profileparam");
- WriteAttribute("name", WideToUTF8(*i));
+ WriteAttribute("name", *i);
WriteAttribute("value", string_value);
}
break;
@@ -391,7 +391,7 @@ void MetricsLog::WriteProfileMetrics(const std::wstring& profileidhash,
bool bool_value;
if (value->GetAsBoolean(&bool_value)) {
OPEN_ELEMENT_FOR_SCOPE("profileparam");
- WriteAttribute("name", WideToUTF8(*i));
+ WriteAttribute("name", *i);
WriteIntAttribute("value", bool_value ? 1 : 0);
}
break;
@@ -401,7 +401,7 @@ void MetricsLog::WriteProfileMetrics(const std::wstring& profileidhash,
int int_value;
if (value->GetAsInteger(&int_value)) {
OPEN_ELEMENT_FOR_SCOPE("profileparam");
- WriteAttribute("name", WideToUTF8(*i));
+ WriteAttribute("name", *i);
WriteIntAttribute("value", int_value);
}
break;
diff --git a/chrome/browser/metrics/metrics_log.h b/chrome/browser/metrics/metrics_log.h
index eb8e67f..081d4b1 100644
--- a/chrome/browser/metrics/metrics_log.h
+++ b/chrome/browser/metrics/metrics_log.h
@@ -93,7 +93,7 @@ class MetricsLog : public MetricsLogBase {
// Writes metrics for the profile identified by key. This writes all
// key/value pairs in profile_metrics.
- void WriteProfileMetrics(const std::wstring& key,
+ void WriteProfileMetrics(const std::string& key,
const DictionaryValue& profile_metrics);
DISALLOW_COPY_AND_ASSIGN(MetricsLog);