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

Unified Diff: src/json-stringifier.h

Issue 736003002: Correctly escape RegExp source. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@regexpref
Patch Set: update webkit expectations Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-stringifier.h
diff --git a/src/json-stringifier.h b/src/json-stringifier.h
index cbceaaead79c9c1a2f4efdc80fecae95a729089b..393551dd9ad1f80b23c84d7e1a0e4afdd3e27638 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -97,9 +97,6 @@ class BasicJsonStringifier BASE_EMBEDDED {
template <typename Char>
INLINE(static bool DoNotEscape(Char c));
- template <typename Char>
- INLINE(static Vector<const Char> GetCharVector(Handle<String> string));
-
Result StackPush(Handle<Object> object);
void StackPop();
@@ -634,7 +631,7 @@ void BasicJsonStringifier::SerializeString_(Handle<String> string) {
int worst_case_length = length << 3;
if (builder_.CurrentPartCanFit(worst_case_length)) {
DisallowHeapAllocation no_gc;
- Vector<const SrcChar> vector = GetCharVector<SrcChar>(string);
+ Vector<const SrcChar> vector = string->GetCharVector<SrcChar>();
IncrementalStringBuilder::NoExtendBuilder<DestChar> no_extend(
&builder_, worst_case_length);
SerializeStringUnchecked_(vector, &no_extend);
@@ -666,23 +663,6 @@ bool BasicJsonStringifier::DoNotEscape(uint16_t c) {
}
-template <>
-Vector<const uint8_t> BasicJsonStringifier::GetCharVector(
- Handle<String> string) {
- String::FlatContent flat = string->GetFlatContent();
- DCHECK(flat.IsOneByte());
- return flat.ToOneByteVector();
-}
-
-
-template <>
-Vector<const uc16> BasicJsonStringifier::GetCharVector(Handle<String> string) {
- String::FlatContent flat = string->GetFlatContent();
- DCHECK(flat.IsTwoByte());
- return flat.ToUC16Vector();
-}
-
-
void BasicJsonStringifier::SerializeString(Handle<String> object) {
object = String::Flatten(object);
if (builder_.CurrentEncoding() == String::ONE_BYTE_ENCODING) {
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698