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

Unified Diff: src/scanner-character-streams.h

Issue 1156733002: Implement bookmarks for ExternalStreamingStream. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comments to interface methods. Created 5 years, 7 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 | « src/api.cc ('k') | src/scanner-character-streams.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner-character-streams.h
diff --git a/src/scanner-character-streams.h b/src/scanner-character-streams.h
index 36d84bc0f6b5d82a16b005bef0ea737138642a1f..e9047d3212e101675e777151e7a70f58ce290124 100644
--- a/src/scanner-character-streams.h
+++ b/src/scanner-character-streams.h
@@ -92,9 +92,14 @@ class ExternalStreamingStream : public BufferedUtf16CharacterStream {
current_data_(NULL),
current_data_offset_(0),
current_data_length_(0),
- utf8_split_char_buffer_length_(0) {}
+ utf8_split_char_buffer_length_(0),
+ bookmark_(0) {}
- virtual ~ExternalStreamingStream() { delete[] current_data_; }
+ virtual ~ExternalStreamingStream() {
+ delete[] current_data_;
+ bookmark_buffer_.Dispose();
+ bookmark_data_.Dispose();
+ }
size_t BufferSeekForward(size_t delta) override {
// We never need to seek forward when streaming scripts. We only seek
@@ -107,8 +112,12 @@ class ExternalStreamingStream : public BufferedUtf16CharacterStream {
size_t FillBuffer(size_t position) override;
+ virtual bool SetBookmark() override;
+ virtual void ResetToBookmark() override;
+
private:
void HandleUtf8SplitCharacters(size_t* data_in_buffer);
+ void FlushCurrent();
ScriptCompiler::ExternalSourceStream* source_stream_;
v8::ScriptCompiler::StreamedSource::Encoding encoding_;
@@ -118,6 +127,12 @@ class ExternalStreamingStream : public BufferedUtf16CharacterStream {
// For converting UTF-8 characters which are split across two data chunks.
uint8_t utf8_split_char_buffer_[4];
size_t utf8_split_char_buffer_length_;
+
+ // Bookmark support. See comments in ExternalStreamingStream::SetBookmark
+ // for additional details.
+ size_t bookmark_;
+ Vector<uint16_t> bookmark_buffer_;
+ Vector<uint8_t> bookmark_data_;
};
« no previous file with comments | « src/api.cc ('k') | src/scanner-character-streams.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698