More frame events (#11747)

* Revert "Revert "fire service protocol events for frames (#11565)" (#11727)"

This reverts commit f25e2f5213.

* move the postEvent() call into a separate method
This commit is contained in:
Devon Carew
2017-08-31 11:38:21 -07:00
committed by GitHub
parent ff3acad1ad
commit 8c36ccf534
6 changed files with 140 additions and 17 deletions

View File

@@ -473,3 +473,13 @@ String extractCloudAuthTokenArg(List<String> rawArgs) {
}
return token;
}
// "An Observatory debugger and profiler on ... is available at: http://127.0.0.1:8100/"
final RegExp _kObservatoryRegExp = new RegExp(r'An Observatory debugger .* is available at: (\S+:(\d+))');
bool lineContainsServicePort(String line) => line.contains(_kObservatoryRegExp);
int parseServicePort(String line) {
final Match match = _kObservatoryRegExp.firstMatch(line);
return match == null ? null : int.parse(match.group(2));
}