2009-07-17 Yael Aharon <yael.aharon@nokia.com>
authoryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jul 2009 02:08:34 +0000 (02:08 +0000)
committeryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Jul 2009 02:08:34 +0000 (02:08 +0000)
        Reviewed by George Staikos.

        https://bugs.webkit.org/show_bug.cgi?id=27351
        Added platform "Symbian" to WEBCORE_NAVIGATOR_PLATFORM
        Use uname to find the correct platform for Linux.

        * page/NavigatorBase.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@46078 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/NavigatorBase.cpp

index 7e01d91..e967175 100644 (file)
@@ -1,3 +1,14 @@
+2009-07-17  Yael Aharon  <yael.aharon@nokia.com>
+
+        Reviewed by George Staikos.
+
+        https://bugs.webkit.org/show_bug.cgi?id=27351
+        Added platform "Symbian" to WEBCORE_NAVIGATOR_PLATFORM
+        Use uname to find the correct platform for Linux.
+
+        * page/NavigatorBase.cpp:
+        (WebCore::NavigatorBase::platform):
+
 2009-07-17  Jens Alfke  <snej@chromium.org>
 
         Reviewed by Dimitri Glazkov.
index 5138b0f..5b0c5d4 100644 (file)
 
 #include "NetworkStateNotifier.h"
 #include "PlatformString.h"
+#if PLATFORM(LINUX)
+#include "sys/utsname.h"
+#include <wtf/StdLibExtras.h>
+#endif
 
 #ifndef WEBCORE_NAVIGATOR_PLATFORM
 #if PLATFORM(MAC) && (PLATFORM(PPC) || PLATFORM(PPC64))
@@ -37,6 +41,8 @@
 #define WEBCORE_NAVIGATOR_PLATFORM "MacIntel"
 #elif PLATFORM(WIN_OS)
 #define WEBCORE_NAVIGATOR_PLATFORM "Win32"
+#elif PLATFORM(SYMBIAN)
+#define WEBCORE_NAVIGATOR_PLATFORM "Symbian"
 #else
 #define WEBCORE_NAVIGATOR_PLATFORM ""
 #endif
@@ -79,7 +85,15 @@ String NavigatorBase::appVersion() const
 
 String NavigatorBase::platform() const
 {
+#if PLATFORM(LINUX)
+    if (String("") != WEBCORE_NAVIGATOR_PLATFORM)
+        return WEBCORE_NAVIGATOR_PLATFORM;
+    struct utsname osname;
+    DEFINE_STATIC_LOCAL(String, platformName, (uname(&osname) >= 0 ? String(osname.sysname) + String(" ") + String(osname.machine) : ""));
+    return platformName;
+#else
     return WEBCORE_NAVIGATOR_PLATFORM;
+#endif
 }
 
 String NavigatorBase::appCodeName() const