| Index: mojo/dart/packages/mojo/sdk_ext/src/constants.dart
|
| diff --git a/mojo/dart/packages/mojo/sdk_ext/src/constants.dart b/mojo/dart/packages/mojo/sdk_ext/src/constants.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4341b0f8e1fe602cc84a3fabc8bc093230d61027
|
| --- /dev/null
|
| +++ b/mojo/dart/packages/mojo/sdk_ext/src/constants.dart
|
| @@ -0,0 +1,62 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +part of internal;
|
| +
|
| +/// Constants that have to be kept in sync with the Mojo C API.
|
| +///
|
| +/// These constants are located in:
|
| +/// [https://github.com/domokit/mojo/blob/master/mojo/public/c/system/types.h](),
|
| +/// [https://github.com/domokit/mojo/blob/master/mojo/public/c/system/data_pipe.h](),
|
| +/// and
|
| +/// [https://github.com/domokit/mojo/blob/master/mojo/public/c/system/message_pipe.h]().
|
| +class MojoConstants {
|
| + // MojoResult:
|
| + static const int kOk = 0;
|
| + static const int kCancelled = 1;
|
| + static const int kUnknown = 2;
|
| + static const int kInvalidArgument = 3;
|
| + static const int kDeadlineExceeded = 4;
|
| + static const int kNotFound = 5;
|
| + static const int kAlreadyExists = 6;
|
| + static const int kPermissionDenied = 7;
|
| + static const int kResourceExhausted = 8;
|
| + static const int kFailedPrecondition = 9;
|
| + static const int kAborted = 10;
|
| + static const int kOutOfRange = 11;
|
| + static const int kUnimplemented = 12;
|
| + static const int kInternal = 13;
|
| + static const int kUnavailable = 14;
|
| + static const int kDataLoss = 15;
|
| + static const int kBusy = 16;
|
| + static const int kShouldWait = 17;
|
| +
|
| + // Shared constant for "no flag or signal".
|
| + static const int kNone = 0;
|
| +
|
| + // Endpoint Read Flags:
|
| + static const int kMayDiscard = 1;
|
| +
|
| + // DataPipeProducer and Consumer:
|
| + static const int kAllOrNone = 1 << 0;
|
| +
|
| + // DataPipeConsumer:
|
| + static const int kDiscard = 1 << 1;
|
| + static const int kQuery = 1 << 2;
|
| + static const int kPeek = 1 << 3;
|
| +
|
| + // DataPipe:
|
| + static const int kDefaultPipeElementSize = 1;
|
| + static const int kDefaultPipeCapacity = 0;
|
| +
|
| + // Handle Signals:
|
| + static const int kReadable = 0x1;
|
| + static const int kWritable = 0x2;
|
| + static const int kPeerClosed = 0x4;
|
| + static const int kHandleSignalBitfieldSize = 3;
|
| +
|
| + // Handle:
|
| + static const int kInvalidHandleToken = 0;
|
| + static const int kDeadlineIndefinite = -1;
|
| +}
|
|
|