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: third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h

Issue 2724153002: ScriptStreamer: make state variables main-thread-only. (Closed)
Patch Set: remove reference to mutex in comment Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 8 #include <memory>
9 9
10 #include "core/CoreExport.h" 10 #include "core/CoreExport.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // deletion by calling cancel(). 134 // deletion by calling cancel().
135 Member<ScriptResource> m_resource; 135 Member<ScriptResource> m_resource;
136 // Whether ScriptStreamer is detached from the Resource. In those cases, the 136 // Whether ScriptStreamer is detached from the Resource. In those cases, the
137 // script data is not needed any more, and the client won't get notified 137 // script data is not needed any more, and the client won't get notified
138 // when the loading and streaming are done. 138 // when the loading and streaming are done.
139 bool m_detached; 139 bool m_detached;
140 140
141 SourceStream* m_stream; 141 SourceStream* m_stream;
142 std::unique_ptr<v8::ScriptCompiler::StreamedSource> m_source; 142 std::unique_ptr<v8::ScriptCompiler::StreamedSource> m_source;
143 bool m_loadingFinished; // Whether loading from the network is done. 143 bool m_loadingFinished; // Whether loading from the network is done.
144 // Whether the V8 side processing is done. Will be used by the main thread 144 bool m_parsingFinished; // Whether the V8 side processing is done.
145 // and the streamer thread; guarded by m_mutex.
146 bool m_parsingFinished;
147 // Whether we have received enough data to start the streaming. 145 // Whether we have received enough data to start the streaming.
148 bool m_haveEnoughDataForStreaming; 146 bool m_haveEnoughDataForStreaming;
149 147
150 // Whether the script source code should be retrieved from the Resource 148 // Whether the script source code should be retrieved from the Resource
151 // instead of the ScriptStreamer; guarded by m_mutex. 149 // instead of the ScriptStreamer.
152 bool m_streamingSuppressed; 150 bool m_streamingSuppressed;
153 151
154 // What kind of cached data V8 produces during streaming. 152 // What kind of cached data V8 produces during streaming.
155 v8::ScriptCompiler::CompileOptions m_compileOptions; 153 v8::ScriptCompiler::CompileOptions m_compileOptions;
156 154
157 RefPtr<ScriptState> m_scriptState; 155 RefPtr<ScriptState> m_scriptState;
158 156
159 // For recording metrics for different types of scripts separately. 157 // For recording metrics for different types of scripts separately.
160 Type m_scriptType; 158 Type m_scriptType;
161 159
162 // Keep the script URL string for event tracing. 160 // Keep the script URL string for event tracing.
163 const String m_scriptURLString; 161 const String m_scriptURLString;
164 162
165 // Keep the script resource dentifier for event tracing. 163 // Keep the script resource dentifier for event tracing.
166 const unsigned long m_scriptResourceIdentifier; 164 const unsigned long m_scriptResourceIdentifier;
167 165
168 mutable Mutex m_mutex;
169
170 // Encoding of the streamed script. Saved for sanity checking purposes. 166 // Encoding of the streamed script. Saved for sanity checking purposes.
171 v8::ScriptCompiler::StreamedSource::Encoding m_encoding; 167 v8::ScriptCompiler::StreamedSource::Encoding m_encoding;
172 168
173 RefPtr<WebTaskRunner> m_loadingTaskRunner; 169 RefPtr<WebTaskRunner> m_loadingTaskRunner;
174 }; 170 };
175 171
176 } // namespace blink 172 } // namespace blink
177 173
178 #endif // ScriptStreamer_h 174 #endif // ScriptStreamer_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698