OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ScriptStreamer_h | 5 #ifndef ScriptStreamer_h |
6 #define ScriptStreamer_h | 6 #define ScriptStreamer_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 #include "wtf/Noncopyable.h" | 10 #include "wtf/Noncopyable.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 s_smallScriptThreshold = threshold; | 91 s_smallScriptThreshold = threshold; |
92 } | 92 } |
93 | 93 |
94 static size_t smallScriptThreshold() { return s_smallScriptThreshold; } | 94 static size_t smallScriptThreshold() { return s_smallScriptThreshold; } |
95 | 95 |
96 private: | 96 private: |
97 // Scripts whose first data chunk is smaller than this constant won't be | 97 // Scripts whose first data chunk is smaller than this constant won't be |
98 // streamed. Non-const for testing. | 98 // streamed. Non-const for testing. |
99 static size_t s_smallScriptThreshold; | 99 static size_t s_smallScriptThreshold; |
100 | 100 |
101 static RawPtr<ScriptStreamer> create(PendingScript* script, Type scriptType,
ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions, We
bTaskRunner* loadingTaskRunner) | 101 static ScriptStreamer* create(PendingScript* script, Type scriptType, Script
State* scriptState, v8::ScriptCompiler::CompileOptions compileOptions, WebTaskRu
nner* loadingTaskRunner) |
102 { | 102 { |
103 return new ScriptStreamer(script, scriptType, scriptState, compileOption
s, loadingTaskRunner); | 103 return new ScriptStreamer(script, scriptType, scriptState, compileOption
s, loadingTaskRunner); |
104 } | 104 } |
105 ScriptStreamer(PendingScript*, Type, ScriptState*, v8::ScriptCompiler::Compi
leOptions, WebTaskRunner*); | 105 ScriptStreamer(PendingScript*, Type, ScriptState*, v8::ScriptCompiler::Compi
leOptions, WebTaskRunner*); |
106 | 106 |
107 void streamingComplete(); | 107 void streamingComplete(); |
108 void notifyFinishedToClient(); | 108 void notifyFinishedToClient(); |
109 | 109 |
110 static bool startStreamingInternal(PendingScript*, Type, Settings*, ScriptSt
ate*, WebTaskRunner*); | 110 static bool startStreamingInternal(PendingScript*, Type, Settings*, ScriptSt
ate*, WebTaskRunner*); |
111 | 111 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 // Encoding of the streamed script. Saved for sanity checking purposes. | 151 // Encoding of the streamed script. Saved for sanity checking purposes. |
152 v8::ScriptCompiler::StreamedSource::Encoding m_encoding; | 152 v8::ScriptCompiler::StreamedSource::Encoding m_encoding; |
153 | 153 |
154 OwnPtr<WebTaskRunner> m_loadingTaskRunner; | 154 OwnPtr<WebTaskRunner> m_loadingTaskRunner; |
155 }; | 155 }; |
156 | 156 |
157 } // namespace blink | 157 } // namespace blink |
158 | 158 |
159 #endif // ScriptStreamer_h | 159 #endif // ScriptStreamer_h |
OLD | NEW |