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

Unified Diff: runtime/vm/service/vmservice.dart

Issue 1232193003: Provide stdout and stderr output in the Observatory debugger. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: before commit Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/service/service.md ('k') | runtime/vm/service_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service/vmservice.dart
diff --git a/runtime/vm/service/vmservice.dart b/runtime/vm/service/vmservice.dart
index 1959cece8c9bc75724c023c5b7889ced351ac8db..e6889bbbe010b23f27e21b0587360b266da299dd 100644
--- a/runtime/vm/service/vmservice.dart
+++ b/runtime/vm/service/vmservice.dart
@@ -178,11 +178,6 @@ class VMService extends MessageRouter {
return JSON.encode(response);
}
- bool _isValidStream(String streamId) {
- final validStreams = [ 'Isolate', 'Debug', 'GC', '_Echo', '_Graph' ];
- return validStreams.contains(streamId);
- }
-
bool _isAnyClientSubscribed(String streamId) {
for (var client in clients) {
if (client.streams.contains(streamId)) {
@@ -196,16 +191,15 @@ class VMService extends MessageRouter {
var client = message.client;
var streamId = message.params['streamId'];
- if (!_isValidStream(streamId)) {
- return _encodeError(
- message, _kInvalidParams,
- details:"streamListen: invalid 'streamId' parameter: ${streamId}");
- }
if (client.streams.contains(streamId)) {
return _encodeError(message, _kStreamAlreadySubscribed);
}
if (!_isAnyClientSubscribed(streamId)) {
- _vmListenStream(streamId);
+ if (!_vmListenStream(streamId)) {
+ return _encodeError(
+ message, _kInvalidParams,
+ details:"streamListen: invalid 'streamId' parameter: ${streamId}");
+ }
}
client.streams.add(streamId);
@@ -217,11 +211,6 @@ class VMService extends MessageRouter {
var client = message.client;
var streamId = message.params['streamId'];
- if (!_isValidStream(streamId)) {
- return _encodeError(
- message, _kInvalidParams,
- details:"streamCancel: invalid 'streamId' parameter: ${streamId}");
- }
if (!client.streams.contains(streamId)) {
return _encodeError(message, _kStreamNotSubscribed);
}
@@ -331,6 +320,6 @@ void _onStart() native "VMService_OnStart";
void _onExit() native "VMService_OnExit";
-void _vmListenStream(String streamId) native "VMService_ListenStream";
+bool _vmListenStream(String streamId) native "VMService_ListenStream";
void _vmCancelStream(String streamId) native "VMService_CancelStream";
« no previous file with comments | « runtime/vm/service/service.md ('k') | runtime/vm/service_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698