| 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" |
| 11 #include "wtf/text/WTFString.h" | 11 #include "wtf/text/WTFString.h" |
| 12 | 12 #include <memory> |
| 13 #include <v8.h> | 13 #include <v8.h> |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class PendingScript; | 17 class PendingScript; |
| 18 class Resource; | 18 class Resource; |
| 19 class ScriptResource; | 19 class ScriptResource; |
| 20 class ScriptState; | 20 class ScriptState; |
| 21 class Settings; | 21 class Settings; |
| 22 class SourceStream; | 22 class SourceStream; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // This pointer is weak. If PendingScript and its Resource are deleted | 113 // This pointer is weak. If PendingScript and its Resource are deleted |
| 114 // before ScriptStreamer, PendingScript will notify ScriptStreamer of its | 114 // before ScriptStreamer, PendingScript will notify ScriptStreamer of its |
| 115 // deletion by calling cancel(). | 115 // deletion by calling cancel(). |
| 116 Member<ScriptResource> m_resource; | 116 Member<ScriptResource> m_resource; |
| 117 // Whether ScriptStreamer is detached from the Resource. In those cases, the | 117 // Whether ScriptStreamer is detached from the Resource. In those cases, the |
| 118 // script data is not needed any more, and the client won't get notified | 118 // script data is not needed any more, and the client won't get notified |
| 119 // when the loading and streaming are done. | 119 // when the loading and streaming are done. |
| 120 bool m_detached; | 120 bool m_detached; |
| 121 | 121 |
| 122 SourceStream* m_stream; | 122 SourceStream* m_stream; |
| 123 OwnPtr<v8::ScriptCompiler::StreamedSource> m_source; | 123 std::unique_ptr<v8::ScriptCompiler::StreamedSource> m_source; |
| 124 bool m_loadingFinished; // Whether loading from the network is done. | 124 bool m_loadingFinished; // Whether loading from the network is done. |
| 125 // Whether the V8 side processing is done. Will be used by the main thread | 125 // Whether the V8 side processing is done. Will be used by the main thread |
| 126 // and the streamer thread; guarded by m_mutex. | 126 // and the streamer thread; guarded by m_mutex. |
| 127 bool m_parsingFinished; | 127 bool m_parsingFinished; |
| 128 // Whether we have received enough data to start the streaming. | 128 // Whether we have received enough data to start the streaming. |
| 129 bool m_haveEnoughDataForStreaming; | 129 bool m_haveEnoughDataForStreaming; |
| 130 | 130 |
| 131 // Whether the script source code should be retrieved from the Resource | 131 // Whether the script source code should be retrieved from the Resource |
| 132 // instead of the ScriptStreamer; guarded by m_mutex. | 132 // instead of the ScriptStreamer; guarded by m_mutex. |
| 133 bool m_streamingSuppressed; | 133 bool m_streamingSuppressed; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 144 const String m_scriptURLString; | 144 const String m_scriptURLString; |
| 145 | 145 |
| 146 // Keep the script resource dentifier for event tracing. | 146 // Keep the script resource dentifier for event tracing. |
| 147 const unsigned long m_scriptResourceIdentifier; | 147 const unsigned long m_scriptResourceIdentifier; |
| 148 | 148 |
| 149 mutable Mutex m_mutex; | 149 mutable Mutex m_mutex; |
| 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 std::unique_ptr<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 |