OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 * Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3 * for details. All rights reserved. Use of this source code is governed by a | 3 * for details. All rights reserved. Use of this source code is governed by a |
4 * BSD-style license that can be found in the LICENSE file. | 4 * BSD-style license that can be found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #ifndef INCLUDE_DART_API_H_ | 7 #ifndef INCLUDE_DART_API_H_ |
8 #define INCLUDE_DART_API_H_ | 8 #define INCLUDE_DART_API_H_ |
9 | 9 |
10 /** \mainpage Dart Embedding API Reference | 10 /** \mainpage Dart Embedding API Reference |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
520 Dart_WeakPersistentHandleFinalizer callback); | 520 Dart_WeakPersistentHandleFinalizer callback); |
521 | 521 |
522 /** | 522 /** |
523 * Is this object a prologue weak persistent handle? | 523 * Is this object a prologue weak persistent handle? |
524 * | 524 * |
525 * Requires there to be a current isolate. | 525 * Requires there to be a current isolate. |
526 */ | 526 */ |
527 DART_EXPORT bool Dart_IsPrologueWeakPersistentHandle( | 527 DART_EXPORT bool Dart_IsPrologueWeakPersistentHandle( |
528 Dart_WeakPersistentHandle object); | 528 Dart_WeakPersistentHandle object); |
529 | 529 |
530 typedef struct _Dart_WeakReferenceSetBuilder* Dart_WeakReferenceSetBuilder; | |
531 typedef struct _Dart_WeakReferenceSet* Dart_WeakReferenceSet; | |
532 | |
533 /** | |
534 * Constructs a weak references set builder. | |
535 * | |
536 * \returns a handle to the weak reference set builder if successful. | |
Ivan Posva
2014/04/17 23:47:44
Please name this something else as this is really
siva
2014/04/21 18:04:14
s/handle/pointer/
On 2014/04/17 23:47:44, Ivan Po
| |
537 * Otherwise, returns NULL. | |
538 */ | |
539 DART_EXPORT Dart_WeakReferenceSetBuilder Dart_NewWeakReferenceSetBuilder(); | |
540 | |
530 /** | 541 /** |
531 * Constructs a set of weak references from the Cartesian product of | 542 * Constructs a set of weak references from the Cartesian product of |
532 * the objects in the key set and the objects in values set. | 543 * the objects in the key set and the objects in values set. |
533 * | 544 * |
534 * \param keys A set of object references. These references will be | 545 * \param set_builder The weak references set builder which was created |
546 * using Dart_NewWeakReferenceSetBuilder(). | |
547 * \param key An object reference. This references will be | |
535 * considered weak by the garbage collector. | 548 * considered weak by the garbage collector. |
536 * \param num_keys the number of objects in the keys set. | 549 * \param value An object reference. This reference will be |
537 * \param values A set of object references. These references will be | |
538 * considered weak by garbage collector unless any object reference | 550 * considered weak by garbage collector unless any object reference |
539 * in 'keys' is found to be strong. | 551 * in 'keys' is found to be strong. |
540 * \param num_values the size of the values set | |
541 * | 552 * |
542 * \return Success if the weak reference set could be created. | 553 * \return a handle to the weak reference set if successful. |
543 * Otherwise, returns an error handle. | 554 * Otherwise, returns NULL. |
544 */ | 555 */ |
545 DART_EXPORT Dart_Handle Dart_NewWeakReferenceSet( | 556 DART_EXPORT Dart_WeakReferenceSet Dart_NewWeakReferenceSet( |
546 Dart_WeakPersistentHandle* keys, | 557 Dart_WeakReferenceSetBuilder set_builder, |
547 intptr_t num_keys, | 558 Dart_WeakPersistentHandle key, |
548 Dart_WeakPersistentHandle* values, | 559 Dart_WeakPersistentHandle value); |
549 intptr_t num_values); | 560 |
561 /** | |
562 * Append the pair of key/value object references to the weak references set. | |
563 * | |
564 * \param reference_set A weak references set into which the pair of key/value | |
565 * needs to be added. | |
566 * \param key An object reference. This references will be | |
567 * considered weak by the garbage collector. | |
568 * \param value An object reference. This reference will be | |
569 * considered weak by garbage collector unless any object reference | |
570 * in 'keys' is found to be strong. | |
571 * | |
572 * \return Success if the prologue weak persistent handle was created. | |
573 * Otherwise, returns an error. | |
574 */ | |
575 DART_EXPORT Dart_Handle Dart_AppendToWeakReferenceSet( | |
576 Dart_WeakReferenceSet reference_set, | |
577 Dart_WeakPersistentHandle key, | |
578 Dart_WeakPersistentHandle value); | |
579 | |
580 /** | |
581 * Append the key object reference to the weak references set. | |
582 * | |
583 * \param reference_set A weak references set into which the key | |
584 * needs to be added. | |
585 * \param key An object reference. This references will be | |
586 * considered weak by the garbage collector. | |
587 * | |
588 * \return Success if the prologue weak persistent handle was created. | |
589 * Otherwise, returns an error. | |
590 */ | |
591 DART_EXPORT Dart_Handle Dart_AppendKeyToWeakReferenceSet( | |
592 Dart_WeakReferenceSet reference_set, | |
593 Dart_WeakPersistentHandle key); | |
594 | |
595 /** | |
596 * Append the value object reference to the weak references set. | |
597 * | |
598 * \param reference_set A weak references set into which the key | |
599 * needs to be added. | |
600 * \param value An object reference. This references will be | |
601 * considered weak by the garbage collector. | |
602 * | |
603 * \return Success if the prologue weak persistent handle was created. | |
604 * Otherwise, returns an error. | |
605 */ | |
606 DART_EXPORT Dart_Handle Dart_AppendValueToWeakReferenceSet( | |
607 Dart_WeakReferenceSet reference_set, | |
608 Dart_WeakPersistentHandle value); | |
609 | |
610 /** | |
611 * Register the weak references set with the garbage collector. | |
612 * During garbage collection references in the 'keys' array will be | |
613 * considered weak. References in the 'values' array will be | |
614 * considered weak unless any object reference in 'keys' is found to be | |
615 * strong. | |
616 * | |
617 * \param set_builder The weak references set builder which was created | |
618 * using Dart_NewWeakReferenceSetBuilder(). | |
619 * \param reference_set The weak references set which needs to be | |
620 * registered with the garbage collector. | |
621 * | |
622 * \return Success if the prologue weak persistent handle was created. | |
623 * Otherwise, returns an error. | |
624 */ | |
625 DART_EXPORT Dart_Handle Dart_RegisterWeakReferenceSet( | |
Ivan Posva
2014/04/17 23:47:44
As discussed this can be entirely removed. Just cr
siva
2014/04/21 18:04:14
Done.
| |
626 Dart_WeakReferenceSetBuilder set_builder, | |
627 Dart_WeakReferenceSet reference_set); | |
550 | 628 |
551 | 629 |
552 /* | 630 /* |
553 * ============================ | 631 * ============================ |
554 * Garbage Collection Callbacks | 632 * Garbage Collection Callbacks |
555 * ============================ | 633 * ============================ |
556 */ | 634 */ |
557 | 635 |
558 /** | 636 /** |
559 * Callbacks signal the beginning and end of a garbage collection. | 637 * Callbacks signal the beginning and end of a garbage collection. |
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2568 * NOTE: If multiple callbacks with the same name are registered, only the | 2646 * NOTE: If multiple callbacks with the same name are registered, only the |
2569 * last callback registered will be remembered. | 2647 * last callback registered will be remembered. |
2570 */ | 2648 */ |
2571 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 2649 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
2572 const char* name, | 2650 const char* name, |
2573 Dart_ServiceRequestCallback callback, | 2651 Dart_ServiceRequestCallback callback, |
2574 void* user_data); | 2652 void* user_data); |
2575 | 2653 |
2576 | 2654 |
2577 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ | 2655 #endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ |
OLD | NEW |