Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(577)

Side by Side Diff: pkg/analyzer_experimental/lib/src/services/runtime/coverage/coverage_lib.dart

Issue 16964008: Code coverage, something is working now. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for Phil review comments Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 /// This library is injected into the applications under coverage.
6 library coverage_lib;
7
8 import 'dart:io';
9 import 'dart:typed_data';
10
11 const int PORT = 0; // replaced during rewrite
Bob Nystrom 2013/06/17 21:30:12 For constants, don't bother type annotating. It's
scheglov 2013/06/17 22:30:57 Done.
12 final Uint8List _executedIds = new Uint8List(1024 * 64);
Bob Nystrom 2013/06/17 21:30:12 Ditto for final variables. :) Also, document thos
scheglov 2013/06/17 22:30:57 Done.
13
14 touch(int id) {
15 int listIndex = id ~/ 8;
16 int bitIndex = id % 8;
17 _executedIds[listIndex] |= 1 << bitIndex;
18 }
19
20 postStatistics() {
21 var httpClient = new HttpClient();
22 httpClient.post('127.0.0.1', PORT, '/statistics').then((HttpClientRequest requ est) {
Bob Nystrom 2013/06/17 21:30:12 Return the result of calling post. If you have a
scheglov 2013/06/17 22:30:57 Done.
23 request.add(_executedIds);
24 request.close();
scheglov 2013/06/17 22:30:57 Should I also return result of request.close() her
Bob Nystrom 2013/06/17 22:44:41 Yes, if it returns a future.
25 });
26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698