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

Unified Diff: sky/engine/wtf/Assertions.cpp

Issue 709603006: Remove a bunch of OS(MACOSX) code (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Even more Created 6 years, 1 month 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
Index: sky/engine/wtf/Assertions.cpp
diff --git a/sky/engine/wtf/Assertions.cpp b/sky/engine/wtf/Assertions.cpp
index 8f6ef3127f6759f92651882fef736f7e0f41c9cd..b28511eb63bea76b4bc6a56d181358d35f77918c 100644
--- a/sky/engine/wtf/Assertions.cpp
+++ b/sky/engine/wtf/Assertions.cpp
@@ -47,20 +47,7 @@
#include <signal.h>
#endif
-#if USE(CF)
-#include <AvailabilityMacros.h>
-#include <CoreFoundation/CFString.h>
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
-#define WTF_USE_APPLE_SYSTEM_LOG 1
-#include <asl.h>
-#endif
-#endif // USE(CF)
-
-#if COMPILER(MSVC)
-#include <crtdbg.h>
-#endif
-
-#if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__))
+#if (OS(LINUX) && !defined(__UCLIBC__))
#include <cxxabi.h>
#include <dlfcn.h>
#include <execinfo.h>
@@ -77,65 +64,8 @@ extern "C" {
WTF_ATTRIBUTE_PRINTF(1, 0)
static void vprintf_stderr_common(const char* format, va_list args)
{
-#if USE(CF) && !OS(WIN)
- if (strstr(format, "%@")) {
- CFStringRef cfFormat = CFStringCreateWithCString(NULL, format, kCFStringEncodingUTF8);
-
-#if COMPILER(CLANG)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wformat-nonliteral"
-#endif
- CFStringRef str = CFStringCreateWithFormatAndArguments(NULL, NULL, cfFormat, args);
-#if COMPILER(CLANG)
-#pragma clang diagnostic pop
-#endif
- CFIndex length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(str), kCFStringEncodingUTF8);
- char* buffer = (char*)malloc(length + 1);
-
- CFStringGetCString(str, buffer, length, kCFStringEncodingUTF8);
-
-#if USE(APPLE_SYSTEM_LOG)
- asl_log(0, 0, ASL_LEVEL_NOTICE, "%s", buffer);
-#endif
- fputs(buffer, stderr);
-
- free(buffer);
- CFRelease(str);
- CFRelease(cfFormat);
- return;
- }
-
-#if USE(APPLE_SYSTEM_LOG)
- va_list copyOfArgs;
- va_copy(copyOfArgs, args);
- asl_vlog(0, 0, ASL_LEVEL_NOTICE, format, copyOfArgs);
- va_end(copyOfArgs);
-#endif
-
- // Fall through to write to stderr in the same manner as other platforms.
-
-#elif OS(ANDROID)
+#if OS(ANDROID)
__android_log_vprint(ANDROID_LOG_WARN, "WebKit", format, args);
-#elif HAVE(ISDEBUGGERPRESENT)
- if (IsDebuggerPresent()) {
- size_t size = 1024;
-
- do {
- char* buffer = (char*)malloc(size);
-
- if (buffer == NULL)
- break;
-
- if (_vsnprintf(buffer, size, format, args) != -1) {
- OutputDebugStringA(buffer);
- free(buffer);
- break;
- }
-
- free(buffer);
- size *= 2;
- } while (size > 1024);
- }
#endif
vfprintf(stderr, format, args);
}

Powered by Google App Engine
This is Rietveld 408576698