Chromium Code Reviews| Index: sdk/lib/isolate/capability.dart |
| diff --git a/sdk/lib/isolate/capability.dart b/sdk/lib/isolate/capability.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a25dd2ad3c5fc8e22bfe7c37863eb169042a4dd2 |
| --- /dev/null |
| +++ b/sdk/lib/isolate/capability.dart |
| @@ -0,0 +1,34 @@ |
| +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| +// for details. 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 dart.isolate; |
| + |
| +/** |
| + * An unforgable object that comes back as equal when passed through other |
|
kasperl
2014/01/31 12:14:06
unforgable -> unforgeable
|
| + * isolates. |
| + * |
| + * Sending a capability object to another isolate, and getting it back, |
| + * will produce an object that is equal to the original. |
| + * There is no other way to create objects equal to a capability object. |
| + * |
| + * Capabilities can be used as access guards: A remote isolate can send |
| + * a request for an operation, but it is only allowed if the request contains |
| + * the correct capability object. |
| + * |
| + * This allows exposing the same interface to multiple clients, |
| + * but restricting some operations to only those clients |
| + * that have also been given the corresponding capability. |
| + * |
| + * Capabilities can be used inside a single isolate, |
| + * but they have no advantage over |
| + * just using `new Object` to create a unique object, |
| + * and it offers no real security against other code |
| + * running in the same isolate. |
| + */ |
| +class Capability { |
| + /** |
| + * Create a new unforgable capability object. |
| + */ |
| + external factory Capability(); |
| +} |