summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-19 20:28:38 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-19 20:28:38 +0000
commitd1be67be82f0aaf6d937fd57924046d8f4da1eb0 (patch)
tree157a45a96625a1a0ac097456d651c32819c84faa /chrome
parent990000e307fe52b5a27f9a93dcab89f8b449beec (diff)
downloadchromium_src-d1be67be82f0aaf6d937fd57924046d8f4da1eb0.zip
chromium_src-d1be67be82f0aaf6d937fd57924046d8f4da1eb0.tar.gz
chromium_src-d1be67be82f0aaf6d937fd57924046d8f4da1eb0.tar.bz2
Send the chrome.dll base address in the UMA initial log. This will help us detect address space collisions where chrome.dll is needing to be rebased, and it will help us choose a better base address.
Review URL: http://codereview.chromium.org/6540 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/metrics_log.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/metrics_log.cc b/chrome/browser/metrics_log.cc
index 350f5b6..01de449 100644
--- a/chrome/browser/metrics_log.cc
+++ b/chrome/browser/metrics_log.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/metrics_log.h"
+#include "base/basictypes.h"
#include "base/file_util.h"
#include "base/file_version_info.h"
#include "base/md5.h"
@@ -23,6 +24,11 @@
using base::Time;
using base::TimeDelta;
+// http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
+#if defined(OS_WIN)
+extern "C" IMAGE_DOS_HEADER __ImageBase;
+#endif
+
// libxml take xmlChar*, which is unsigned char*
inline const unsigned char* UnsignedChar(const char* input) {
return reinterpret_cast<const unsigned char*>(input);
@@ -449,6 +455,9 @@ void MetricsLog::RecordEnvironment(
{
OPEN_ELEMENT_FOR_SCOPE("memory");
WriteIntAttribute("mb", base::SysInfo::AmountOfPhysicalMemoryMB());
+#if defined(OS_WIN)
+ WriteIntAttribute("dllbase", reinterpret_cast<int>(&__ImageBase));
+#endif
}
{