OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 for (int i = 0; i < len; i++) { | 293 for (int i = 0; i < len; i++) { |
294 uc32 c = str->Get(i); | 294 uc32 c = str->Get(i); |
295 if (c > 0xff) { | 295 if (c > 0xff) { |
296 Append("\\u%04x", c); | 296 Append("\\u%04x", c); |
297 } else if (c < 32 || c > 126) { | 297 } else if (c < 32 || c > 126) { |
298 Append("\\x%02x", c); | 298 Append("\\x%02x", c); |
299 } else if (c == ',') { | 299 } else if (c == ',') { |
300 Append("\\,"); | 300 Append("\\,"); |
301 } else if (c == '\\') { | 301 } else if (c == '\\') { |
302 Append("\\\\"); | 302 Append("\\\\"); |
| 303 } else if (c == '\"') { |
| 304 Append("\"\""); |
303 } else { | 305 } else { |
304 Append("%lc", c); | 306 Append("%lc", c); |
305 } | 307 } |
306 } | 308 } |
307 } | 309 } |
308 | 310 |
309 | 311 |
310 void LogMessageBuilder::AppendStringPart(const char* str, int len) { | 312 void LogMessageBuilder::AppendStringPart(const char* str, int len) { |
311 if (pos_ + len > Log::kMessageBufferSize) { | 313 if (pos_ + len > Log::kMessageBufferSize) { |
312 len = Log::kMessageBufferSize - pos_; | 314 len = Log::kMessageBufferSize - pos_; |
(...skipping 12 matching lines...) Expand all Loading... |
325 ASSERT(pos_ <= Log::kMessageBufferSize); | 327 ASSERT(pos_ <= Log::kMessageBufferSize); |
326 const int written = Log::Write(Log::message_buffer_, pos_); | 328 const int written = Log::Write(Log::message_buffer_, pos_); |
327 if (written != pos_ && write_failure_handler != NULL) { | 329 if (written != pos_ && write_failure_handler != NULL) { |
328 write_failure_handler(); | 330 write_failure_handler(); |
329 } | 331 } |
330 } | 332 } |
331 | 333 |
332 #endif // ENABLE_LOGGING_AND_PROFILING | 334 #endif // ENABLE_LOGGING_AND_PROFILING |
333 | 335 |
334 } } // namespace v8::internal | 336 } } // namespace v8::internal |
OLD | NEW |