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

Side by Side Diff: mojo/public/dart/src/types.dart

Issue 1059543002: Make MojoResults positive. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 part of core; 5 part of core;
6 6
7 class MojoResult { 7 class MojoResult {
8 static const int kOk = 0; 8 static const int kOk = 0;
9 static const int kCancelled = -1; 9 static const int kCancelled = 1;
10 static const int kUnknown = -2; 10 static const int kUnknown = 2;
11 static const int kInvalidArgument = -3; 11 static const int kInvalidArgument = 3;
12 static const int kDeadlineExceeded = -4; 12 static const int kDeadlineExceeded = 4;
13 static const int kNotFound = -5; 13 static const int kNotFound = 5;
14 static const int kAlreadyExists = -6; 14 static const int kAlreadyExists = 6;
15 static const int kPermissionDenied = -7; 15 static const int kPermissionDenied = 7;
16 static const int kResourceExhausted = -8; 16 static const int kResourceExhausted = 8;
17 static const int kFailedPrecondition = -9; 17 static const int kFailedPrecondition = 9;
18 static const int kAborted = -10; 18 static const int kAborted = 10;
19 static const int kOutOfRange = -11; 19 static const int kOutOfRange = 11;
20 static const int kUnimplemented = -12; 20 static const int kUnimplemented = 12;
21 static const int kInternal = -13; 21 static const int kInternal = 13;
22 static const int kUnavailable = -14; 22 static const int kUnavailable = 14;
23 static const int kDataLoss = -15; 23 static const int kDataLoss = 15;
24 static const int kBusy = -16; 24 static const int kBusy = 16;
25 static const int kShouldWait = -17; 25 static const int kShouldWait = 17;
26 26
27 static const OK = const MojoResult._(kOk); 27 static const OK = const MojoResult._(kOk);
28 static const CANCELLED = const MojoResult._(kCancelled); 28 static const CANCELLED = const MojoResult._(kCancelled);
29 static const UNKNOWN = const MojoResult._(kUnknown); 29 static const UNKNOWN = const MojoResult._(kUnknown);
30 static const INVALID_ARGUMENT = const MojoResult._(kInvalidArgument); 30 static const INVALID_ARGUMENT = const MojoResult._(kInvalidArgument);
31 static const DEADLINE_EXCEEDED = const MojoResult._(kDeadlineExceeded); 31 static const DEADLINE_EXCEEDED = const MojoResult._(kDeadlineExceeded);
32 static const NOT_FOUND = const MojoResult._(kNotFound); 32 static const NOT_FOUND = const MojoResult._(kNotFound);
33 static const ALREADY_EXISTS = const MojoResult._(kAlreadyExists); 33 static const ALREADY_EXISTS = const MojoResult._(kAlreadyExists);
34 static const PERMISSION_DENIED = const MojoResult._(kPermissionDenied); 34 static const PERMISSION_DENIED = const MojoResult._(kPermissionDenied);
35 static const RESOURCE_EXHAUSTED = const MojoResult._(kResourceExhausted); 35 static const RESOURCE_EXHAUSTED = const MojoResult._(kResourceExhausted);
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 final MojoResult result; 246 final MojoResult result;
247 final int index; 247 final int index;
248 List<MojoHandleSignalsState> states; 248 List<MojoHandleSignalsState> states;
249 249
250 bool get isIndexValid => (this.index != null); 250 bool get isIndexValid => (this.index != null);
251 bool get areSignalStatesValid => (this.states != null); 251 bool get areSignalStatesValid => (this.states != null);
252 252
253 String toString() => 253 String toString() =>
254 "MojoWaitManyResult(" "result: $result, idx: $index, state: ${states[index ]})"; 254 "MojoWaitManyResult(" "result: $result, idx: $index, state: ${states[index ]})";
255 } 255 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698