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

Unified Diff: base/mac/mac_logging.mm

Issue 1753523002: Use a non-deprecated method to get a string from an OSStatus error . (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « base/mac/mac_logging.cc ('k') | media/audio/mac/audio_low_latency_input_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/mac_logging.mm
diff --git a/base/mac/mac_logging.cc b/base/mac/mac_logging.mm
similarity index 78%
rename from base/mac/mac_logging.cc
rename to base/mac/mac_logging.mm
index e82b0ed5f6c7cbf4e588725acba99bc73ea0a328..381ad30614ea2ae4fbab4b04e1c97224f427d435 100644
--- a/base/mac/mac_logging.cc
+++ b/base/mac/mac_logging.mm
@@ -3,16 +3,25 @@
// found in the LICENSE file.
#include "base/mac/mac_logging.h"
-#include "build/build_config.h"
+
+#import <Foundation/Foundation.h>
#include <iomanip>
+#include "build/build_config.h"
+
#if !defined(OS_IOS)
#include <CoreServices/CoreServices.h>
#endif
namespace logging {
+std::string DescriptionFromOSStatus(OSStatus err) {
+ NSError* error =
+ [NSError errorWithDomain:NSOSStatusErrorDomain code:err userInfo:nil];
+ return error.description.UTF8String;
Mark Mentovai 2016/03/01 15:27:23 Is the full -description what we want, or do we wa
erikchen 2016/03/01 18:02:00 We want -description. -description: Error Domain=
+}
+
OSStatusLogMessage::OSStatusLogMessage(const char* file_path,
int line,
LogSeverity severity,
@@ -28,7 +37,7 @@ OSStatusLogMessage::~OSStatusLogMessage() {
stream() << ": " << status_;
#else
stream() << ": "
- << GetMacOSStatusErrorString(status_)
+ << DescriptionFromOSStatus(status_)
<< " ("
<< status_
<< ")";
« no previous file with comments | « base/mac/mac_logging.cc ('k') | media/audio/mac/audio_low_latency_input_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698