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

Unified Diff: mojo/dart/packages/mojo/sdk_ext/src/constants.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
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;
+}
« no previous file with comments | « mojo/dart/packages/mojo/sdk_ext/internal.dart ('k') | mojo/dart/packages/mojo/sdk_ext/src/handle_watcher.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698