| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #include <arpa/inet.h> | |
| 6 #include <sys/time.h> | |
| 7 | |
| 8 | |
| 9 #include "vm/heap_profiler.h" | 5 #include "vm/heap_profiler.h" |
| 10 #include "vm/growable_array.h" | 6 #include "vm/growable_array.h" |
| 11 #include "vm/unit_test.h" | 7 #include "vm/unit_test.h" |
| 12 | 8 |
| 13 namespace dart { | 9 namespace dart { |
| 14 | 10 |
| 15 static void WriteCallback(const void* data, intptr_t length, void* stream) { | 11 static void WriteCallback(const void* data, intptr_t length, void* stream) { |
| 16 GrowableArray<uint8_t>* array = | 12 GrowableArray<uint8_t>* array = |
| 17 reinterpret_cast<GrowableArray<uint8_t>*>(stream); | 13 reinterpret_cast<GrowableArray<uint8_t>*>(stream); |
| 18 for (intptr_t i = 0; i < length; ++i) { | 14 for (intptr_t i = 0; i < length; ++i) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 EXPECT_GE(after, time + time_diff); | 108 EXPECT_GE(after, time + time_diff); |
| 113 // Check length diff | 109 // Check length diff |
| 114 uint32_t length = Read32(&array, &i); | 110 uint32_t length = Read32(&array, &i); |
| 115 EXPECT_LE((intptr_t)length + i , array.length()); | 111 EXPECT_LE((intptr_t)length + i , array.length()); |
| 116 // skip body | 112 // skip body |
| 117 i += length; | 113 i += length; |
| 118 } | 114 } |
| 119 } | 115 } |
| 120 | 116 |
| 121 } // namespace dart | 117 } // namespace dart |
| OLD | NEW |