| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 part of dart.isolate; | |
| 6 | |
| 7 /** | |
| 8 * An unforgeable object that comes back as equal when passed through other | |
| 9 * isolates. | |
| 10 * | |
| 11 * Sending a capability object to another isolate, and getting it back, | |
| 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. | |
| 14 * | |
| 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 | |
| 17 * the correct capability object. | |
| 18 * | |
| 19 * This allows exposing the same interface to multiple clients, | |
| 20 * but restricting some operations to only those clients | |
| 21 * that have also been given the corresponding capability. | |
| 22 * | |
| 23 * Capabilities can be used inside a single isolate, | |
| 24 * but they have no advantage over | |
| 25 * just using `new Object` to create a unique object, | |
| 26 * and it offers no real security against other code | |
| 27 * running in the same isolate. | |
| 28 */ | |
| 29 class Capability { | |
| 30 /** | |
| 31 * Create a new unforgeable capability object. | |
| 32 */ | |
| 33 external factory Capability(); | |
| 34 } | |
| OLD | NEW |