From: marja@chromium.org Date: Thu, 11 Sep 2014 11:29:28 +0000 (+0000) Subject: Revert "Add script streaming API." X-Git-Tag: upstream/4.7.83~6985 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90af365ae3cbec95fcbb0acfd4c366eb90fb7e90;p=platform%2Fupstream%2Fv8.git Revert "Add script streaming API." This reverts r23865 Revert "Fix compilation after r23865." This reverts r23867 Reason: the test contains characters too special for Windows's taste. TBR=ulan@chromium.org BUG= Review URL: https://codereview.chromium.org/545203003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23868 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/BUILD.gn b/BUILD.gn index b5e56e5e5..76d48d1cd 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -435,8 +435,6 @@ source_set("v8_base") { "src/ast-value-factory.h", "src/ast.cc", "src/ast.h", - "src/background-parsing-task.cc", - "src/background-parsing-task.h", "src/bignum-dtoa.cc", "src/bignum-dtoa.h", "src/bignum.cc", diff --git a/include/v8.h b/include/v8.h index 7a2215e54..d6fbf67c0 100644 --- a/include/v8.h +++ b/include/v8.h @@ -130,7 +130,6 @@ class Heap; class HeapObject; class Isolate; class Object; -struct StreamedSource; template class CustomArguments; class PropertyCallbackArguments; class FunctionCallbackArguments; @@ -1089,73 +1088,6 @@ class V8_EXPORT ScriptCompiler { CachedData* cached_data; }; - /** - * For streaming incomplete script data to V8. The embedder should implement a - * subclass of this class. - */ - class ExternalSourceStream { - public: - virtual ~ExternalSourceStream() {} - - /** - * V8 calls this to request the next chunk of data from the embedder. This - * function will be called on a background thread, so it's OK to block and - * wait for the data, if the embedder doesn't have data yet. Returns the - * length of the data returned. When the data ends, GetMoreData should - * return 0. Caller takes ownership of the data. - * - * When streaming UTF-8 data, V8 handles multi-byte characters split between - * two data chunks, but doesn't handle multi-byte characters split between - * more than two data chunks. The embedder can avoid this problem by always - * returning at least 2 bytes of data. - * - * If the embedder wants to cancel the streaming, they should make the next - * GetMoreData call return 0. V8 will interpret it as end of data (and most - * probably, parsing will fail). The streaming task will return as soon as - * V8 has parsed the data it received so far. - */ - virtual size_t GetMoreData(const uint8_t** src) = 0; - }; - - - /** - * Source code which can be streamed into V8 in pieces. It will be parsed - * while streaming. It can be compiled after the streaming is complete. - * StreamedSource must be kept alive while the streaming task is ran (see - * ScriptStreamingTask below). - */ - class V8_EXPORT StreamedSource { - public: - enum Encoding { ONE_BYTE, TWO_BYTE, UTF8 }; - - StreamedSource(ExternalSourceStream* source_stream, Encoding encoding); - ~StreamedSource(); - - // Ownership of the CachedData or its buffers is *not* transferred to the - // caller. The CachedData object is alive as long as the StreamedSource - // object is alive. - const CachedData* GetCachedData() const; - - internal::StreamedSource* impl() const { return impl_; } - - private: - // Prevent copying. Not implemented. - StreamedSource(const StreamedSource&); - StreamedSource& operator=(const StreamedSource&); - - internal::StreamedSource* impl_; - }; - - /** - * A streaming task which the embedder must run on a background thread to - * stream scripts into V8. Returned by ScriptCompiler::StartStreamingScript. - */ - class ScriptStreamingTask { - public: - virtual ~ScriptStreamingTask() {} - virtual void Run() = 0; - }; - enum CompileOptions { kNoCompileOptions = 0, kProduceParserCache, @@ -1198,32 +1130,6 @@ class V8_EXPORT ScriptCompiler { static Local