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

Side by Side Diff: src/log-utils.h

Issue 2526783002: [base] Define CHECK comparison for signed vs. unsigned (Closed)
Patch Set: Rebase Created 4 years 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 | « src/base/logging.h ('k') | src/wasm/ast-decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project 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 #ifndef V8_LOG_UTILS_H_ 5 #ifndef V8_LOG_UTILS_H_
6 #define V8_LOG_UTILS_H_ 6 #define V8_LOG_UTILS_H_
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 9
10 #include <cstdarg> 10 #include <cstdarg>
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 void OpenStdout(); 103 void OpenStdout();
104 104
105 // Opens file for logging. 105 // Opens file for logging.
106 void OpenFile(const char* name); 106 void OpenFile(const char* name);
107 107
108 // Opens a temporary file for logging. 108 // Opens a temporary file for logging.
109 void OpenTemporaryFile(); 109 void OpenTemporaryFile();
110 110
111 // Implementation of writing to a log file. 111 // Implementation of writing to a log file.
112 int WriteToFile(const char* msg, int length) { 112 int WriteToFile(const char* msg, int length) {
113 DCHECK(output_handle_ != NULL); 113 DCHECK_NOT_NULL(output_handle_);
114 size_t rv = fwrite(msg, 1, length, output_handle_); 114 size_t rv = fwrite(msg, 1, length, output_handle_);
115 DCHECK(static_cast<size_t>(length) == rv); 115 DCHECK_EQ(length, rv);
116 USE(rv); 116 USE(rv);
117 fflush(output_handle_); 117 fflush(output_handle_);
118 return length; 118 return length;
119 } 119 }
120 120
121 // Whether logging is stopped (e.g. due to insufficient resources). 121 // Whether logging is stopped (e.g. due to insufficient resources).
122 bool is_stopped_; 122 bool is_stopped_;
123 123
124 // When logging is active output_handle_ is used to store a pointer to log 124 // When logging is active output_handle_ is used to store a pointer to log
125 // destination. mutex_ should be acquired before using output_handle_. 125 // destination. mutex_ should be acquired before using output_handle_.
(...skipping 10 matching lines...) Expand all
136 Logger* logger_; 136 Logger* logger_;
137 137
138 friend class Logger; 138 friend class Logger;
139 }; 139 };
140 140
141 141
142 } // namespace internal 142 } // namespace internal
143 } // namespace v8 143 } // namespace v8
144 144
145 #endif // V8_LOG_UTILS_H_ 145 #endif // V8_LOG_UTILS_H_
OLDNEW
« no previous file with comments | « src/base/logging.h ('k') | src/wasm/ast-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698