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

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

Issue 1411843005: Dart: Removes C++ set for closing handles on an unhandled exception. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 2 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/public/dart/mojo/lib/src/event_stream.dart ('k') | mojo/public/dart/mojo/sdk_ext/src/natives.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/dart/mojo/lib/src/handle.dart
diff --git a/mojo/public/dart/mojo/lib/src/handle.dart b/mojo/public/dart/mojo/lib/src/handle.dart
index 391fa841b62e409b5e0eaac4d8851bbf794037b8..bfc912ea051871e3c315d8fc74a3e57688abfe74 100644
--- a/mojo/public/dart/mojo/lib/src/handle.dart
+++ b/mojo/public/dart/mojo/lib/src/handle.dart
@@ -19,7 +19,9 @@ class MojoHandle {
int get h => _h;
MojoHandle(this._h, {String description}) {
+ // TODO(zra): Merge unclosed handle tracking.
assert(_addUnclosedHandle(this, description: description));
+ MojoHandleNatives.addUnclosed(_h);
}
MojoHandle._internal(this._h);
@@ -28,6 +30,7 @@ class MojoHandle {
MojoResult close() {
assert(_removeUnclosedHandle(this));
+ MojoHandleNatives.removeUnclosed(_h);
int result = MojoHandleNatives.close(_h);
_h = INVALID;
return new MojoResult(result);
@@ -35,6 +38,7 @@ class MojoHandle {
MojoHandle pass() {
assert(_removeUnclosedHandle(this));
+ MojoHandleNatives.removeUnclosed(_h);
return this;
}
@@ -87,9 +91,9 @@ class MojoHandle {
return new MojoWaitManyResult(new MojoResult(result[0]), result[1], states);
}
- static MojoResult register(MojoEventStream eventStream) {
- return new MojoResult(
- MojoHandleNatives.register(eventStream, eventStream._handle.h));
+ static MojoResult registerFinalizer(MojoEventStream eventStream) {
+ return new MojoResult(MojoHandleNatives.registerFinalizer(
+ eventStream, eventStream._handle.h));
}
static HashMap<int, _HandleCreationRecord> _unclosedHandles = new HashMap();
@@ -104,8 +108,8 @@ class MojoHandle {
stack = s;
}
- var handleCreate = new _HandleCreationRecord(
- handle, stack, description: description);
+ var handleCreate =
+ new _HandleCreationRecord(handle, stack, description: description);
_unclosedHandles[handle.h] = handleCreate;
return true;
}
« no previous file with comments | « mojo/public/dart/mojo/lib/src/event_stream.dart ('k') | mojo/public/dart/mojo/sdk_ext/src/natives.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698