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

Unified Diff: mojo/public/dart/lib/src/control_message.dart

Issue 1259873002: Dart: Runs dartanalyzer for the dart_pkg build rule. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
Index: mojo/public/dart/lib/src/control_message.dart
diff --git a/mojo/public/dart/lib/src/control_message.dart b/mojo/public/dart/lib/src/control_message.dart
index de71a980423903c3b9205b585f4c6c9d03b91bd5..e5cd5827dc7b98f72d4a0573ff83fea34b1b5467 100644
--- a/mojo/public/dart/lib/src/control_message.dart
+++ b/mojo/public/dart/lib/src/control_message.dart
@@ -44,18 +44,17 @@ class ControlMessageHandler {
MessageHeader.kMessageIsResponse));
}
- static Future<Message> _handleRunOrClose(Stub stub,
- int interface_version,
- ServiceMessage message) {
+ static Future _handleRunOrClose(Stub stub,
+ int interface_version,
+ ServiceMessage message) {
// Deserialize message.
var params = icm.RunOrClosePipeMessageParams.deserialize(message.payload);
// Grab required version.
var requiredVersion = params.requireVersion.version;
- if (interface_version >= requiredVersion) {
- // Stub meets the requirements.
- return;
+ if (interface_version < requiredVersion) {
+ // Stub does not implement required version. Close the pipe immediately.
+ stub.close(immediate: true);
}
- // Stub does not implement required version. Close the pipe immediately.
- stub.close(immediate: true);
+ return null;
}
}

Powered by Google App Engine
This is Rietveld 408576698