diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index 86dee935cf..d49881695d 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -303,7 +303,7 @@ rtc_source_set("logging") { deps += [ "system:inline" ] if (is_mac) { - deps += [ ":logging_mac" ] + libs += [ "Foundation.framework" ] } # logging.h needs the deprecation header while downstream projects are @@ -463,17 +463,6 @@ rtc_source_set("deprecation") { ] } -if (is_mac && !build_with_chromium) { - rtc_source_set("logging_mac") { - visibility = [ ":logging" ] - libs = [ "Foundation.framework" ] - sources = [ - "logging_mac.h", - "logging_mac.mm", - ] - } -} - rtc_source_set("rtc_task_queue") { visibility = [ "*" ] sources = [ diff --git a/rtc_base/logging.cc b/rtc_base/logging.cc index f78cd88f94..b842b38444 100644 --- a/rtc_base/logging.cc +++ b/rtc_base/logging.cc @@ -156,13 +156,6 @@ LogMessage::LogMessage(const char* file, break; } #endif // WEBRTC_WIN -#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) - case ERRCTX_OSSTATUS: { - std::string desc(DescriptionFromOSStatus(err)); - tmp << " " << (desc.empty() ? "Unknown error" : desc.c_str()); - break; - } -#endif // WEBRTC_MAC && !defined(WEBRTC_IOS) default: break; } diff --git a/rtc_base/logging.h b/rtc_base/logging.h index 5d94308907..7931daa9f8 100644 --- a/rtc_base/logging.h +++ b/rtc_base/logging.h @@ -58,10 +58,6 @@ #include "rtc_base/strings/string_builder.h" #include "rtc_base/system/inline.h" -#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) -#include "rtc_base/logging_mac.h" -#endif // WEBRTC_MAC - #if !defined(NDEBUG) || defined(DLOG_ALWAYS_ON) #define RTC_DLOG_IS_ON 1 #else @@ -97,12 +93,10 @@ enum LogErrorContext { ERRCTX_NONE, ERRCTX_ERRNO, // System-local errno ERRCTX_HRESULT, // Windows HRESULT - ERRCTX_OSSTATUS, // MacOS OSStatus // Abbreviations for LOG_E macro ERRCTX_EN = ERRCTX_ERRNO, // LOG_E(sev, EN, x) ERRCTX_HR = ERRCTX_HRESULT, // LOG_E(sev, HR, x) - ERRCTX_OS = ERRCTX_OSSTATUS, // LOG_E(sev, OS, x) }; // Virtual sink interface that can receive log messages. diff --git a/rtc_base/logging_mac.h b/rtc_base/logging_mac.h deleted file mode 100644 index e65db560c1..0000000000 --- a/rtc_base/logging_mac.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2018 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef RTC_BASE_LOGGING_MAC_H_ -#define RTC_BASE_LOGGING_MAC_H_ - -#if !defined(WEBRTC_MAC) || defined(WEBRTC_IOS) -#error "Only include this header in macOS builds" -#endif - -#include - -#include - -namespace rtc { - -// Returns a UTF8 description from an OS X Status error. -std::string DescriptionFromOSStatus(OSStatus err); - -} // namespace rtc - -#endif // RTC_BASE_LOGGING_MAC_H_ diff --git a/rtc_base/logging_mac.mm b/rtc_base/logging_mac.mm deleted file mode 100644 index bd5f2b9d38..0000000000 --- a/rtc_base/logging_mac.mm +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2016 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "rtc_base/logging_mac.h" - -#import - -namespace rtc { -std::string DescriptionFromOSStatus(OSStatus err) { - NSError* error = - [NSError errorWithDomain:NSOSStatusErrorDomain code:err userInfo:nil]; - return error.description.UTF8String; -} - -} // namespace rtc