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

Side by Side Diff: src/background-parsing-task.h

Issue 366153002: Add script streaming API (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: cleanup Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef V8_BACKGROUND_PARSING_TASK_H_
6 #define V8_BACKGROUND_PARSING_TASK_H_
7
8 #include "src/base/platform/platform.h"
9 #include "src/base/platform/semaphore.h"
10 #include "src/compiler.h"
11
12 namespace v8 {
13 namespace internal {
14
15 class Parser;
16
17 // Data which needs to be transmitted between threads for background parsing,
18 // finalizing it on the main thread, and compiling on the main thread. Carried
19 // by ScriptSource. (It cannot be carried by BackgroundParsingTask, because
20 // BackgroundParsingTask is deleted right after it's ran.)
21 class StreamingData {
jochen (gone - plz use gerrit) 2014/09/08 11:27:06 if it's just a container, this should be a struct
marja 2014/09/08 16:14:47 Done.
22 public:
23 StreamingData(i::CompilationInfo* i, uint32_t h, UnicodeCache* u, bool a)
jochen (gone - plz use gerrit) 2014/09/08 11:27:06 info, hash_seed, etc..
marja 2014/09/08 16:14:47 This code was deleted.
24 : info(i), hash_seed(h), unicode_cache(u), allow_lazy(a), parser(NULL) {}
25
26 ~StreamingData();
27
28 CompilationInfo* info;
29 uint32_t hash_seed;
30 UnicodeCache* unicode_cache; // Owned.
jochen (gone - plz use gerrit) 2014/09/08 11:27:06 how can this be owned, if the data is copied aroun
marja 2014/09/08 16:14:47 Prevented copying (which was non-prevented by omis
31 bool allow_lazy;
32 Parser* parser; // Owned.
33 };
34
35 class BackgroundParsingTask : public ScriptCompiler::ScriptStreamingTask {
36 public:
37 explicit BackgroundParsingTask(ScriptCompiler::StreamedSource* source)
38 : source_(source), script_data_(NULL) {}
39
40 virtual void Run();
41
42 private:
43 friend class v8::ScriptCompiler;
44
45 ScriptCompiler::StreamedSource* source_;
46 ScriptData* script_data_;
47 };
48 }
49 } // namespace v8::internal
50
51 #endif // V8_BACKGROUND_PARSING_TASK_H_
OLDNEW
« include/v8.h ('K') | « src/api.cc ('k') | src/background-parsing-task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698