Chromium Code Reviews| 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 part of html; | 5 part of html; |
| 6 | 6 |
| 7 class _Utils { | 7 class _Utils { |
| 8 static double dateTimeToDouble(DateTime dateTime) => | 8 static double dateTimeToDouble(DateTime dateTime) => |
| 9 dateTime.millisecondsSinceEpoch.toDouble(); | 9 dateTime.millisecondsSinceEpoch.toDouble(); |
| 10 static DateTime doubleToDateTime(double dateTime) { | 10 static DateTime doubleToDateTime(double dateTime) { |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 if (map['alpha'] == true) result |= 0x01; | 36 if (map['alpha'] == true) result |= 0x01; |
| 37 if (map['depth'] == true) result |= 0x02; | 37 if (map['depth'] == true) result |= 0x02; |
| 38 if (map['stencil'] == true) result |= 0x4; | 38 if (map['stencil'] == true) result |= 0x4; |
| 39 if (map['antialias'] == true) result |= 0x08; | 39 if (map['antialias'] == true) result |= 0x08; |
| 40 if (map['premultipliedAlpha'] == true) result |= 0x10; | 40 if (map['premultipliedAlpha'] == true) result |= 0x10; |
| 41 if (map['preserveDrawingBuffer'] == true) result |= 0x20; | 41 if (map['preserveDrawingBuffer'] == true) result |= 0x20; |
| 42 | 42 |
| 43 return result; | 43 return result; |
| 44 } | 44 } |
| 45 | 45 |
| 46 static List parseStackTrace(StackTrace stackTrace) { | |
|
Anton Muhin
2013/04/29 07:55:53
regexp woodoo looks a bit hacky, maybe ask VM team
podivilov
2013/04/29 08:29:09
There's currently no public API in StackTrace. VM
| |
| 47 final regExp = new RegExp(r'#\d\s+(.*) \((.*):(\d+):(\d+)\)'); | |
| 48 List result = []; | |
| 49 for (var match in regExp.allMatches(stackTrace.toString())) { | |
| 50 result.add([match.group(1), match.group(2), int.parse(match.group(3)), int .parse(match.group(4))]); | |
| 51 } | |
| 52 return result; | |
| 53 } | |
| 54 | |
| 46 static void populateMap(Map result, List list) { | 55 static void populateMap(Map result, List list) { |
| 47 for (int i = 0; i < list.length; i += 2) { | 56 for (int i = 0; i < list.length; i += 2) { |
| 48 result[list[i]] = list[i + 1]; | 57 result[list[i]] = list[i + 1]; |
| 49 } | 58 } |
| 50 } | 59 } |
| 51 | 60 |
| 52 static bool isMap(obj) => obj is Map; | 61 static bool isMap(obj) => obj is Map; |
| 53 | 62 |
| 54 static Map createMap() => {}; | 63 static Map createMap() => {}; |
| 55 | 64 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 } | 249 } |
| 241 | 250 |
| 242 _send(msg) { | 251 _send(msg) { |
| 243 _sendToHelperIsolate(msg, _sendPort); | 252 _sendToHelperIsolate(msg, _sendPort); |
| 244 } | 253 } |
| 245 } | 254 } |
| 246 | 255 |
| 247 get _pureIsolateTimerFactoryClosure => | 256 get _pureIsolateTimerFactoryClosure => |
| 248 ((int milliSeconds, void callback(Timer time), bool repeating) => | 257 ((int milliSeconds, void callback(Timer time), bool repeating) => |
| 249 new _PureIsolateTimer(milliSeconds, callback, repeating)); | 258 new _PureIsolateTimer(milliSeconds, callback, repeating)); |
| OLD | NEW |