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

Side by Side Diff: runtime/include/dart_api.h

Issue 8775039: Add Dart_IsExternalString and Dart_ExternalStringGetPeer to the dart (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #ifndef INCLUDE_DART_API_H_ 5 #ifndef INCLUDE_DART_API_H_
6 #define INCLUDE_DART_API_H_ 6 #define INCLUDE_DART_API_H_
7 7
8 /** \mainpage Dart Embedding API Reference 8 /** \mainpage Dart Embedding API Reference
9 * 9 *
10 * Dart is a class-based programming language for creating structured 10 * Dart is a class-based programming language for creating structured
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 * 781 *
782 * \return The String object if no error occurs. Otherwise returns 782 * \return The String object if no error occurs. Otherwise returns
783 * an error handle. 783 * an error handle.
784 */ 784 */
785 DART_EXPORT Dart_Handle Dart_NewString32(const uint32_t* codepoints, 785 DART_EXPORT Dart_Handle Dart_NewString32(const uint32_t* codepoints,
786 intptr_t length); 786 intptr_t length);
787 787
788 788
789 typedef void (*Dart_PeerFinalizer)(void* peer); 789 typedef void (*Dart_PeerFinalizer)(void* peer);
790 790
791 /**
792 * Is this object an external String?
793 *
794 * An external String is a String which references a fixed array of
795 * codepoints which is external to the Dart heap.
796 */
797 DART_EXPORT bool Dart_IsExternalString(Dart_Handle object);
798
799 /**
800 * Retrieves the peer pointer associated with an external String.
801 */
802 DART_EXPORT Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle object,
803 void** peer);
804
805
806 /**
807 * Returns a String which references an external array of 8-bit codepoints.
808 *
809 * \param value An array of 8-bit codepoints. This array must not move.
810 * \param length The length of the codepoints array.
811 * \param peer An external pointer to associate with this string.
812 * \param callback A callback to be called when this string is finalized.
813 *
814 * \return The String object if no error occurs. Otherwise returns
815 * an error handle.
816 */
791 DART_EXPORT Dart_Handle Dart_NewExternalString8(const uint8_t* codepoints, 817 DART_EXPORT Dart_Handle Dart_NewExternalString8(const uint8_t* codepoints,
792 intptr_t length, 818 intptr_t length,
793 void* peer, 819 void* peer,
794 Dart_PeerFinalizer callback); 820 Dart_PeerFinalizer callback);
795 821
822 /**
823 * Returns a String which references an external array of 16-bit codepoints.
824 *
825 * \param value An array of 16-bit codepoints. This array must not move.
826 * \param length The length of the codepoints array.
827 * \param peer An external pointer to associate with this string.
828 * \param callback A callback to be called when this string is finalized.
829 *
830 * \return The String object if no error occurs. Otherwise returns
831 * an error handle.
832 */
796 DART_EXPORT Dart_Handle Dart_NewExternalString16(const uint16_t* codepoints, 833 DART_EXPORT Dart_Handle Dart_NewExternalString16(const uint16_t* codepoints,
797 intptr_t length, 834 intptr_t length,
798 void* peer, 835 void* peer,
799 Dart_PeerFinalizer callback); 836 Dart_PeerFinalizer callback);
800 837
838 /**
839 * Returns a String which references an external array of 32-bit codepoints.
840 *
841 * \param value An array of 32-bit codepoints. This array must not move.
842 * \param length The length of the codepoints array.
843 * \param peer An external pointer to associate with this string.
844 * \param callback A callback to be called when this string is finalized.
845 *
846 * \return The String object if no error occurs. Otherwise returns
847 * an error handle.
848 */
801 DART_EXPORT Dart_Handle Dart_NewExternalString32(const uint32_t* codepoints, 849 DART_EXPORT Dart_Handle Dart_NewExternalString32(const uint32_t* codepoints,
802 intptr_t length, 850 intptr_t length,
803 void* peer, 851 void* peer,
804 Dart_PeerFinalizer callback); 852 Dart_PeerFinalizer callback);
805 853
806 /** 854 /**
807 * Gets the codepoints from a String. 855 * Gets the codepoints from a String.
808 * 856 *
809 * This function is only valid on strings for which Dart_IsString8 is 857 * This function is only valid on strings for which Dart_IsString8 is
810 * true. Otherwise an error occurs. 858 * true. Otherwise an error occurs.
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 1275
1228 // --- Profiling support ---- 1276 // --- Profiling support ----
1229 1277
1230 // External pprof support for gathering and dumping symbolic 1278 // External pprof support for gathering and dumping symbolic
1231 // information that can be used for better profile reports for 1279 // information that can be used for better profile reports for
1232 // dynamically generated code. 1280 // dynamically generated code.
1233 DART_EXPORT void Dart_InitPprofSupport(); 1281 DART_EXPORT void Dart_InitPprofSupport();
1234 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size); 1282 DART_EXPORT void Dart_GetPprofSymbolInfo(void** buffer, int* buffer_size);
1235 1283
1236 #endif // INCLUDE_DART_API_H_ 1284 #endif // INCLUDE_DART_API_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698