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

Side by Side Diff: mojo/dart/packages/mojo/lib/src/handle.dart

Issue 1978593002: Make the dart:mojo.internal import configuration specific. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add test. Created 4 years, 7 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 MojoHandle { 7 class MojoHandle {
8 // TODO(floitsch): get the INVALID value from the backing internal
9 // implementation.
8 static const int INVALID = 0; 10 static const int INVALID = 0;
9 static const int DEADLINE_INDEFINITE = -1; 11 static const int DEADLINE_INDEFINITE = -1;
10 12
11 int _h; 13 // The type of this field is determined by the backing internal
12 int get h => _h; 14 // implementation.
15 Object _h;
16 Object get h => _h;
13 17
14 MojoHandle(this._h, {String description}) { 18 MojoHandle(this._h, {String description}) {
15 MojoHandleNatives.addOpenHandle(_h, description: description); 19 MojoHandleNatives.addOpenHandle(_h, description: description);
16 } 20 }
17 21
18 MojoHandle._internal(this._h); 22 MojoHandle._internal(this._h);
19 23
20 MojoHandle.invalid() : this._internal(INVALID); 24 MojoHandle.invalid() : this._internal(INVALID);
21 25
22 int close() { 26 int close() {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 86 }
83 87
84 static bool registerFinalizer(MojoEventSubscription eventSubscription) { 88 static bool registerFinalizer(MojoEventSubscription eventSubscription) {
85 return MojoHandleNatives.registerFinalizer( 89 return MojoHandleNatives.registerFinalizer(
86 eventSubscription, eventSubscription._handle.h) == 90 eventSubscription, eventSubscription._handle.h) ==
87 MojoResult.kOk; 91 MojoResult.kOk;
88 } 92 }
89 93
90 static bool reportLeakedHandles() => MojoHandleNatives.reportOpenHandles(); 94 static bool reportLeakedHandles() => MojoHandleNatives.reportOpenHandles();
91 } 95 }
OLDNEW
« no previous file with comments | « mojo/dart/packages/mojo/lib/src/buffer.dart ('k') | mojo/dart/packages/mojo/lib/src/internal.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698