Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1461)

Unified Diff: Source/core/page/NavigatorID.cpp

Issue 23889035: Move WEBCORE_NAVIGATOR macros defaults from the build system into a cpp file. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix build (sorry). Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/Navigator.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/NavigatorID.cpp
diff --git a/Source/core/page/NavigatorID.cpp b/Source/core/page/NavigatorID.cpp
index 54363323ad913435bcf0baea6c596947b5942890..85524f0717ad42b08ca23f5ee0dc647092cd7255 100644
--- a/Source/core/page/NavigatorID.cpp
+++ b/Source/core/page/NavigatorID.cpp
@@ -35,7 +35,7 @@
#include "core/page/NavigatorBase.h"
#include "wtf/CPU.h"
-#if OS(LINUX)
+#if !defined(WEBCORE_NAVIGATOR_PLATFORM) && OS(POSIX) && !OS(MACOSX)
#include "wtf/StdLibExtras.h"
#include <sys/utsname.h>
#endif
@@ -67,14 +67,16 @@ String NavigatorID::platform(const NavigatorBase*)
{
#if defined(WEBCORE_NAVIGATOR_PLATFORM)
return WEBCORE_NAVIGATOR_PLATFORM;
-#else
-#if OS(LINUX)
+#elif OS(MACOSX)
+ // Match Safari and Mozilla on Mac x86.
+ return "MacIntel";
+#elif OS(WIN)
+ // Match Safari and Mozilla on Windows.
+ return "Win32";
+#else // Unix-like systems
struct utsname osname;
DEFINE_STATIC_LOCAL(String, platformName, (uname(&osname) >= 0 ? String(osname.sysname) + String(" ") + String(osname.machine) : emptyString()));
return platformName;
-#else
-#error Non-Linux ports must define WEBCORE_NAVIGATOR_PLATFORM.
-#endif
#endif
}
« no previous file with comments | « Source/core/page/Navigator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698