| 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 part of dart.developer; | 5 part of dart.developer; |
| 6 | 6 |
| 7 const bool _isProduct = const bool.fromEnvironment("dart.vm.product"); | 7 const bool _isProduct = const bool.fromEnvironment("dart.vm.product"); |
| 8 | 8 |
| 9 typedef dynamic TimelineSyncFunction(); | 9 typedef dynamic TimelineSyncFunction(); |
| 10 typedef Future TimelineAsyncFunction(); | 10 typedef Future TimelineAsyncFunction(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 static final int _isolateId = _getIsolateNum(); | 90 static final int _isolateId = _getIsolateNum(); |
| 91 static final String _isolateIdString = _isolateId.toString(); | 91 static final String _isolateIdString = _isolateId.toString(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 /// An asynchronous task on the timeline. An asynchronous task can have many | 94 /// An asynchronous task on the timeline. An asynchronous task can have many |
| 95 /// (nested) synchronous operations. Synchronous operations can live longer than | 95 /// (nested) synchronous operations. Synchronous operations can live longer than |
| 96 /// the current isolate event. To pass a [TimelineTask] to another isolate, | 96 /// the current isolate event. To pass a [TimelineTask] to another isolate, |
| 97 /// you must first call [pass] to get the task id and then construct a new | 97 /// you must first call [pass] to get the task id and then construct a new |
| 98 /// [TimelineTask] in the other isolate. | 98 /// [TimelineTask] in the other isolate. |
| 99 class TimelineTask { | 99 class TimelineTask { |
| 100 /// Create a task. [taskId] will be set by the system. | 100 /// Create a task. The task ID will be set by the system. |
| 101 TimelineTask() : _taskId = _getNextAsyncId() {} | 101 TimelineTask() : _taskId = _getNextAsyncId() {} |
| 102 | 102 |
| 103 /// Create a task with an explicit [taskId]. This is useful if you are | 103 /// Create a task with an explicit [taskId]. This is useful if you are |
| 104 /// passing a task from one isolate to another. | 104 /// passing a task from one isolate to another. |
| 105 TimelineTask.withTaskId(int taskId) : _taskId = taskId { | 105 TimelineTask.withTaskId(int taskId) : _taskId = taskId { |
| 106 if (taskId is! int) { | 106 if (taskId is! int) { |
| 107 throw new ArgumentError.value(taskId, 'taskId', 'Must be an int'); | 107 throw new ArgumentError.value(taskId, 'taskId', 'Must be an int'); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 external void _reportTaskEvent(int start, int taskId, String phase, | 279 external void _reportTaskEvent(int start, int taskId, String phase, |
| 280 String category, String name, String argumentsAsJson); | 280 String category, String name, String argumentsAsJson); |
| 281 | 281 |
| 282 /// Reports a complete synchronous event. | 282 /// Reports a complete synchronous event. |
| 283 external void _reportCompleteEvent(int start, int startCpu, String category, | 283 external void _reportCompleteEvent(int start, int startCpu, String category, |
| 284 String name, String argumentsAsJson); | 284 String name, String argumentsAsJson); |
| 285 | 285 |
| 286 /// Reports an instant event. | 286 /// Reports an instant event. |
| 287 external void _reportInstantEvent( | 287 external void _reportInstantEvent( |
| 288 int start, String category, String name, String argumentsAsJson); | 288 int start, String category, String name, String argumentsAsJson); |
| OLD | NEW |