summaryrefslogtreecommitdiffstats
path: root/ceee/ie/common/ie_util.cc
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-03 20:32:07 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-03 20:32:07 +0000
commit5e04fb58560009c5555ff7fb9040521863403c74 (patch)
treebd1cc200e484ba7015d5dfdcadf29684471429e2 /ceee/ie/common/ie_util.cc
parentc4a1dc65ee5c402923c8e58ae29c502c58cbe0c1 (diff)
downloadchromium_src-5e04fb58560009c5555ff7fb9040521863403c74.zip
chromium_src-5e04fb58560009c5555ff7fb9040521863403c74.tar.gz
chromium_src-5e04fb58560009c5555ff7fb9040521863403c74.tar.bz2
Adde histograms for addon NavTime.
BUG=none TEST=none Review URL: http://codereview.chromium.org/5545002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68207 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ceee/ie/common/ie_util.cc')
-rw-r--r--ceee/ie/common/ie_util.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/ceee/ie/common/ie_util.cc b/ceee/ie/common/ie_util.cc
index 2bc7a0c..7c1707d 100644
--- a/ceee/ie/common/ie_util.cc
+++ b/ceee/ie/common/ie_util.cc
@@ -141,7 +141,8 @@ HRESULT GetIEIsInProtectedMode(bool* is_protected_mode) {
return hr;
}
-int GetAverageAddonLoadTimeMs(const CLSID& addon_id) {
+int GetAverageAddonTimeMs(const CLSID& addon_id,
+ const std::wstring& time_prefix) {
if (GetIeVersion() < IEVERSION_IE8)
return kInvalidTime;
@@ -164,19 +165,21 @@ int GetAverageAddonLoadTimeMs(const CLSID& addon_id) {
DWORD load_time = 0;
if (GetIeVersion() < IEVERSION_IE9) {
- if (!stats_key.ReadValueDW(L"LoadTime", &load_time)) {
- LOG(ERROR) << "Can't read LoadTime.";
+ if (!stats_key.ReadValueDW(time_prefix.c_str(), &load_time)) {
+ VLOG(1) << "Can't read time: " << time_prefix;
return kInvalidTime;
}
} else {
+ std::wstring value_name(time_prefix);
+ value_name += L"Array";
DWORD count = 0;
int32 values[100];
DWORD data_size = sizeof(values);
DWORD data_type = REG_NONE;
- if (!stats_key.ReadValue(L"LoadTimeArray", &values, &data_size,
+ if (!stats_key.ReadValue(value_name.c_str(), &values, &data_size,
&data_type)) {
- LOG(ERROR) << "Can't read LoadTime.";
+ VLOG(1) << "Can't read time: " << value_name;
return kInvalidTime;
}
@@ -202,19 +205,19 @@ int GetAverageAddonLoadTimeMs(const CLSID& addon_id) {
if (count < 2) {
// IE9 shows performance warning only after second run.
- LOG(INFO) << "Not enough data.";
+ VLOG(1) << "Not enough data. " << addon_id_str;
return kInvalidTime;
}
load_time /= count;
}
+ VLOG(1) << addon_id_str << "." << time_prefix << " = " << load_time << "ms";
+
if (load_time < 0) {
LOG(ERROR) << "Invalid time:" << load_time;
return kInvalidTime;
}
- LOG(INFO) << "Average add-on " << addon_id_str << "load time: " <<
- load_time << "ms";
return load_time;
}