summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webkit_glue.cc
diff options
context:
space:
mode:
authordkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 00:44:53 +0000
committerdkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-16 00:44:53 +0000
commitf1d07b705c8fc1bc2a8bee2977ac8c4dc01879f1 (patch)
tree9b98d7b02522701f7ea898cd4c9ad5d91f576967 /webkit/glue/webkit_glue.cc
parenta63241ee38441a2e965f407c29d39147ea2f62ff (diff)
downloadchromium_src-f1d07b705c8fc1bc2a8bee2977ac8c4dc01879f1.zip
chromium_src-f1d07b705c8fc1bc2a8bee2977ac8c4dc01879f1.tar.gz
chromium_src-f1d07b705c8fc1bc2a8bee2977ac8c4dc01879f1.tar.bz2
Per Mark's request, add back the CPU type on Linux
the way Firefox does it. While I've got your attention: how bad an idea would it be to (for nonofficial builds only) append 'r' and the svn revision number to the chrome version? Review URL: http://codereview.chromium.org/67146 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webkit_glue.cc')
-rw-r--r--webkit/glue/webkit_glue.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc
index 14e0fe4..5b2828d 100644
--- a/webkit/glue/webkit_glue.cc
+++ b/webkit/glue/webkit_glue.cc
@@ -8,6 +8,8 @@
#if defined(OS_WIN)
#include <objidl.h>
#include <mlang.h>
+#elif defined(OS_LINUX)
+#include <sys/utsname.h>
#endif
#include "BackForwardList.h"
@@ -326,6 +328,20 @@ std::string BuildOSCpuInfo() {
base::SysInfo::OperatingSystemVersionNumbers(&os_major_version,
&os_minor_version,
&os_bugfix_version);
+#else
+ // Should work on any Posix system
+ // Get CPU type and operating system name
+ struct utsname unixinfo;
+ uname(&unixinfo);
+
+ std::string cputype;
+ // special case for biarch systems
+ if (strcmp(unixinfo.machine, "x86_64") == 0 &&
+ sizeof(void *) == sizeof(int32)) {
+ cputype.assign("i686 (x86_64)");
+ } else {
+ cputype.assign(unixinfo.machine);
+ }
#endif
StringAppendF(
@@ -339,8 +355,10 @@ std::string BuildOSCpuInfo() {
os_major_version,
os_minor_version,
os_bugfix_version
-#elif defined(OS_LINUX)
- "Linux" // Firefox also puts CPU info here
+#else
+ "%s %s",
+ unixinfo.sysname, // e.g. Linux
+ cputype.c_str() // e.g. i686
#endif
);