Chromium Code Reviews| 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/dom/PendingScript.h" | 8 #include "core/dom/PendingScript.h" |
| 9 #include "wtf/RefCounted.h" | 9 #include "wtf/RefCounted.h" |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 // we have the code cache for the script) and we still want to parse and | 59 // we have the code cache for the script) and we still want to parse and |
| 60 // execute it when it has finished loading. | 60 // execute it when it has finished loading. |
| 61 void suppressStreaming(); | 61 void suppressStreaming(); |
| 62 bool streamingSuppressed() const { return m_streamingSuppressed; } | 62 bool streamingSuppressed() const { return m_streamingSuppressed; } |
| 63 | 63 |
| 64 unsigned cachedDataType() const { return m_cachedDataType; } | 64 unsigned cachedDataType() const { return m_cachedDataType; } |
| 65 | 65 |
| 66 void addClient(ScriptResourceClient* client) | 66 void addClient(ScriptResourceClient* client) |
| 67 { | 67 { |
| 68 ASSERT(!m_client); | 68 ASSERT(!m_client); |
| 69 ASSERT(!isFinished()); | |
|
haraken
2014/10/15 15:09:41
Can we keep this ASSERT?
We want to avoid a situa
marja
2014/10/16 15:19:03
No, since ScriptLoader::prepareScript calls this f
| |
| 70 m_client = client; | 69 m_client = client; |
| 70 notifyFinishedToClient(); | |
| 71 } | 71 } |
| 72 | 72 |
| 73 void removeClient(ScriptResourceClient* client) | 73 void removeClient(ScriptResourceClient* client) |
| 74 { | 74 { |
| 75 ASSERT(m_client == client); | 75 ASSERT(m_client == client); |
| 76 m_client = 0; | 76 m_client = 0; |
| 77 } | 77 } |
| 78 | 78 |
| 79 // Called by PendingScript when data arrives from the network. | 79 // Called by PendingScript when data arrives from the network. |
| 80 void notifyAppendData(ScriptResource*); | 80 void notifyAppendData(ScriptResource*); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 // What kind of cached data V8 produces during streaming. | 128 // What kind of cached data V8 produces during streaming. |
| 129 unsigned m_cachedDataType; | 129 unsigned m_cachedDataType; |
| 130 | 130 |
| 131 // For recording metrics for different types of scripts separately. | 131 // For recording metrics for different types of scripts separately. |
| 132 PendingScript::Type m_scriptType; | 132 PendingScript::Type m_scriptType; |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 } // namespace blink | 135 } // namespace blink |
| 136 | 136 |
| 137 #endif // ScriptStreamer_h | 137 #endif // ScriptStreamer_h |
| OLD | NEW |