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

Side by Side Diff: crypto/openssl_util.cc

Issue 2731823002: Replace use of logging::DEBUG_MODE with DCHECK_IS_ON(). (Closed)
Patch Set: Created 3 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
« no previous file with comments | « components/sync/engine_impl/traffic_logger.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "crypto/openssl_util.h" 5 #include "crypto/openssl_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 } // namespace 35 } // namespace
36 36
37 void EnsureOpenSSLInit() { 37 void EnsureOpenSSLInit() {
38 // CRYPTO_library_init may be safely called concurrently. 38 // CRYPTO_library_init may be safely called concurrently.
39 CRYPTO_library_init(); 39 CRYPTO_library_init();
40 } 40 }
41 41
42 void ClearOpenSSLERRStack(const tracked_objects::Location& location) { 42 void ClearOpenSSLERRStack(const tracked_objects::Location& location) {
43 if (logging::DEBUG_MODE && VLOG_IS_ON(1)) { 43 if (DCHECK_IS_ON() && VLOG_IS_ON(1)) {
44 uint32_t error_num = ERR_peek_error(); 44 uint32_t error_num = ERR_peek_error();
45 if (error_num == 0) 45 if (error_num == 0)
46 return; 46 return;
47 47
48 std::string message; 48 std::string message;
49 location.Write(true, true, &message); 49 location.Write(true, true, &message);
50 DVLOG(1) << "OpenSSL ERR_get_error stack from " << message; 50 DVLOG(1) << "OpenSSL ERR_get_error stack from " << message;
51 ERR_print_errors_cb(&OpenSSLErrorCallback, NULL); 51 ERR_print_errors_cb(&OpenSSLErrorCallback, NULL);
52 } else { 52 } else {
53 ERR_clear_error(); 53 ERR_clear_error();
54 } 54 }
55 } 55 }
56 56
57 } // namespace crypto 57 } // namespace crypto
OLDNEW
« no previous file with comments | « components/sync/engine_impl/traffic_logger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698