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

Side by Side Diff: vm/dart_api_impl.cc

Issue 8527027: Fix signature for external string API methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 9 years, 1 month 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 | no next file » | 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 #include "include/dart_api.h" 5 #include "include/dart_api.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 896
897 897
898 DART_EXPORT Dart_Handle Dart_NewString32(const uint32_t* codepoints, 898 DART_EXPORT Dart_Handle Dart_NewString32(const uint32_t* codepoints,
899 intptr_t length) { 899 intptr_t length) {
900 DARTSCOPE(Isolate::Current()); 900 DARTSCOPE(Isolate::Current());
901 const String& obj = String::Handle(String::New(codepoints, length)); 901 const String& obj = String::Handle(String::New(codepoints, length));
902 return Api::NewLocalHandle(obj); 902 return Api::NewLocalHandle(obj);
903 } 903 }
904 904
905 905
906 DART_EXPORT Dart_Handle Dart_NewExternalString8(uint8_t* codepoints, 906 DART_EXPORT Dart_Handle Dart_NewExternalString8(const uint8_t* codepoints,
907 intptr_t length, 907 intptr_t length,
908 void* peer, 908 void* peer,
909 Dart_PeerFinalizer callback) { 909 Dart_PeerFinalizer callback) {
910 DARTSCOPE(Isolate::Current()); 910 DARTSCOPE(Isolate::Current());
911 const String& obj = 911 const String& obj =
912 String::Handle(String::NewExternal(codepoints, length, peer, callback)); 912 String::Handle(String::NewExternal(codepoints, length, peer, callback));
913 return Api::NewLocalHandle(obj); 913 return Api::NewLocalHandle(obj);
914 } 914 }
915 915
916 916
917 DART_EXPORT Dart_Handle Dart_NewExternalString16(uint16_t* codepoints, 917 DART_EXPORT Dart_Handle Dart_NewExternalString16(const uint16_t* codepoints,
918 intptr_t length, 918 intptr_t length,
919 void* peer, 919 void* peer,
920 Dart_PeerFinalizer callback) { 920 Dart_PeerFinalizer callback) {
921 DARTSCOPE(Isolate::Current()); 921 DARTSCOPE(Isolate::Current());
922 const String& obj = 922 const String& obj =
923 String::Handle(String::NewExternal(codepoints, length, peer, callback)); 923 String::Handle(String::NewExternal(codepoints, length, peer, callback));
924 return Api::NewLocalHandle(obj); 924 return Api::NewLocalHandle(obj);
925 } 925 }
926 926
927 927
928 DART_EXPORT Dart_Handle Dart_NewExternalString32(uint32_t* codepoints, 928 DART_EXPORT Dart_Handle Dart_NewExternalString32(const uint32_t* codepoints,
929 intptr_t length, 929 intptr_t length,
930 void* peer, 930 void* peer,
931 Dart_PeerFinalizer callback) { 931 Dart_PeerFinalizer callback) {
932 DARTSCOPE(Isolate::Current()); 932 DARTSCOPE(Isolate::Current());
933 const String& obj = 933 const String& obj =
934 String::Handle(String::NewExternal(codepoints, length, peer, callback)); 934 String::Handle(String::NewExternal(codepoints, length, peer, callback));
935 return Api::NewLocalHandle(obj); 935 return Api::NewLocalHandle(obj);
936 } 936 }
937 937
938 938
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 ASSERT(isolate != NULL); 2196 ASSERT(isolate != NULL);
2197 ApiState* state = isolate->api_state(); 2197 ApiState* state = isolate->api_state();
2198 ASSERT(state != NULL); 2198 ASSERT(state != NULL);
2199 ApiLocalScope* scope = state->top_scope(); 2199 ApiLocalScope* scope = state->top_scope();
2200 ASSERT(scope != NULL); 2200 ASSERT(scope != NULL);
2201 return scope->zone().Reallocate(ptr, old_size, new_size); 2201 return scope->zone().Reallocate(ptr, old_size, new_size);
2202 } 2202 }
2203 2203
2204 2204
2205 } // namespace dart 2205 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698