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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1859273002: Add flag to disable string externalization (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « runtime/vm/constant_propagator.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index fd0050dd4dc4337688e6d8b605c4a683eed16571..7b0953bc7992ab44e160a5d06f9ca5c1a3d78f21 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -59,6 +59,9 @@ DEFINE_FLAG(bool, check_function_fingerprints, true,
#endif // defined(DART_NO_SNAPSHOT).
DEFINE_FLAG(bool, verify_acquired_data, false,
"Verify correct API acquire/release of typed data.");
+DEFINE_FLAG(bool, support_externalizable_strings, true,
+ "Support Dart_MakeExternalString.");
+
ThreadLocalKey Api::api_native_key_ = kUnsetThreadLocalKey;
Dart_Handle Api::true_handle_ = NULL;
@@ -2519,6 +2522,10 @@ DART_EXPORT Dart_Handle Dart_MakeExternalString(Dart_Handle str,
void* peer,
Dart_PeerFinalizer cback) {
DARTSCOPE(Thread::Current());
+ if (!FLAG_support_externalizable_strings) {
+ return Api::NewError("Dart_MakeExternalString with "
+ "--support_externalizable_strings=false");
+ }
const String& str_obj = Api::UnwrapStringHandle(Z, str);
if (str_obj.IsExternal()) {
return str; // String is already an external string.
« no previous file with comments | « runtime/vm/constant_propagator.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698