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

Unified Diff: src/factory.cc

Issue 11469014: Add a safe API for creating ASCII-only strings
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.h ('k') | src/heap.h » ('j') | src/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 556f2b01b793bc11c45a1c0a1f094e57b02ff835..c4c792dcc41083b50bbe41c516839a3438c8ea44 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -204,6 +204,16 @@ Handle<String> Factory::NewStringFromAscii(Vector<const char> string,
String);
}
+
+Handle<String> Factory::NewStringFromAsciiSafe(Vector<const char> string,
+ PretenureFlag pretenure) {
+ CALL_HEAP_FUNCTION(
+ isolate(),
+ isolate()->heap()->AllocateStringFromAsciiSafe(string, pretenure),
+ String);
+}
+
+
Handle<String> Factory::NewStringFromUtf8(Vector<const char> string,
PretenureFlag pretenure) {
CALL_HEAP_FUNCTION(
« no previous file with comments | « src/factory.h ('k') | src/heap.h » ('j') | src/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698