| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "vm/coverage.h" | 5 #include "vm/coverage.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 CoverageFilterAll default_filter; | 264 CoverageFilterAll default_filter; |
| 265 if (filter == NULL) { | 265 if (filter == NULL) { |
| 266 filter = &default_filter; | 266 filter = &default_filter; |
| 267 } | 267 } |
| 268 const GrowableObjectArray& libs = GrowableObjectArray::Handle( | 268 const GrowableObjectArray& libs = GrowableObjectArray::Handle( |
| 269 isolate, isolate->object_store()->libraries()); | 269 isolate, isolate->object_store()->libraries()); |
| 270 Library& lib = Library::Handle(); | 270 Library& lib = Library::Handle(); |
| 271 Class& cls = Class::Handle(); | 271 Class& cls = Class::Handle(); |
| 272 JSONObject coverage(stream); | 272 JSONObject coverage(stream); |
| 273 coverage.AddProperty("type", "CodeCoverage"); | 273 coverage.AddProperty("type", "CodeCoverage"); |
| 274 coverage.AddProperty("id", "coverage"); | |
| 275 { | 274 { |
| 276 JSONArray jsarr(&coverage, "coverage"); | 275 JSONArray jsarr(&coverage, "coverage"); |
| 277 for (int i = 0; i < libs.Length(); i++) { | 276 for (int i = 0; i < libs.Length(); i++) { |
| 278 lib ^= libs.At(i); | 277 lib ^= libs.At(i); |
| 279 ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate); | 278 ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate); |
| 280 while (it.HasNext()) { | 279 while (it.HasNext()) { |
| 281 cls = it.GetNextClass(); | 280 cls = it.GetNextClass(); |
| 282 ASSERT(!cls.IsNull()); | 281 ASSERT(!cls.IsNull()); |
| 283 PrintClass(lib, cls, jsarr, filter); | 282 PrintClass(lib, cls, jsarr, filter); |
| 284 } | 283 } |
| 285 } | 284 } |
| 286 } | 285 } |
| 287 } | 286 } |
| 288 | 287 |
| 289 | 288 |
| 290 } // namespace dart | 289 } // namespace dart |
| OLD | NEW |