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

Unified Diff: include/v8.h

Issue 1609021: Expose a hint which communicates that string might be written many times. (Closed)
Patch Set: Created 10 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 | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index db739bb7b68feb10e4280bd9ad246262bf365933..d90289ab99d27a4ae1f0c614dba73842523b26e7 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -859,18 +859,23 @@ class V8EXPORT String : public Primitive {
* \return The number of bytes copied to the buffer
* excluding the NULL terminator.
*/
- int Write(uint16_t* buffer, int start = 0, int length = -1) const; // UTF-16
- int WriteAscii(char* buffer, int start = 0, int length = -1) const; // ASCII
+ enum WriteHints {
+ NO_HINTS = 0,
+ HINT_MANY_WRITES_EXPECTED = 1
+ };
+
+ int Write(uint16_t* buffer,
+ int start = 0,
+ int length = -1,
+ WriteHints hints = NO_HINTS) const; // UTF-16
+ int WriteAscii(char* buffer,
+ int start = 0,
+ int length = -1,
+ WriteHints hints = NO_HINTS) const; // ASCII
int WriteUtf8(char* buffer,
int length = -1,
- int* nchars_ref = NULL) const; // UTF-8
-
- /**
- * Flatten internal memory. Operations on the string tend to run faster
- * after flattening especially if the string is a concatenation of many
- * others.
- */
- void Flatten();
+ int* nchars_ref = NULL,
+ WriteHints hints = NO_HINTS) const; // UTF-8
/**
* A zero length string.
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698