Chromium Code Reviews| Index: runtime/include/dart_api.h |
| diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h |
| index c8faf4fbde751742299289e6213915e9d902c68a..59d410c89da0d6578dc77f59c1fbbb3bc513f8a7 100755 |
| --- a/runtime/include/dart_api.h |
| +++ b/runtime/include/dart_api.h |
| @@ -98,6 +98,10 @@ typedef Dart_Result (*Dart_LibraryTagHandler)(Dart_LibraryTag tag, |
| Dart_Handle library, |
| Dart_Handle url); |
| +typedef void (*Dart_ExternalString8Finalizer)(uint8_t* codepoints); |
| +typedef void (*Dart_ExternalString16Finalizer)(uint16_t* codepoints); |
| +typedef void (*Dart_ExternalString32Finalizer)(uint32_t* codepoints); |
| + |
| // TODO(iposva): This is a placeholder for the eventual external Dart API. |
| // Return value handling after a Dart API call. |
| @@ -293,6 +297,20 @@ DART_EXPORT Dart_Handle Dart_NewString16(const uint16_t* codepoints, |
| DART_EXPORT Dart_Handle Dart_NewString32(const uint32_t* codepoints, |
| intptr_t length); |
| +DART_EXPORT Dart_Handle Dart_NewExternalString8( |
|
Anton Muhin
2011/10/25 10:19:02
this API might be difficult to use by embedder. F
cshapiro
2011/10/25 20:42:47
Sure, I'll add and additional argument.
|
| + uint8_t* codepoints, |
| + intptr_t length, |
| + Dart_ExternalString8Finalizer finalizer); |
| +DART_EXPORT Dart_Handle Dart_NewExternalString16( |
|
Anton Muhin
2011/10/25 10:19:02
Another note, just in case: ideally we need a way
cshapiro
2011/10/25 20:42:47
Doesn't the embedding API provide a way to do this
Anton Muhin
2011/10/26 14:11:52
Not quite. I do not want to fetch a codepoints ou
cshapiro
2011/10/26 23:35:08
Okay, I think I understand more about what you wan
Anton Muhin
2011/10/27 14:14:46
Sorry, I didn't mean data is invalid. I meant it
cshapiro
2011/10/27 21:12:51
Thanks for clarifying. I think we can do what you
Anton Muhin
2011/10/31 09:02:04
I'll run GMail in customized build to gather the s
Anton Muhin
2011/11/01 17:40:44
Promised data (I collected all the string which ca
|
| + uint16_t* codepoints, |
| + intptr_t length, |
| + Dart_ExternalString16Finalizer finalizer); |
| +DART_EXPORT Dart_Handle Dart_NewExternalString32( |
| + uint32_t* codepoints, |
| + intptr_t length, |
| + Dart_ExternalString32Finalizer finalizer); |
| + |
| + |
| // The functions below test whether the object is a String and its codepoints |
| // all fit into 8 or 16 bits respectively. |
| DART_EXPORT bool Dart_IsString8(Dart_Handle object); |