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

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

Issue 799008: Make the assumption on the minimum buffer size for GetLogLines explicit. (Closed)
Patch Set: Added assert, removed failing checks from test. Created 10 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 | « src/api.cc ('k') | src/log-utils.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 // See description in include/v8.h. 109 // See description in include/v8.h.
110 static int GetLogLines(int from_pos, char* dest_buf, int max_size); 110 static int GetLogLines(int from_pos, char* dest_buf, int max_size);
111 111
112 // Returns whether logging is enabled. 112 // Returns whether logging is enabled.
113 static bool IsEnabled() { 113 static bool IsEnabled() {
114 return !is_stopped_ && (output_handle_ != NULL || output_buffer_ != NULL); 114 return !is_stopped_ && (output_handle_ != NULL || output_buffer_ != NULL);
115 } 115 }
116 116
117 // Size of buffer used for formatting log messages. 117 // Size of buffer used for formatting log messages.
118 static const int kMessageBufferSize = 2048; 118 static const int kMessageBufferSize = v8::V8::kMinimumSizeForLogLinesBuffer;
119 119
120 private: 120 private:
121 typedef int (*WritePtr)(const char* msg, int length); 121 typedef int (*WritePtr)(const char* msg, int length);
122 122
123 // Initialization function called from Open... functions. 123 // Initialization function called from Open... functions.
124 static void Init(); 124 static void Init();
125 125
126 // Write functions assume that mutex_ is acquired by the caller. 126 // Write functions assume that mutex_ is acquired by the caller.
127 static WritePtr Write; 127 static WritePtr Write;
128 128
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 280
281 ScopedLock sl; 281 ScopedLock sl;
282 int pos_; 282 int pos_;
283 }; 283 };
284 284
285 #endif // ENABLE_LOGGING_AND_PROFILING 285 #endif // ENABLE_LOGGING_AND_PROFILING
286 286
287 } } // namespace v8::internal 287 } } // namespace v8::internal
288 288
289 #endif // V8_LOG_UTILS_H_ 289 #endif // V8_LOG_UTILS_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/log-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698