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

Side by Side Diff: third_party/webrtc_overrides/webrtc/base/logging.cc

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, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // NOTE: 5 // NOTE:
6 // Since this file includes Chromium headers, it must not include 6 // Since this file includes Chromium headers, it must not include
7 // third_party/webrtc/base/logging.h since it defines some of the same macros as 7 // third_party/webrtc/base/logging.h since it defines some of the same macros as
8 // Chromium does and we'll run into conflicts. 8 // Chromium does and we'll run into conflicts.
9 9
10 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) 10 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
11 #include <CoreServices/CoreServices.h> 11 #include <CoreServices/CoreServices.h>
12 #endif // OS_MACOSX 12 #endif // OS_MACOSX
13 13
14 #include <algorithm> 14 #include <algorithm>
15 #include <iomanip> 15 #include <iomanip>
16 16
17 #include "base/atomicops.h" 17 #include "base/atomicops.h"
18 #include "base/logging.h" 18 #include "base/logging.h"
19 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
20 #include "base/threading/platform_thread.h" 20 #include "base/threading/platform_thread.h"
21 #include "third_party/webrtc/base/stringencode.h" 21 #include "third_party/webrtc/base/stringencode.h"
22 #include "third_party/webrtc/base/stringutils.h" 22 #include "third_party/webrtc/base/stringutils.h"
23 23
24 // This needs to be included after base/logging.h. 24 // This needs to be included after base/logging.h.
25 #include "third_party/webrtc_overrides/webrtc/base/diagnostic_logging.h" 25 #include "third_party/webrtc_overrides/webrtc/base/diagnostic_logging.h"
26 #include "third_party/webrtc_overrides/webrtc/base/logging.h" 26 #include "third_party/webrtc_overrides/webrtc/base/logging.h"
27 27
28 #if defined(WEBRTC_MAC)
29 #include "base/mac/mac_logging.h"
30 #endif
31
28 // From this file we can't use VLOG since it expands into usage of the __FILE__ 32 // From this file we can't use VLOG since it expands into usage of the __FILE__
29 // macro (for correct filtering). The actual logging call from DIAGNOSTIC_LOG in 33 // macro (for correct filtering). The actual logging call from DIAGNOSTIC_LOG in
30 // ~DiagnosticLogMessage. Note that the second parameter to the LAZY_STREAM 34 // ~DiagnosticLogMessage. Note that the second parameter to the LAZY_STREAM
31 // macro is true since the filter check has already been done for 35 // macro is true since the filter check has already been done for
32 // DIAGNOSTIC_LOG. 36 // DIAGNOSTIC_LOG.
33 #define LOG_LAZY_STREAM_DIRECT(file_name, line_number, sev) \ 37 #define LOG_LAZY_STREAM_DIRECT(file_name, line_number, sev) \
34 LAZY_STREAM(logging::LogMessage(file_name, line_number, sev).stream(), \ 38 LAZY_STREAM(logging::LogMessage(file_name, line_number, sev).stream(), \
35 true) 39 true)
36 40
37 namespace rtc { 41 namespace rtc {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 145 }
142 break; 146 break;
143 } 147 }
144 #elif defined(WEBRTC_IOS) 148 #elif defined(WEBRTC_IOS)
145 case ERRCTX_OSSTATUS: 149 case ERRCTX_OSSTATUS:
146 (*print_stream) << " " 150 (*print_stream) << " "
147 << "Unknown LibJingle error: " << err; 151 << "Unknown LibJingle error: " << err;
148 break; 152 break;
149 #elif defined(WEBRTC_MAC) 153 #elif defined(WEBRTC_MAC)
150 case ERRCTX_OSSTATUS: { 154 case ERRCTX_OSSTATUS: {
151 (*print_stream) << " " << nonnull(GetMacOSStatusErrorString(err), 155 (*print_stream) << " " << logging::DescriptionFromOSStatus(err);
152 "Unknown error");
153 if (const char* desc = GetMacOSStatusCommentString(err)) {
154 (*print_stream) << ": " << desc;
155 }
156 break; 156 break;
157 } 157 }
158 #endif // defined(WEBRTC_WIN) 158 #endif // defined(WEBRTC_WIN)
159 default: 159 default:
160 break; 160 break;
161 } 161 }
162 } 162 }
163 163
164 DiagnosticLogMessage::DiagnosticLogMessage(const char* file, 164 DiagnosticLogMessage::DiagnosticLogMessage(const char* file,
165 int line, 165 int line,
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 g_extra_logging_init_function = function; 356 g_extra_logging_init_function = function;
357 } 357 }
358 358
359 bool CheckVlogIsOnHelper( 359 bool CheckVlogIsOnHelper(
360 rtc::LoggingSeverity severity, const char* file, size_t N) { 360 rtc::LoggingSeverity severity, const char* file, size_t N) {
361 return rtc::WebRtcVerbosityLevel(severity) <= 361 return rtc::WebRtcVerbosityLevel(severity) <=
362 ::logging::GetVlogLevelHelper(file, N); 362 ::logging::GetVlogLevelHelper(file, N);
363 } 363 }
364 364
365 } // namespace rtc 365 } // namespace rtc
OLDNEW
« base/mac/mac_logging.mm ('K') | « remoting/host/mac/me2me_preference_pane.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698