Chromium Code Reviews| 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 416 | 416 |
| 417 delete mutex_; | 417 delete mutex_; |
| 418 mutex_ = NULL; | 418 mutex_ = NULL; |
| 419 | 419 |
| 420 DeleteArray(message_buffer_); | 420 DeleteArray(message_buffer_); |
| 421 message_buffer_ = NULL; | 421 message_buffer_ = NULL; |
| 422 } | 422 } |
| 423 | 423 |
| 424 | 424 |
| 425 int Log::GetLogLines(int from_pos, char* dest_buf, int max_size) { | 425 int Log::GetLogLines(int from_pos, char* dest_buf, int max_size) { |
| 426 if (Write != WriteToMemory) return 0; | |
|
Søren Thygesen Gjesse
2009/05/08 09:59:33
Maybe we should consider having an enum to indicat
Mikhail Naganov
2009/05/08 10:06:15
And end up have two variables for specifying mode
| |
| 426 ASSERT(output_.buffer != NULL); | 427 ASSERT(output_.buffer != NULL); |
| 427 ASSERT(output_buffer_write_pos_ >= output_.buffer); | 428 ASSERT(output_buffer_write_pos_ >= output_.buffer); |
| 428 ASSERT(from_pos >= 0); | 429 ASSERT(from_pos >= 0); |
| 429 ASSERT(max_size >= 0); | 430 ASSERT(max_size >= 0); |
| 430 int actual_size = max_size; | 431 int actual_size = max_size; |
| 431 char* buffer_read_pos = output_.buffer + from_pos; | 432 char* buffer_read_pos = output_.buffer + from_pos; |
| 432 ScopedLock sl(mutex_); | 433 ScopedLock sl(mutex_); |
| 433 if (actual_size == 0 | 434 if (actual_size == 0 |
| 434 || output_buffer_write_pos_ == output_.buffer | 435 || output_buffer_write_pos_ == output_.buffer |
| 435 || buffer_read_pos >= output_buffer_write_pos_) { | 436 || buffer_read_pos >= output_buffer_write_pos_) { |
| (...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1313 } else if (previous_->state_ == EXTERNAL) { | 1314 } else if (previous_->state_ == EXTERNAL) { |
| 1314 // We are leaving V8. | 1315 // We are leaving V8. |
| 1315 Heap::Protect(); | 1316 Heap::Protect(); |
| 1316 } | 1317 } |
| 1317 } | 1318 } |
| 1318 #endif | 1319 #endif |
| 1319 } | 1320 } |
| 1320 #endif | 1321 #endif |
| 1321 | 1322 |
| 1322 } } // namespace v8::internal | 1323 } } // namespace v8::internal |
| OLD | NEW |