OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of "isolate.dart"; | 5 part of "dart:isolate"; |
6 | 6 |
7 /** | 7 /** |
8 * An unforgeable object that comes back as equal when passed through other | 8 * An unforgeable object that comes back as equal when passed through other |
9 * isolates. | 9 * isolates. |
10 * | 10 * |
11 * Sending a capability object to another isolate, and getting it back, | 11 * Sending a capability object to another isolate, and getting it back, |
12 * will produce an object that is equal to the original. | 12 * will produce an object that is equal to the original. |
13 * There is no other way to create objects equal to a capability object. | 13 * There is no other way to create objects equal to a capability object. |
14 * | 14 * |
15 * Capabilities can be used as access guards: A remote isolate can send | 15 * Capabilities can be used as access guards: A remote isolate can send |
16 * a request for an operation, but it is only allowed if the request contains | 16 * a request for an operation, but it is only allowed if the request contains |
17 * the correct capability object. | 17 * the correct capability object. |
18 * | 18 * |
19 * This allows exposing the same interface to multiple clients, | 19 * This allows exposing the same interface to multiple clients, |
20 * but restricting some operations to only those clients | 20 * but restricting some operations to only those clients |
21 * that have also been given the corresponding capability. | 21 * that have also been given the corresponding capability. |
22 * | 22 * |
23 * Capabilities can be used inside a single isolate, | 23 * Capabilities can be used inside a single isolate, |
24 * but they have no advantage over | 24 * but they have no advantage over |
25 * just using `new Object` to create a unique object, | 25 * just using `new Object` to create a unique object, |
26 * and it offers no real security against other code | 26 * and it offers no real security against other code |
27 * running in the same isolate. | 27 * running in the same isolate. |
28 */ | 28 */ |
29 class Capability { | 29 class Capability { |
30 /** | 30 /** |
31 * Create a new unforgeable capability object. | 31 * Create a new unforgeable capability object. |
32 */ | 32 */ |
33 external factory Capability(); | 33 external factory Capability(); |
34 } | 34 } |
OLD | NEW |