| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 ClassicPendingScript_h | 5 #ifndef ClassicPendingScript_h |
| 6 #define ClassicPendingScript_h | 6 #define ClassicPendingScript_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptStreamer.h" | 8 #include "bindings/core/v8/ScriptStreamer.h" |
| 9 #include "core/dom/ClassicScript.h" | 9 #include "core/dom/ClassicScript.h" |
| 10 #include "core/dom/PendingScript.h" | 10 #include "core/dom/PendingScript.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 bool ErrorOccurred() const override; | 54 bool ErrorOccurred() const override; |
| 55 bool WasCanceled() const override; | 55 bool WasCanceled() const override; |
| 56 bool StartStreamingIfPossible(ScriptStreamer::Type, WTF::Closure) override; | 56 bool StartStreamingIfPossible(ScriptStreamer::Type, WTF::Closure) override; |
| 57 bool IsCurrentlyStreaming() const override; | 57 bool IsCurrentlyStreaming() const override; |
| 58 KURL UrlForClassicScript() const override; | 58 KURL UrlForClassicScript() const override; |
| 59 void RemoveFromMemoryCache() override; | 59 void RemoveFromMemoryCache() override; |
| 60 void DisposeInternal() override; | 60 void DisposeInternal() override; |
| 61 | 61 |
| 62 void Prefinalize(); | 62 void Prefinalize(); |
| 63 | 63 |
| 64 const ScriptResourceData* ResourceData() const { return resource_data_; } |
| 65 |
| 64 private: | 66 private: |
| 65 // See AdvanceReadyState implementation for valid state transitions. | 67 // See AdvanceReadyState implementation for valid state transitions. |
| 66 enum ReadyState { | 68 enum ReadyState { |
| 67 // These states are considered "not ready". | 69 // These states are considered "not ready". |
| 68 kWaitingForResource, | 70 kWaitingForResource, |
| 69 kWaitingForStreaming, | 71 kWaitingForStreaming, |
| 70 // These states are considered "ready". | 72 // These states are considered "ready". |
| 71 kReady, | 73 kReady, |
| 72 kReadyStreaming, | 74 kReadyStreaming, |
| 73 kErrorOccurred, | 75 kErrorOccurred, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 101 bool integrity_failure_; | 103 bool integrity_failure_; |
| 102 | 104 |
| 103 Member<ScriptStreamer> streamer_; | 105 Member<ScriptStreamer> streamer_; |
| 104 WTF::Closure streamer_done_; | 106 WTF::Closure streamer_done_; |
| 105 | 107 |
| 106 // This is a temporary flag to confirm that ClassicPendingScript is not | 108 // This is a temporary flag to confirm that ClassicPendingScript is not |
| 107 // touched after its refinalizer call and thus https://crbug.com/715309 | 109 // touched after its refinalizer call and thus https://crbug.com/715309 |
| 108 // doesn't break assumptions. | 110 // doesn't break assumptions. |
| 109 // TODO(hiroshige): Check the state in more general way. | 111 // TODO(hiroshige): Check the state in more general way. |
| 110 bool prefinalizer_called_ = false; | 112 bool prefinalizer_called_ = false; |
| 113 |
| 114 Member<const ScriptResourceData> resource_data_; |
| 111 }; | 115 }; |
| 112 | 116 |
| 113 } // namespace blink | 117 } // namespace blink |
| 114 | 118 |
| 115 #endif // PendingScript_h | 119 #endif // PendingScript_h |
| OLD | NEW |