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

Unified Diff: src/value-serializer.h

Issue 2245753002: Blink-compatible serialization of strings. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@vs2
Patch Set: explicit cast to actually make it an unsigned comparison Created 4 years, 4 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/value-serializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/value-serializer.h
diff --git a/src/value-serializer.h b/src/value-serializer.h
index eedd91abc31f4c5d111664144293115c7116a855..433a6f72b0ebd8542f37a517e9a256070297c54a 100644
--- a/src/value-serializer.h
+++ b/src/value-serializer.h
@@ -59,11 +59,15 @@ class ValueSerializer {
template <typename T>
void WriteZigZag(T value);
void WriteDouble(double value);
+ void WriteOneByteString(Vector<const uint8_t> chars);
+ void WriteTwoByteString(Vector<const uc16> chars);
+ uint8_t* ReserveRawBytes(size_t bytes);
// Writing V8 objects of various kinds.
void WriteOddball(Oddball* oddball);
void WriteSmi(Smi* smi);
void WriteHeapNumber(HeapNumber* number);
+ void WriteString(Handle<String> string);
std::vector<uint8_t> buffer_;
@@ -90,12 +94,19 @@ class ValueDeserializer {
MaybeHandle<Object> ReadObject() WARN_UNUSED_RESULT;
private:
+ // Reading the wire format.
Maybe<SerializationTag> ReadTag() WARN_UNUSED_RESULT;
template <typename T>
Maybe<T> ReadVarint() WARN_UNUSED_RESULT;
template <typename T>
Maybe<T> ReadZigZag() WARN_UNUSED_RESULT;
Maybe<double> ReadDouble() WARN_UNUSED_RESULT;
+ Maybe<Vector<const uint8_t>> ReadRawBytes(int size) WARN_UNUSED_RESULT;
+
+ // Reading V8 objects of specific kinds.
+ // The tag is assumed to have already been read.
+ MaybeHandle<String> ReadUtf8String() WARN_UNUSED_RESULT;
+ MaybeHandle<String> ReadTwoByteString() WARN_UNUSED_RESULT;
Isolate* const isolate_;
const uint8_t* position_;
« no previous file with comments | « no previous file | src/value-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698