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

Unified Diff: mojo/dart/packages/mojo/lib/src/handle.dart

Issue 1694413003: Cleanups in the Mojo package. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address comments. Created 4 years, 10 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 | « mojo/dart/packages/mojo/lib/src/data_pipe.dart ('k') | mojo/dart/packages/mojo/lib/src/message_pipe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/packages/mojo/lib/src/handle.dart
diff --git a/mojo/dart/packages/mojo/lib/src/handle.dart b/mojo/dart/packages/mojo/lib/src/handle.dart
index 3c98ff491fccbe8d7dab4567c31db693a6c7f84e..908fa02153c871e238247154ba17bc913226dc07 100644
--- a/mojo/dart/packages/mojo/lib/src/handle.dart
+++ b/mojo/dart/packages/mojo/lib/src/handle.dart
@@ -5,8 +5,8 @@
part of core;
class MojoHandle {
- static const int INVALID = 0;
- static const int DEADLINE_INDEFINITE = -1;
+ static const int invalidHandle = MojoConstants.kInvalidHandleToken;
+ static const int deadlineIndefinite = MojoConstants.kDeadlineIndefinite;
int _h;
int get h => _h;
@@ -17,12 +17,12 @@ class MojoHandle {
MojoHandle._internal(this._h);
- MojoHandle.invalid() : this._internal(INVALID);
+ MojoHandle.invalid() : this._internal(invalidHandle);
int close() {
MojoHandleNatives.removeOpenHandle(_h);
int result = MojoHandleNatives.close(_h);
- _h = INVALID;
+ _h = invalidHandle;
return result;
}
@@ -57,7 +57,7 @@ class MojoHandle {
bool get readyRead => _ready(MojoHandleSignals.kPeerClosedReadable);
bool get readyWrite => _ready(MojoHandleSignals.kWritable);
- bool get isValid => (_h != INVALID);
+ bool get isValid => (_h != invalidHandle);
String toString() {
if (!isValid) {
« no previous file with comments | « mojo/dart/packages/mojo/lib/src/data_pipe.dart ('k') | mojo/dart/packages/mojo/lib/src/message_pipe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698