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

Unified Diff: runtime/include/dart_api.h

Issue 8383029: Implement external strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: pre-review clean-up Created 9 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/lib/string.dart » ('j') | runtime/vm/dart_api_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | runtime/lib/string.dart » ('j') | runtime/vm/dart_api_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698