| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PRODUCT | 5 #ifndef PRODUCT |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <cstdlib> | 9 #include <cstdlib> |
| 10 | 10 |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 | 1498 |
| 1499 void TimelineEventCallbackRecorder::CompleteEvent(TimelineEvent* event) { | 1499 void TimelineEventCallbackRecorder::CompleteEvent(TimelineEvent* event) { |
| 1500 OnEvent(event); | 1500 OnEvent(event); |
| 1501 delete event; | 1501 delete event; |
| 1502 } | 1502 } |
| 1503 | 1503 |
| 1504 | 1504 |
| 1505 TimelineEventEndlessRecorder::TimelineEventEndlessRecorder() | 1505 TimelineEventEndlessRecorder::TimelineEventEndlessRecorder() |
| 1506 : head_(NULL), block_index_(0) {} | 1506 : head_(NULL), block_index_(0) {} |
| 1507 | 1507 |
| 1508 TimelineEventEndlessRecorder::~TimelineEventEndlessRecorder() { |
| 1509 TimelineEventBlock* current = head_; |
| 1510 head_ = NULL; |
| 1511 |
| 1512 while (current != NULL) { |
| 1513 TimelineEventBlock* next = current->next(); |
| 1514 delete current; |
| 1515 current = next; |
| 1516 } |
| 1517 } |
| 1508 | 1518 |
| 1509 void TimelineEventEndlessRecorder::PrintJSON(JSONStream* js, | 1519 void TimelineEventEndlessRecorder::PrintJSON(JSONStream* js, |
| 1510 TimelineEventFilter* filter) { | 1520 TimelineEventFilter* filter) { |
| 1511 if (!FLAG_support_service) { | 1521 if (!FLAG_support_service) { |
| 1512 return; | 1522 return; |
| 1513 } | 1523 } |
| 1514 JSONObject topLevel(js); | 1524 JSONObject topLevel(js); |
| 1515 topLevel.AddProperty("type", "_Timeline"); | 1525 topLevel.AddProperty("type", "_Timeline"); |
| 1516 { | 1526 { |
| 1517 JSONArray events(&topLevel, "traceEvents"); | 1527 JSONArray events(&topLevel, "traceEvents"); |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1764 TimelineEventBlock* TimelineEventBlockIterator::Next() { | 1774 TimelineEventBlock* TimelineEventBlockIterator::Next() { |
| 1765 ASSERT(current_ != NULL); | 1775 ASSERT(current_ != NULL); |
| 1766 TimelineEventBlock* r = current_; | 1776 TimelineEventBlock* r = current_; |
| 1767 current_ = current_->next(); | 1777 current_ = current_->next(); |
| 1768 return r; | 1778 return r; |
| 1769 } | 1779 } |
| 1770 | 1780 |
| 1771 } // namespace dart | 1781 } // namespace dart |
| 1772 | 1782 |
| 1773 #endif // !PRODUCT | 1783 #endif // !PRODUCT |
| OLD | NEW |